@canva/cli 0.0.1-beta.16 → 0.0.1-beta.18
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/cli.js +450 -454
- package/lib/cjs/index.cjs +318 -322
- package/lib/esm/index.mjs +318 -322
- package/package.json +2 -2
- package/templates/base/eslint.config.mjs +2 -2
- package/templates/base/package.json +4 -4
- package/templates/base/scripts/start/app_runner.ts +1 -1
- package/templates/{dam/webpack.config.cjs → base/webpack.config.ts} +33 -43
- package/templates/common/conf/{eslint-general.mjs → eslint_general.mjs} +14 -0
- package/templates/dam/eslint.config.mjs +2 -2
- package/templates/dam/package.json +15 -14
- package/templates/dam/scripts/start/app_runner.ts +1 -1
- package/templates/{base/webpack.config.cjs → dam/webpack.config.ts} +33 -43
- package/templates/gen_ai/eslint.config.mjs +2 -2
- package/templates/gen_ai/package.json +18 -15
- package/templates/gen_ai/scripts/start/app_runner.ts +1 -1
- package/templates/{hello_world/webpack.config.cjs → gen_ai/webpack.config.ts} +33 -43
- package/templates/hello_world/eslint.config.mjs +2 -2
- package/templates/hello_world/package.json +15 -14
- package/templates/hello_world/scripts/start/app_runner.ts +1 -1
- package/templates/{gen_ai/webpack.config.cjs → hello_world/webpack.config.ts} +33 -43
- /package/templates/base/scripts/{copy-env.ts → copy_env.ts} +0 -0
- /package/templates/common/conf/{eslint-i18n.mjs → eslint_i18n.mjs} +0 -0
- /package/templates/dam/scripts/{copy-env.ts → copy_env.ts} +0 -0
- /package/templates/gen_ai/scripts/{copy-env.ts → copy_env.ts} +0 -0
- /package/templates/hello_world/scripts/{copy-env.ts → copy_env.ts} +0 -0
package/lib/cjs/index.cjs
CHANGED
|
@@ -1,392 +1,388 @@
|
|
|
1
1
|
// Copyright 2024 Canva Inc. All Rights Reserved.
|
|
2
|
-
"use strict";var
|
|
3
|
-
`);
|
|
4
|
-
`)[0].split(":");
|
|
5
|
-
`)[0].split(".");
|
|
6
|
-
`);
|
|
7
|
-
`).length>0}catch{
|
|
8
|
-
`),
|
|
9
|
-
`)}catch{return!1}let t=
|
|
10
|
-
`||e[
|
|
11
|
-
`),
|
|
12
|
-
`);for(let r=0;r<t.length;r++){if(t[r].indexOf(" = ")>=0){let i=t[r].split(" = ");if(i[0]=i[0].trim(),i[0].startsWith('"')||(i[0]='"'+i[0]+'"'),i[1]=i[1].trim(),i[1].indexOf('"')===-1&&i[1].endsWith(";")){let n=i[1].substring(0,i[1].length-1);Ui(n)||(i[1]=`"${n}";`)}if(i[1].indexOf('"')>=0&&i[1].endsWith(";")){let n=i[1].substring(0,i[1].length-1).replace(/"/g,"");Ui(n)&&(i[1]=`${n};`)}t[r]=i.join(" : ")}t[r]=t[r].replace(/\(/g,"[").replace(/\)/g,"]").replace(/;/g,",").trim(),t[r].startsWith("}")&&t[r-1]&&t[r-1].endsWith(",")&&(t[r-1]=t[r-1].substring(0,t[r-1].length-1))}s=t.join("");let e={};try{e=JSON.parse(s)}catch{}return e}function Mc(s,t){let e=0,r=s.split("."),i=t.split(".");return r[0]<i[0]?e=1:r[0]>i[0]?e=-1:r[0]===i[0]&&r.length>=2&&i.length>=2&&(r[1]<i[1]?e=1:r[1]>i[1]?e=-1:r[1]===i[1]&&(r.length>=3&&i.length>=3?r[2]<i[2]?e=1:r[2]>i[2]&&(e=-1):i.length>=3&&(e=1))),e}function Rc(){}U.toInt=Kl;U.splitByNumber=Zl;U.execOptsWin=Qs;U.execOptsLinux=$i;U.getCodepage=hc;U.execWin=Sc;U.isFunction=ec;U.unique=tc;U.sortByKey=sc;U.cores=rc;U.getValue=as;U.decodeEscapeSequence=nc;U.parseDateTime=ac;U.parseHead=lc;U.findObjectByKey=cc;U.getWmic=Zi;U.wmic=uc;U.darwinXcodeExists=vc;U.getVboxmanage=pc;U.powerShell=Ji;U.powerShellStart=fc;U.powerShellRelease=dc;U.execSafe=mc;U.nanoSeconds=xc;U.countUniqueLines=wc;U.countLines=Cc;U.noop=Rc;U.isRaspberry=yc;U.isRaspbian=_c;U.sanitizeShellString=Oc;U.isPrototypePolluted=Ic;U.decodePiCpuinfo=Qi;U.getRpiGpu=Pc;U.promiseAll=Tc;U.promisify=Vc;U.promisifySave=Nc;U.smartMonToolsInstalled=gc;U.linuxVersion=Dc;U.plistParser=Ac;U.plistReader=bc;U.stringReplace=On;U.stringToLower=In;U.stringToString=Yi;U.stringSubstr=Xi;U.stringTrim=Jl;U.stringStartWith=Ql;U.mathMin=Ki;U.WINDIR=Hi;U.getFilesInPath=Ec;U.semverCompare=Mc});var eo=le(rr=>{"use strict";var Mr=require("fs"),cs=require("os"),w=ce(),Vs=require("child_process").exec,Ts=require("child_process").execSync,br=w.promisify(require("child_process").exec),_t=process.platform,Rr=_t==="linux"||_t==="android",kr=_t==="darwin",Fr=_t==="win32",er=_t==="freebsd",tr=_t==="openbsd",sr=_t==="netbsd",Br=_t==="sunos";function kc(s){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((Rr||er||tr||sr)&&Vs("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",function(r,i){let n=i.toString().split(`
|
|
13
|
-
`);e.manufacturer=
|
|
2
|
+
"use strict";var Ua=Object.create;var Or=Object.defineProperty;var za=Object.getOwnPropertyDescriptor;var Ha=Object.getOwnPropertyNames;var ja=Object.getPrototypeOf,qa=Object.prototype.hasOwnProperty;var oe=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Ka=(n,t)=>{for(var e in t)Or(n,e,{get:t[e],enumerable:!0})},Si=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ha(t))!qa.call(n,i)&&i!==e&&Or(n,i,{get:()=>t[i],enumerable:!(r=za(t,i))||r.enumerable});return n};var Sn=(n,t,e)=>(e=n!=null?Ua(ja(n)):{},Si(t||!n||!n.__esModule?Or(e,"default",{value:n,enumerable:!0}):e,n)),$a=n=>Si(Or({},"__esModule",{value:!0}),n);var ki=oe((uf,rc)=>{rc.exports={name:"systeminformation",version:"5.25.11",description:"Advanced, lightweight system and OS information library",license:"MIT",author:"Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",homepage:"https://systeminformation.io",main:"./lib/index.js",type:"commonjs",bin:{systeminformation:"lib/cli.js"},types:"./lib/index.d.ts",scripts:{test:"node ./test/test.js",testDeno:"deno run -A ./test/test.js"},files:["lib/"],keywords:["system information","sysinfo","monitor","monitoring","os","linux","osx","windows","freebsd","openbsd","netbsd","cpu","cpuload","physical cores","logical cores","processor","cores","threads","socket type","memory","file system","fsstats","diskio","block devices","netstats","network","network interfaces","network connections","network stats","iface","printer","processes","users","internet","battery","docker","docker stats","docker processes","graphics","graphic card","graphic controller","gpu","display","smart","disk layout","usb","audio","bluetooth","wifi","wifinetworks","virtual box","virtualbox","vm","backend","hardware","BIOS","chassis"],repository:{type:"git",url:"https://github.com/sebhildebrandt/systeminformation.git"},funding:{type:"Buy me a coffee",url:"https://www.buymeacoffee.com/systeminfo"},os:["darwin","linux","win32","freebsd","openbsd","netbsd","sunos","android"],engines:{node:">=8.0.0"}}});var ue=oe(G=>{"use strict";var xt=require("os"),$e=require("fs"),sc=require("path"),Ts=require("child_process").spawn,ic=require("child_process").exec,Tn=require("child_process").execSync,oc=require("util"),pn=process.platform,Ms=pn==="linux"||pn==="android",Gi=pn==="darwin",Br=pn==="win32",Wi=pn==="freebsd",Ui=pn==="openbsd",zi=pn==="netbsd",Is=0,un="",qe="",yt=null,Ke=null,bs=process.env.WINDIR||"C:\\Windows",he,An="",er=[],Ds=!1,Vr="",Bi="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",Os="--###START###--",Ri="--ERROR--",kr="--###ENDCMD###--",Es="--##ID##--",tr={windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Object.assign({},process.env,{LANG:"en_US.UTF-8"})},Rr={maxBuffer:1024*2e4,encoding:"UTF-8",stdio:["pipe","pipe","ignore"]};function ac(n){let t=parseInt(n,10);return isNaN(t)&&(t=0),t}function lc(n){let t=!1,e="",r="";for(let i of n)i>="0"&&i<="9"||t?(t=!0,e+=i):r+=i;return[r,e]}var Nr=new String,Ps=new String().replace,As=new String().toLowerCase,Hi=new String().toString,ji=new String().substr,qi=new String().substring,Ki=new String().trim,$i=new String().startsWith,Yi=Math.min;function cc(n){return n&&{}.toString.call(n)==="[object Function]"}function uc(n){let t=[],e={};for(let r=0;r<n.length;r++){let i=Object.keys(n[r]);i.sort(function(o,a){return o-a});let s="";for(let o=0;o<i.length;o++)s+=JSON.stringify(i[o]),s+=JSON.stringify(n[r][i[o]]);({}).hasOwnProperty.call(e,s)||(t.push(n[r]),e[s]=!0)}return t}function pc(n,t){return n.sort(function(e,r){let i="",s="";return t.forEach(function(o){i=i+e[o],s=s+r[o]}),i<s?-1:i>s?1:0})}function dc(){return Is===0&&(Is=xt.cpus().length),Is}function St(n,t,e,r,i){e=e||":",t=t.toLowerCase(),r=r||!1,i=i||!1;let s="";return n.some(o=>{let a=o.toLowerCase().replace(/\t/g,"");if(r&&(a=a.trim()),a.startsWith(t)&&(!i||a.match(t+e)||a.match(t+" "+e))){let l=r?o.trim().split(e):o.split(e);if(l.length>=2)return l.shift(),s=l.join(e).trim(),!0}}),s}function fc(n,t){return t=t||16,n.replace(/\\x([0-9A-Fa-f]{2})/g,function(){return String.fromCharCode(parseInt(arguments[1],t))})}function mc(n){let t="",e=0;return n.split("").forEach(r=>{r>="0"&&r<="9"?e===1&&e++:(e===0&&e++,e===1&&(t+=r))}),t}function hc(n,t){t=t||"",n=n.toUpperCase();let e=0,r=0,i=mc(n),s=n.split(i);if(s.length>=2){s[2]&&(s[1]+=s[2]);let o=s[1]&&s[1].toLowerCase().indexOf("pm")>-1||s[1].toLowerCase().indexOf("p.m.")>-1||s[1].toLowerCase().indexOf("p. m.")>-1||s[1].toLowerCase().indexOf("n")>-1||s[1].toLowerCase().indexOf("ch")>-1||s[1].toLowerCase().indexOf("\xF6s")>-1||t&&s[1].toLowerCase().indexOf(t)>-1;return e=parseInt(s[0],10),r=parseInt(s[1],10),e=o&&e<12?e+12:e,("0"+e).substr(-2)+":"+("0"+r).substr(-2)}}function gc(n,t){let e={date:"",time:""};t=t||{};let r=(t.dateFormat||"").toLowerCase(),i=t.pmDesignator||"",s=n.split(" ");if(s[0]){if(s[0].indexOf("/")>=0){let o=s[0].split("/");o.length===3&&(o[0].length===4?e.date=o[0]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[2]).substr(-2):o[2].length===2?(r.indexOf("/d/")>-1||r.indexOf("/dd/")>-1,e.date="20"+o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2)):(n.toLowerCase().indexOf("pm")>-1||n.toLowerCase().indexOf("p.m.")>-1||n.toLowerCase().indexOf("p. m.")>-1||n.toLowerCase().indexOf("am")>-1||n.toLowerCase().indexOf("a.m.")>-1||n.toLowerCase().indexOf("a. m.")>-1||r.indexOf("/d/")>-1||r.indexOf("/dd/")>-1)&&r.indexOf("dd/")!==0?e.date=o[2]+"-"+("0"+o[0]).substr(-2)+"-"+("0"+o[1]).substr(-2):e.date=o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2))}if(s[0].indexOf(".")>=0){let o=s[0].split(".");o.length===3&&(r.indexOf(".d.")>-1||r.indexOf(".dd.")>-1?e.date=o[2]+"-"+("0"+o[0]).substr(-2)+"-"+("0"+o[1]).substr(-2):e.date=o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2))}if(s[0].indexOf("-")>=0){let o=s[0].split("-");o.length===3&&(e.date=o[0]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[2]).substr(-2))}}if(s[1]){s.shift();let o=s.join(" ");e.time=hc(o,i)}return e}function yc(n,t){let e=t>0,r=1,i=0,s=0,o=[];for(let l=0;l<n.length;l++)r<=t?(/\s/.test(n[l])&&!e&&(s=l-1,o.push({from:i,to:s+1,cap:n.substring(i,s+1)}),i=s+2,r++),e=n[l]===" "):(!/\s/.test(n[l])&&e&&(s=l-1,i<s&&o.push({from:i,to:s,cap:n.substring(i,s)}),i=s+1,r++),e=n[l]===" ");s=5e3,o.push({from:i,to:s,cap:n.substring(i,s)});let a=o.length;for(let l=0;l<a;l++)o[l].cap.replace(/\s/g,"").length===0&&l+1<a&&(o[l].to=o[l+1].to,o[l].cap=o[l].cap+o[l+1].cap,o.splice(l+1,1),a=a-1);return o}function xc(n,t,e){for(let r=0;r<n.length;r++)if(n[r][t]===e)return r;return-1}function Sc(){if(Vr="powershell.exe",Br){let n=`${bs}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`;$e.existsSync(n)&&(Vr=n)}}function Xi(){if(xt.type()==="Windows_NT"&&!un&&(un=bs+"\\system32\\wbem\\wmic.exe",!$e.existsSync(un)))try{let n=Tn("WHERE WMIC",tr).toString().split(`\r
|
|
3
|
+
`);n&&n.length?un=n[0]:un="wmic"}catch{un="wmic"}return un}function _c(n){return new Promise(t=>{process.nextTick(()=>{try{Zi(Xi()+" "+n).then(e=>{t(e,"")})}catch(e){t("",e)}})})}function Cc(){return Br?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"}function Ls(n){let t="",e,r="";if(n.indexOf(Os)>=0){e=n.split(Os);let s=e[1].split(Es);t=s[0],s.length>1&&(n=s.slice(1).join(Es))}n.indexOf(kr)>=0&&(e=n.split(kr),r=e[0]);let i=-1;for(let s=0;s<er.length;s++)er[s].id===t&&(i=s,er[s].callback(r));i>=0&&er.splice(i,1)}function vc(){he||(he=Ts(Vr,["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Object.assign({},process.env,{LANG:"en_US.UTF-8"})}),he&&he.pid&&(Ds=!0,he.stdout.on("data",function(n){An=An+n.toString("utf8"),n.indexOf(kr)>=0&&(Ls(An),An="")}),he.stderr.on("data",function(){Ls(An+Ri)}),he.on("error",function(){Ls(An+Ri)}),he.on("close",function(){he&&he.kill()})))}function wc(){try{he&&(he.stdin.write("exit"+xt.EOL),he.stdin.end(),Ds=!1)}catch{he&&he.kill()}he=null}function Zi(n){if(Ds){let t=Math.random().toString(36).substring(2,12);return new Promise(e=>{process.nextTick(()=>{function r(i){e(i)}er.push({id:t,cmd:n,callback:r,start:new Date});try{he&&he.pid&&he.stdin.write(Bi+"echo "+Os+t+Es+"; "+xt.EOL+n+xt.EOL+"echo "+kr+xt.EOL)}catch{e("")}})})}else{let t="";return new Promise(e=>{process.nextTick(()=>{try{let r=Ts(Vr,["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-ExecutionPolicy","Unrestricted","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:Object.assign({},process.env,{LANG:"en_US.UTF-8"})});if(r&&!r.pid&&r.on("error",function(){e(t)}),r&&r.pid){r.stdout.on("data",function(i){t=t+i.toString("utf8")}),r.stderr.on("data",function(){r.kill(),e(t)}),r.on("close",function(){r.kill(),e(t)}),r.on("error",function(){r.kill(),e(t)});try{r.stdin.write(Bi+n+xt.EOL),r.stdin.write("exit"+xt.EOL),r.stdin.end()}catch{r.kill(),e(t)}}else e(t)}catch{e(t)}})})}}function Ic(n,t,e){let r="";return e=e||{},new Promise(i=>{process.nextTick(()=>{try{let s=Ts(n,t,e);s&&!s.pid&&s.on("error",function(){i(r)}),s&&s.pid?(s.stdout.on("data",function(o){r+=o.toString()}),s.on("close",function(){s.kill(),i(r)}),s.on("error",function(){s.kill(),i(r)})):i(r)}catch{i(r)}})})}function Lc(){if(Br){if(!qe)try{let e=Tn("chcp",tr).toString().split(`\r
|
|
4
|
+
`)[0].split(":");qe=e.length>1?e[1].replace(".","").trim():""}catch{qe="437"}return qe}if(Ms||Gi||Wi||Ui||zi){if(!qe)try{let e=Tn("echo $LANG",Rr).toString().split(`\r
|
|
5
|
+
`)[0].split(".");qe=e.length>1?e[1].trim():"",qe||(qe="UTF-8")}catch{qe="UTF-8"}return qe}}function Oc(){if(yt!==null)return yt;if(yt=!1,Br)try{let n=Tn("WHERE smartctl 2>nul",tr).toString().split(`\r
|
|
6
|
+
`);n&&n.length?yt=n[0].indexOf(":\\")>=0:yt=!1}catch{yt=!1}if(Ms||Gi||Wi||Ui||zi)try{yt=Tn("which smartctl 2>/dev/null",Rr).toString().split(`\r
|
|
7
|
+
`).length>0}catch{oc.noop()}return yt}function Ec(n){let t=["BCM2708","BCM2709","BCM2710","BCM2711","BCM2712","BCM2835","BCM2836","BCM2837","BCM2837B0"];if(Ke!==null)n=Ke;else if(n===void 0)try{n=$e.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
|
|
8
|
+
`),Ke=n}catch{return!1}let e=St(n,"hardware"),r=St(n,"model");return e&&t.indexOf(e)>-1||r&&r.indexOf("Raspberry Pi")>-1}function Pc(){let n=[];try{n=$e.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split(`
|
|
9
|
+
`)}catch{return!1}let t=St(n,"id","=");return t&&t.indexOf("raspbian")>-1}function Ac(n,t,e){e||(e=t,t=tr);let r="chcp 65001 > nul && cmd /C "+n+" && chcp "+qe+" > nul";ic(r,t,function(i,s){e(i,s)})}function Tc(){let n=$e.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),t=$e.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),e=$e.existsSync("/Library/Developer/Xcode/");return n||e||t}function Mc(){let n=process.hrtime();return!Array.isArray(n)||n.length!==2?0:+n[0]*1e9+ +n[1]}function bc(n,t){t=t||"";let e=[];return n.forEach(r=>{r.startsWith(t)&&e.indexOf(r)===-1&&e.push(r)}),e.length}function Dc(n,t){t=t||"";let e=[];return n.forEach(r=>{r.startsWith(t)&&e.push(r)}),e.length}function Nc(n,t){typeof t>"u"&&(t=!1);let e=n||"",r="",i=Yi(e.length,2e3);for(let s=0;s<=i;s++)e[s]===void 0||e[s]===">"||e[s]==="<"||e[s]==="*"||e[s]==="?"||e[s]==="["||e[s]==="]"||e[s]==="|"||e[s]==="\u02DA"||e[s]==="$"||e[s]===";"||e[s]==="&"||e[s]==="]"||e[s]==="#"||e[s]==="\\"||e[s]===" "||e[s]===`
|
|
10
|
+
`||e[s]==="\r"||e[s]==="'"||e[s]==="`"||e[s]==='"'||e[s].length>1||t&&e[s]==="("||t&&e[s]===")"||t&&e[s]==="@"||t&&e[s]===" "||t&&e[s]=="{"||t&&e[s]==";"||t&&e[s]=="}"||(r=r+e[s]);return r}function Vc(){let n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",t=!0,e="";try{e.__proto__.replace=Ps,e.__proto__.toLowerCase=As,e.__proto__.toString=Hi,e.__proto__.substr=ji,e.__proto__.substring=qi,e.__proto__.trim=Ki,e.__proto__.startsWith=$i}catch{Object.setPrototypeOf(e,Nr)}t=t||n.length!==62;let r=Date.now();if(typeof r=="number"&&r>16e11){let i=r%100+15;for(let c=0;c<i;c++){let u=Math.random()*61.99999999+1,p=parseInt(Math.floor(u).toString(),10),d=parseInt(u.toString().split(".")[0],10),f=Math.random()*61.99999999+1,m=parseInt(Math.floor(f).toString(),10),g=parseInt(f.toString().split(".")[0],10);t=t&&u!==f,t=t&&p===d&&m===g,e+=n[p-1]}t=t&&e.length===i;let s=Math.random()*i*.9999999999,o=e.substr(0,s)+" "+e.substr(s,2e3);try{o.__proto__.replace=Ps}catch{Object.setPrototypeOf(o,Nr)}let a=o.replace(/ /g,"");t=t&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"{"+e.substr(s,2e3),a=o.replace(/{/g,""),t=t&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"*"+e.substr(s,2e3),a=o.replace(/\*/g,""),t=t&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"$"+e.substr(s,2e3),a=o.replace(/\$/g,""),t=t&&e===a;let l=e.toLowerCase();t=t&&l.length===i&&l[i-1]&&!l[i];for(let c=0;c<i;c++){let u=e[c];try{u.__proto__.toLowerCase=As}catch{Object.setPrototypeOf(e,Nr)}let p=l?l[c]:"",d=u.toLowerCase();t=t&&d[0]===p&&d[0]&&!d[1]}}return!t}function kc(n){return("00000000"+parseInt(n,16).toString(2)).substr(-8)}function Bc(n){let t=$e.lstatSync,e=$e.readdirSync,r=sc.join;function i(c){return t(c).isDirectory()}function s(c){return t(c).isFile()}function o(c){return e(c).map(function(u){return r(c,u)}).filter(i)}function a(c){return e(c).map(function(u){return r(c,u)}).filter(s)}function l(c){try{return o(c).map(function(d){return l(d)}).reduce(function(d,f){return d.concat(f)},[]).concat(a(c))}catch{return[]}}return $e.existsSync(n)?l(n):[]}function Ji(n){Ke===null?Ke=n:n===void 0&&(n=Ke);let t={"0002":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0003":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0004":{type:"B",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0005":{type:"B",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"0006":{type:"B",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0007":{type:"A",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0008":{type:"A",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0009":{type:"A",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"000d":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"000e":{type:"B",revision:"2.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"000f":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"0010":{type:"B+",revision:"1.2",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0011":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0012":{type:"A+",revision:"1.1",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0013":{type:"B+",revision:"1.2",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0014":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0015":{type:"A+",revision:"1.1",memory:256,manufacturer:"512MB Embest",processor:"BCM2835"}},e=["BCM2835","BCM2836","BCM2837","BCM2711","BCM2712"],r=["Sony UK","Egoman","Embest","Sony Japan","Embest","Stadium"],i={"00":"A","01":"B","02":"A+","03":"B+","04":"2B","05":"Alpha (early prototype)","06":"CM1","08":"3B","09":"Zero","0a":"CM3","0c":"Zero W","0d":"3B+","0e":"3A+","0f":"Internal use only",10:"CM3+",11:"4B",12:"Zero 2 W",13:"400",14:"CM4",15:"CM4S",16:"Internal use only",17:"5",18:"CM5",19:"500","1a":"CM5 Lite"},s=St(n,"revision",":",!0),o=St(n,"model:",":",!0),a=St(n,"serial",":",!0),l={};if({}.hasOwnProperty.call(t,s))l={model:o,serial:a,revisionCode:s,memory:t[s].memory,manufacturer:t[s].manufacturer,processor:t[s].processor,type:t[s].type,revision:t[s].revision};else{let c=("00000000"+St(n,"revision",":",!0).toLowerCase()).substr(-8),u=parseInt(kc(c.substr(2,1)).substr(5,3),2)||0,p=r[parseInt(c.substr(3,1),10)],d=e[parseInt(c.substr(4,1),10)],f=c.substr(5,2);l={model:o,serial:a,revisionCode:s,memory:256*Math.pow(2,u),manufacturer:p,processor:d,type:{}.hasOwnProperty.call(i,f)?i[f]:"",revision:"1."+c.substr(7,1)}}return l}function Rc(n){if(Ke===null&&n!==void 0)Ke=n;else if(n===void 0&&Ke!==null)n=Ke;else try{n=$e.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
|
|
11
|
+
`),Ke=n}catch{return!1}let t=Ji(n);return t.type==="4B"||t.type==="CM4"||t.type==="CM4S"||t.type==="400"?"VideoCore VI":t.type==="5"||t.type==="500"?"VideoCore VII":"VideoCore IV"}function Fc(n){let t=n.map(function(i){return new Promise(function(s){let o=new Array(2);i.then(function(a){o[0]=a}).catch(function(a){o[1]=a}).then(function(){s(o)})})}),e=[],r=[];return Promise.all(t).then(function(i){return i.forEach(function(s){s[1]?(e.push(s[1]),r.push(null)):(e.push(null),r.push(s[0]))}),{errors:e,results:r}})}function Gc(n){return function(){let t=Array.prototype.slice.call(arguments);return new Promise(function(e,r){t.push(function(i,s){i?r(i):e(s)}),n.apply(null,t)})}}function Wc(n){return function(){let t=Array.prototype.slice.call(arguments);return new Promise(function(e){t.push(function(r,i){e(i)}),n.apply(null,t)})}}function Uc(){let n="";if(Ms)try{n=Tn("uname -v",Rr).toString()}catch{n=""}return n}function zc(n){let t=["array","dict","key","string","integer","date","real","data","boolean","arrayEmpty"],r=n.indexOf("<plist version"),i=n.length;for(;n[r]!==">"&&r<i;)r++;let s=0,o=!1,a=!1,l=!1,c=[{tagStart:"",tagEnd:"",tagContent:"",key:"",data:null}],u="",p=n[r];for(;r<i;)u=p,r+1<i&&(p=n[r+1]),u==="<"?(a=!1,p==="/"?l=!0:c[s].tagStart?(c[s].tagContent="",c[s].data||(c[s].data=c[s].tagStart==="array"?[]:{}),s++,c.push({tagStart:"",tagEnd:"",tagContent:"",key:null,data:null}),o=!0,a=!1):o||(o=!0)):u===">"?(c[s].tagStart==="true/"&&(o=!1,l=!0,c[s].tagStart="",c[s].tagEnd="/boolean",c[s].data=!0),c[s].tagStart==="false/"&&(o=!1,l=!0,c[s].tagStart="",c[s].tagEnd="/boolean",c[s].data=!1),c[s].tagStart==="array/"&&(o=!1,l=!0,c[s].tagStart="",c[s].tagEnd="/arrayEmpty",c[s].data=[]),a&&(a=!1),o&&(o=!1,a=!0,c[s].tagStart==="array"&&(c[s].data=[]),c[s].tagStart==="dict"&&(c[s].data={})),l&&(l=!1,c[s].tagEnd&&t.indexOf(c[s].tagEnd.substr(1))>=0&&(c[s].tagEnd==="/dict"||c[s].tagEnd==="/array"?(s>1&&c[s-2].tagStart==="array"&&c[s-2].data.push(c[s-1].data),s>1&&c[s-2].tagStart==="dict"&&(c[s-2].data[c[s-1].key]=c[s-1].data),s--,c.pop(),c[s].tagContent="",c[s].tagStart="",c[s].tagEnd=""):(c[s].tagEnd==="/key"&&c[s].tagContent?c[s].key=c[s].tagContent:(c[s].tagEnd==="/real"&&c[s].tagContent&&(c[s].data=parseFloat(c[s].tagContent)||0),c[s].tagEnd==="/integer"&&c[s].tagContent&&(c[s].data=parseInt(c[s].tagContent)||0),c[s].tagEnd==="/string"&&c[s].tagContent&&(c[s].data=c[s].tagContent||""),c[s].tagEnd==="/boolean"&&(c[s].data=c[s].tagContent||!1),c[s].tagEnd==="/arrayEmpty"&&(c[s].data=c[s].tagContent||[]),s>0&&c[s-1].tagStart==="array"&&c[s-1].data.push(c[s].data),s>0&&c[s-1].tagStart==="dict"&&(c[s-1].data[c[s].key]=c[s].data)),c[s].tagContent="",c[s].tagStart="",c[s].tagEnd="")),c[s].tagEnd="",o=!1,a=!1)):(o&&(c[s].tagStart+=u),l&&(c[s].tagEnd+=u),a&&(c[s].tagContent+=u)),r++;return c[0].data}function Fi(n){return typeof n=="string"&&!isNaN(n)&&!isNaN(parseFloat(n))}function Hc(n){let t=n.split(`
|
|
12
|
+
`);for(let r=0;r<t.length;r++){if(t[r].indexOf(" = ")>=0){let i=t[r].split(" = ");if(i[0]=i[0].trim(),i[0].startsWith('"')||(i[0]='"'+i[0]+'"'),i[1]=i[1].trim(),i[1].indexOf('"')===-1&&i[1].endsWith(";")){let s=i[1].substring(0,i[1].length-1);Fi(s)||(i[1]=`"${s}";`)}if(i[1].indexOf('"')>=0&&i[1].endsWith(";")){let s=i[1].substring(0,i[1].length-1).replace(/"/g,"");Fi(s)&&(i[1]=`${s};`)}t[r]=i.join(" : ")}t[r]=t[r].replace(/\(/g,"[").replace(/\)/g,"]").replace(/;/g,",").trim(),t[r].startsWith("}")&&t[r-1]&&t[r-1].endsWith(",")&&(t[r-1]=t[r-1].substring(0,t[r-1].length-1))}n=t.join("");let e={};try{e=JSON.parse(n)}catch{}return e}function jc(n,t){let e=0,r=n.split("."),i=t.split(".");return r[0]<i[0]?e=1:r[0]>i[0]?e=-1:r[0]===i[0]&&r.length>=2&&i.length>=2&&(r[1]<i[1]?e=1:r[1]>i[1]?e=-1:r[1]===i[1]&&(r.length>=3&&i.length>=3?r[2]<i[2]?e=1:r[2]>i[2]&&(e=-1):i.length>=3&&(e=1))),e}function qc(n){let e=[{key:"Mac15,12",name:"MacBook Air",size:"13-inch",processor:"M3",year:"2024",additional:""},{key:"Mac14,15",name:"MacBook Air",size:"15-inch",processor:"M2",year:"2024",additional:""},{key:"Mac14,2",name:"MacBook Air",size:"13-inch",processor:"M2",year:"2022",additional:""},{key:"MacBookAir10,1",name:"MacBook Air",size:"13-inch",processor:"M1",year:"2020",additional:""},{key:"MacBookAir9,1",name:"MacBook Air",size:"13-inch",processor:"",year:"2020",additional:""},{key:"MacBookAir8,2",name:"MacBook Air",size:"13-inch",processor:"",year:"2019",additional:""},{key:"MacBookAir8,1",name:"MacBook Air",size:"13-inch",processor:"",year:"2018",additional:""},{key:"MacBookAir7,2",name:"MacBook Air",size:"13-inch",processor:"",year:"2017",additional:""},{key:"MacBookAir7,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Early 2015",additional:""},{key:"MacBookAir7,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Early 2015",additional:""},{key:"MacBookAir6,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Early 2014",additional:""},{key:"MacBookAir6,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Early 2014",additional:""},{key:"MacBookAir6,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Mid 2013",additional:""},{key:"MacBookAir6,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Mid 2013",additional:""},{key:"MacBookAir5,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Mid 2012",additional:""},{key:"MacBookAir5,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Mid 2012",additional:""},{key:"MacBookAir4,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Mid 2011",additional:""},{key:"MacBookAir4,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Mid 2011",additional:""},{key:"MacBookAir3,2",name:"MacBook Air",size:"13-inch",processor:"",year:"Late 2010",additional:""},{key:"MacBookAir3,1",name:"MacBook Air",size:"11-inch",processor:"",year:"Late 2010",additional:""},{key:"MacBookAir2,1",name:"MacBook Air",size:"13-inch",processor:"",year:"Mid 2009",additional:""},{key:"Mac16,1",name:"MacBook Pro",size:"14-inch",processor:"M4",year:"2024",additional:""},{key:"Mac16,6",name:"MacBook Pro",size:"14-inch",processor:"M4 Pro",year:"2024",additional:""},{key:"Mac16,8",name:"MacBook Pro",size:"14-inch",processor:"M4 Max",year:"2024",additional:""},{key:"Mac16,5",name:"MacBook Pro",size:"16-inch",processor:"M4 Pro",year:"2024",additional:""},{key:"Mac16,6",name:"MacBook Pro",size:"16-inch",processor:"M4 Max",year:"2024",additional:""},{key:"Mac15,3",name:"MacBook Pro",size:"14-inch",processor:"M3",year:"Nov 2023",additional:""},{key:"Mac15,6",name:"MacBook Pro",size:"14-inch",processor:"M3 Pro",year:"Nov 2023",additional:""},{key:"Mac15,8",name:"MacBook Pro",size:"14-inch",processor:"M3 Pro",year:"Nov 2023",additional:""},{key:"Mac15,10",name:"MacBook Pro",size:"14-inch",processor:"M3 Max",year:"Nov 2023",additional:""},{key:"Mac15,7",name:"MacBook Pro",size:"16-inch",processor:"M3 Pro",year:"Nov 2023",additional:""},{key:"Mac15,9",name:"MacBook Pro",size:"16-inch",processor:"M3 Pro",year:"Nov 2023",additional:""},{key:"Mac15,11",name:"MacBook Pro",size:"16-inch",processor:"M3 Max",year:"Nov 2023",additional:""},{key:"Mac14,5",name:"MacBook Pro",size:"14-inch",processor:"M2 Max",year:"2023",additional:""},{key:"Mac14,9",name:"MacBook Pro",size:"14-inch",processor:"M2 Max",year:"2023",additional:""},{key:"Mac14,6",name:"MacBook Pro",size:"16-inch",processor:"M2 Max",year:"2023",additional:""},{key:"Mac14,10",name:"MacBook Pro",size:"16-inch",processor:"M2 Max",year:"2023",additional:""},{key:"Mac14,7",name:"MacBook Pro",size:"13-inch",processor:"M2",year:"2022",additional:""},{key:"MacBookPro18,3",name:"MacBook Pro",size:"14-inch",processor:"M1 Pro",year:"2021",additional:""},{key:"MacBookPro18,4",name:"MacBook Pro",size:"14-inch",processor:"M1 Max",year:"2021",additional:""},{key:"MacBookPro18,1",name:"MacBook Pro",size:"16-inch",processor:"M1 Pro",year:"2021",additional:""},{key:"MacBookPro18,2",name:"MacBook Pro",size:"16-inch",processor:"M1 Max",year:"2021",additional:""},{key:"MacBookPro17,1",name:"MacBook Pro",size:"13-inch",processor:"M1",year:"2020",additional:""},{key:"MacBookPro16,3",name:"MacBook Pro",size:"13-inch",processor:"",year:"2020",additional:"Two Thunderbolt 3 ports"},{key:"MacBookPro16,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"2020",additional:"Four Thunderbolt 3 ports"},{key:"MacBookPro16,1",name:"MacBook Pro",size:"16-inch",processor:"",year:"2019",additional:""},{key:"MacBookPro16,4",name:"MacBook Pro",size:"16-inch",processor:"",year:"2019",additional:""},{key:"MacBookPro15,3",name:"MacBook Pro",size:"15-inch",processor:"",year:"2019",additional:""},{key:"MacBookPro15,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"2019",additional:""},{key:"MacBookPro15,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"2019",additional:""},{key:"MacBookPro15,4",name:"MacBook Pro",size:"13-inch",processor:"",year:"2019",additional:"Two Thunderbolt 3 ports"},{key:"MacBookPro15,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"2018",additional:""},{key:"MacBookPro15,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"2018",additional:"Four Thunderbolt 3 ports"},{key:"MacBookPro14,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"2017",additional:"Two Thunderbolt 3 ports"},{key:"MacBookPro14,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"2017",additional:"Four Thunderbolt 3 ports"},{key:"MacBookPro14,3",name:"MacBook Pro",size:"15-inch",processor:"",year:"2017",additional:""},{key:"MacBookPro13,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"2016",additional:"Two Thunderbolt 3 ports"},{key:"MacBookPro13,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"2016",additional:"Four Thunderbolt 3 ports"},{key:"MacBookPro13,3",name:"MacBook Pro",size:"15-inch",processor:"",year:"2016",additional:""},{key:"MacBookPro11,4",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2015",additional:""},{key:"MacBookPro11,5",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2015",additional:""},{key:"MacBookPro12,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"Early 2015",additional:""},{key:"MacBookPro11,2",name:"MacBook Pro",size:"15-inch",processor:"",year:"Late 2013",additional:""},{key:"MacBookPro11,3",name:"MacBook Pro",size:"15-inch",processor:"",year:"Late 2013",additional:""},{key:"MacBookPro11,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"Late 2013",additional:""},{key:"MacBookPro10,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2012",additional:""},{key:"MacBookPro10,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"Late 2012",additional:""},{key:"MacBookPro9,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2012",additional:""},{key:"MacBookPro9,2",name:"MacBook Pro",size:"13-inch",processor:"",year:"Mid 2012",additional:""},{key:"MacBookPro8,3",name:"MacBook Pro",size:"17-inch",processor:"",year:"Early 2011",additional:""},{key:"MacBookPro8,2",name:"MacBook Pro",size:"15-inch",processor:"",year:"Early 2011",additional:""},{key:"MacBookPro8,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"Early 2011",additional:""},{key:"MacBookPro6,1",name:"MacBook Pro",size:"17-inch",processor:"",year:"Mid 2010",additional:""},{key:"MacBookPro6,2",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2010",additional:""},{key:"MacBookPro7,1",name:"MacBook Pro",size:"13-inch",processor:"",year:"Mid 2010",additional:""},{key:"MacBookPro5,2",name:"MacBook Pro",size:"17-inch",processor:"",year:"Early 2009",additional:""},{key:"MacBookPro5,3",name:"MacBook Pro",size:"15-inch",processor:"",year:"Mid 2009",additional:""},{key:"MacBookPro5,5",name:"MacBook Pro",size:"13-inch",processor:"",year:"Mid 2009",additional:""},{key:"MacBookPro5,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"Late 2008",additional:""},{key:"MacBookPro4,1",name:"MacBook Pro",size:"15-inch",processor:"",year:"Early 2008",additional:""},{key:"MacBook10,1",name:"MacBook",size:"12-inch",processor:"",year:"2017",additional:""},{key:"MacBook9,1",name:"MacBook",size:"12-inch",processor:"",year:"Early 2016",additional:""},{key:"MacBook8,1",name:"MacBook",size:"12-inch",processor:"",year:"Early 2015",additional:""},{key:"MacBook7,1",name:"MacBook",size:"13-inch",processor:"",year:"Mid 2010",additional:""},{key:"MacBook6,1",name:"MacBook",size:"13-inch",processor:"",year:"Late 2009",additional:""},{key:"MacBook5,2",name:"MacBook",size:"13-inch",processor:"",year:"Early 2009",additional:""},{key:"Mac14,13",name:"Mac Studio",size:"",processor:"",year:"2023",additional:""},{key:"Mac14,14",name:"Mac Studio",size:"",processor:"",year:"2023",additional:""},{key:"Mac13,1",name:"Mac Studio",size:"",processor:"",year:"2022",additional:""},{key:"Mac13,2",name:"Mac Studio",size:"",processor:"",year:"2022",additional:""},{key:"Mac16,11",name:"Mac mini",size:"",processor:"M4 Pro",year:"2024",additional:""},{key:"Mac16,10",name:"Mac mini",size:"",processor:"M4",year:"2024",additional:""},{key:"Mac14,3",name:"Mac mini",size:"",processor:"M2",year:"2023",additional:""},{key:"Mac14,12",name:"Mac mini",size:"",processor:"M2 Pro",year:"2023",additional:""},{key:"Macmini9,1",name:"Mac mini",size:"",processor:"M1",year:"2020",additional:""},{key:"Macmini8,1",name:"Mac mini",size:"",processor:"",year:"Late 2018",additional:""},{key:"Macmini7,1",name:"Mac mini",size:"",processor:"",year:"Late 2014",additional:""},{key:"Macmini6,1",name:"Mac mini",size:"",processor:"",year:"Late 2012",additional:""},{key:"Macmini6,2",name:"Mac mini",size:"",processor:"",year:"Late 2012",additional:""},{key:"Macmini5,1",name:"Mac mini",size:"",processor:"",year:"Mid 2011",additional:""},{key:"Macmini5,2",name:"Mac mini",size:"",processor:"",year:"Mid 2011",additional:""},{key:"Macmini4,1",name:"Mac mini",size:"",processor:"",year:"Mid 2010",additional:""},{key:"Macmini3,1",name:"Mac mini",size:"",processor:"",year:"Early 2009",additional:""},{key:"Mac16,3",name:"iMac",size:"24-inch",processor:"M4",year:"2024",additional:"Four ports"},{key:"Mac16,2",name:"iMac",size:"24-inch",processor:"M4",year:"2024",additional:"Two ports"},{key:"Mac15,5",name:"iMac",size:"24-inch",processor:"M3",year:"2023",additional:"Four ports"},{key:"Mac15,4",name:"iMac",size:"24-inch",processor:"M3",year:"2023",additional:"Two ports"},{key:"iMac21,1",name:"iMac",size:"24-inch",processor:"M1",year:"2021",additional:""},{key:"iMac21,2",name:"iMac",size:"24-inch",processor:"M1",year:"2021",additional:""},{key:"iMac20,1",name:"iMac",size:"27-inch",processor:"",year:"2020",additional:"Retina 5K"},{key:"iMac20,2",name:"iMac",size:"27-inch",processor:"",year:"2020",additional:"Retina 5K"},{key:"iMac19,1",name:"iMac",size:"27-inch",processor:"",year:"2019",additional:"Retina 5K"},{key:"iMac19,2",name:"iMac",size:"21.5-inch",processor:"",year:"2019",additional:"Retina 4K"},{key:"iMacPro1,1",name:"iMac Pro",size:"",processor:"",year:"2017",additional:""},{key:"iMac18,3",name:"iMac",size:"27-inch",processor:"",year:"2017",additional:"Retina 5K"},{key:"iMac18,2",name:"iMac",size:"21.5-inch",processor:"",year:"2017",additional:"Retina 4K"},{key:"iMac18,1",name:"iMac",size:"21.5-inch",processor:"",year:"2017",additional:""},{key:"iMac17,1",name:"iMac",size:"27-inch",processor:"",year:"Late 2015",additional:"Retina 5K"},{key:"iMac16,2",name:"iMac",size:"21.5-inch",processor:"",year:"Late 2015",additional:"Retina 4K"},{key:"iMac16,1",name:"iMac",size:"21.5-inch",processor:"",year:"Late 2015",additional:""},{key:"iMac15,1",name:"iMac",size:"27-inch",processor:"",year:"Late 2014",additional:"Retina 5K"},{key:"iMac14,4",name:"iMac",size:"21.5-inch",processor:"",year:"Mid 2014",additional:""},{key:"iMac14,2",name:"iMac",size:"27-inch",processor:"",year:"Late 2013",additional:""},{key:"iMac14,1",name:"iMac",size:"21.5-inch",processor:"",year:"Late 2013",additional:""},{key:"iMac13,2",name:"iMac",size:"27-inch",processor:"",year:"Late 2012",additional:""},{key:"iMac13,1",name:"iMac",size:"21.5-inch",processor:"",year:"Late 2012",additional:""},{key:"iMac12,2",name:"iMac",size:"27-inch",processor:"",year:"Mid 2011",additional:""},{key:"iMac12,1",name:"iMac",size:"21.5-inch",processor:"",year:"Mid 2011",additional:""},{key:"iMac11,3",name:"iMac",size:"27-inch",processor:"",year:"Mid 2010",additional:""},{key:"iMac11,2",name:"iMac",size:"21.5-inch",processor:"",year:"Mid 2010",additional:""},{key:"iMac10,1",name:"iMac",size:"21.5-inch",processor:"",year:"Late 2009",additional:""},{key:"iMac9,1",name:"iMac",size:"20-inch",processor:"",year:"Early 2009",additional:""},{key:"Mac14,8",name:"Mac Pro",size:"",processor:"",year:"2023",additional:""},{key:"Mac14,8",name:"Mac Pro",size:"",processor:"",year:"2023",additional:"Rack"},{key:"MacPro7,1",name:"Mac Pro",size:"",processor:"",year:"2019",additional:""},{key:"MacPro7,1",name:"Mac Pro",size:"",processor:"",year:"2019",additional:"Rack"},{key:"MacPro6,1",name:"Mac Pro",size:"",processor:"",year:"Late 2013",additional:""},{key:"MacPro5,1",name:"Mac Pro",size:"",processor:"",year:"Mid 2012",additional:""},{key:"MacPro5,1",name:"Mac Pro Server",size:"",processor:"",year:"Mid 2012",additional:"Server"},{key:"MacPro5,1",name:"Mac Pro",size:"",processor:"",year:"Mid 2010",additional:""},{key:"MacPro5,1",name:"Mac Pro Server",size:"",processor:"",year:"Mid 2010",additional:"Server"},{key:"MacPro4,1",name:"Mac Pro",size:"",processor:"",year:"Early 2009",additional:""}].filter(i=>i.key===n);if(e.length===0)return{key:n,model:"Apple",version:"Unknown"};let r=[];return e[0].size&&r.push(e[0].size),e[0].processor&&r.push(e[0].processor),e[0].year&&r.push(e[0].year),e[0].additional&&r.push(e[0].additional),{key:n,model:e[0].name,version:e[0].name+" ("+r.join(", ")+")"}}function Kc(n,t=5e3){let e=n.startsWith("https:")||n.indexOf(":443/")>0||n.indexOf(":8443/")>0?require("https"):require("http"),r=Date.now();return new Promise(i=>{let s=e.get(n,function(o){o.on("data",()=>{}),o.on("end",()=>{i({url:n,statusCode:o.statusCode,message:o.statusMessage,time:Date.now()-r})})}).on("error",function(o){i({url:n,statusCode:404,message:o.message,time:Date.now()-r})}).setTimeout(t,()=>{s.close(),i({url:n,statusCode:408,message:"Request Timeout",time:Date.now()-r})})})}function $c(n){return n.replace(/To Be Filled By O.E.M./g,"")}function Yc(){}G.toInt=ac;G.splitByNumber=lc;G.execOptsWin=tr;G.execOptsLinux=Rr;G.getCodepage=Lc;G.execWin=Ac;G.isFunction=cc;G.unique=uc;G.sortByKey=pc;G.cores=dc;G.getValue=St;G.decodeEscapeSequence=fc;G.parseDateTime=gc;G.parseHead=yc;G.findObjectByKey=xc;G.getWmic=Xi;G.wmic=_c;G.darwinXcodeExists=Tc;G.getVboxmanage=Cc;G.powerShell=Zi;G.powerShellStart=vc;G.powerShellRelease=wc;G.execSafe=Ic;G.nanoSeconds=Mc;G.countUniqueLines=bc;G.countLines=Dc;G.noop=Yc;G.isRaspberry=Ec;G.isRaspbian=Pc;G.sanitizeShellString=Nc;G.isPrototypePolluted=Vc;G.decodePiCpuinfo=Ji;G.getRpiGpu=Rc;G.promiseAll=Fc;G.promisify=Gc;G.promisifySave=Wc;G.smartMonToolsInstalled=Oc;G.linuxVersion=Uc;G.plistParser=zc;G.plistReader=Hc;G.stringObj=Nr;G.stringReplace=Ps;G.stringToLower=As;G.stringToString=Hi;G.stringSubstr=ji;G.stringSubstring=qi;G.stringTrim=Ki;G.stringStartWith=$i;G.mathMin=Yi;G.WINDIR=bs;G.getFilesInPath=Bc;G.semverCompare=jc;G.getAppleModel=qc;G.checkWebsite=Kc;G.cleanString=$c;G.getPowershell=Sc});var eo=oe(ir=>{"use strict";var Ns=require("fs"),dn=require("os"),v=ue(),bn=require("child_process").exec,Mn=require("child_process").execSync,Fr=v.promisify(require("child_process").exec),_t=process.platform,Gr=_t==="linux"||_t==="android",Wr=_t==="darwin",Ur=_t==="win32",nr=_t==="freebsd",rr=_t==="openbsd",sr=_t==="netbsd",zr=_t==="sunos";function Xc(n){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((Gr||nr||rr||sr)&&bn("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",function(r,i){let s=i.toString().split(`
|
|
13
|
+
`);e.manufacturer=Y(v.getValue(s,"manufacturer")),e.model=Y(v.getValue(s,"product name")),e.version=Y(v.getValue(s,"version")),e.serial=Y(v.getValue(s,"serial number")),e.uuid=Y(v.getValue(s,"uuid")).toLowerCase(),e.sku=Y(v.getValue(s,"sku number"));let o=`echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;
|
|
14
14
|
echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;
|
|
15
15
|
echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;
|
|
16
16
|
echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;
|
|
17
|
-
echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;try{
|
|
18
|
-
`),e.manufacturer=e.manufacturer===""?
|
|
19
|
-
`);switch(
|
|
20
|
-
`).length>0&&(e.model==="Computer"&&(e.model="Virtual machine"),e.virtual=!0,a.toString().toLowerCase().indexOf("vmware")>=0&&!e.virtualHost&&(e.virtualHost="VMware"),a.toString().toLowerCase().indexOf("qemu")>=0&&!e.virtualHost&&(e.virtualHost="QEMU"),a.toString().toLowerCase().indexOf("xen")>=0&&!e.virtualHost&&(e.virtualHost="Xen"),a.toString().toLowerCase().indexOf("kvm")>=0&&!e.virtualHost&&(e.virtualHost="KVM"))}catch{
|
|
21
|
-
`);e.model=
|
|
22
|
-
`),o=
|
|
23
|
-
`);e.manufacturer=
|
|
24
|
-
`);e.sku=
|
|
25
|
-
`);e.vendor=
|
|
17
|
+
echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;try{s=Mn(o,v.execOptsLinux).toString().split(`
|
|
18
|
+
`),e.manufacturer=Y(e.manufacturer===""?v.getValue(s,"sys_vendor"):e.manufacturer),e.model=Y(e.model===""?v.getValue(s,"product_name"):e.model),e.version=Y(e.version===""?v.getValue(s,"product_version"):e.version),e.serial=Y(e.serial===""?v.getValue(s,"product_serial"):e.serial),e.uuid=Y(e.uuid===""?v.getValue(s,"product_uuid").toLowerCase():e.uuid)}catch{v.noop()}if(e.serial||(e.serial="-"),e.manufacturer||(e.manufacturer=""),e.model||(e.model="Computer"),e.version||(e.version=""),e.sku||(e.sku="-"),e.model.toLowerCase()==="virtualbox"||e.model.toLowerCase()==="kvm"||e.model.toLowerCase()==="virtual machine"||e.model.toLowerCase()==="bochs"||e.model.toLowerCase().startsWith("vmware")||e.model.toLowerCase().startsWith("droplet"))switch(e.virtual=!0,e.model.toLowerCase()){case"virtualbox":e.virtualHost="VirtualBox";break;case"vmware":e.virtualHost="VMware";break;case"kvm":e.virtualHost="KVM";break;case"bochs":e.virtualHost="bochs";break}if(e.manufacturer.toLowerCase().startsWith("vmware")||e.manufacturer.toLowerCase()==="xen")switch(e.virtual=!0,e.manufacturer.toLowerCase()){case"vmware":e.virtualHost="VMware";break;case"xen":e.virtualHost="Xen";break}if(!e.virtual)try{let a=Mn("ls -1 /dev/disk/by-id/ 2>/dev/null",v.execOptsLinux).toString();a.indexOf("_QEMU_")>=0&&(e.virtual=!0,e.virtualHost="QEMU"),a.indexOf("_VBOX_")>=0&&(e.virtual=!0,e.virtualHost="VirtualBox")}catch{v.noop()}if(!e.virtual&&(dn.release().toLowerCase().indexOf("microsoft")>=0||dn.release().toLowerCase().endsWith("wsl2"))){let a=parseFloat(dn.release().toLowerCase());e.virtual=!0,e.manufacturer="Microsoft",e.model="WSL",e.version=a<4.19?"1":"2"}if((nr||rr||sr)&&!e.virtualHost)try{let l=Mn("dmidecode -t 4",v.execOptsLinux).toString().split(`
|
|
19
|
+
`);switch(v.getValue(l,"manufacturer",":",!0).toLowerCase()){case"virtualbox":e.virtualHost="VirtualBox";break;case"vmware":e.virtualHost="VMware";break;case"kvm":e.virtualHost="KVM";break;case"bochs":e.virtualHost="bochs";break}}catch{v.noop()}(Ns.existsSync("/.dockerenv")||Ns.existsSync("/.dockerinit"))&&(e.model="Docker Container");try{let a=Mn('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');a.toString().split(`
|
|
20
|
+
`).length>0&&(e.model==="Computer"&&(e.model="Virtual machine"),e.virtual=!0,a.toString().toLowerCase().indexOf("vmware")>=0&&!e.virtualHost&&(e.virtualHost="VMware"),a.toString().toLowerCase().indexOf("qemu")>=0&&!e.virtualHost&&(e.virtualHost="QEMU"),a.toString().toLowerCase().indexOf("xen")>=0&&!e.virtualHost&&(e.virtualHost="Xen"),a.toString().toLowerCase().indexOf("kvm")>=0&&!e.virtualHost&&(e.virtualHost="KVM"))}catch{v.noop()}e.manufacturer===""&&e.model==="Computer"&&e.version===""?Ns.readFile("/proc/cpuinfo",function(a,l){if(!a){let c=l.toString().split(`
|
|
21
|
+
`);e.model=v.getValue(c,"hardware",":",!0).toUpperCase(),e.version=v.getValue(c,"revision",":",!0).toLowerCase(),e.serial=v.getValue(c,"serial",":",!0);let u=v.getValue(c,"model:",":",!0);if(v.isRaspberry(c)){let p=v.decodePiCpuinfo(c);e.model=p.model,e.version=p.revisionCode,e.manufacturer="Raspberry Pi Foundation",e.raspberry={manufacturer:p.manufacturer,processor:p.processor,type:p.type,revision:p.revision}}}n&&n(e),t(e)}):(n&&n(e),t(e))}),Wr&&bn("ioreg -c IOPlatformExpertDevice -d 2",function(r,i){if(!r){let s=i.toString().replace(/[<>"]/g,"").split(`
|
|
22
|
+
`),o=v.getAppleModel(v.getValue(s,"model","=",!0));e.manufacturer=v.getValue(s,"manufacturer","=",!0),e.model=o.key,e.type=Qi(o.version),e.version=o.version,e.serial=v.getValue(s,"ioplatformserialnumber","=",!0),e.uuid=v.getValue(s,"ioplatformuuid","=",!0).toLowerCase(),e.sku=v.getValue(s,"board-id","=",!0)||v.getValue(s,"target-sub-type","=",!0)}n&&n(e),t(e)}),zr&&(n&&n(e),t(e)),Ur)try{v.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then((r,i)=>{if(i)n&&n(e),t(e);else{let s=r.split(`\r
|
|
23
|
+
`);e.manufacturer=v.getValue(s,"vendor",":"),e.model=v.getValue(s,"name",":"),e.version=v.getValue(s,"version",":"),e.serial=v.getValue(s,"identifyingnumber",":"),e.uuid=v.getValue(s,"uuid",":").toLowerCase();let o=e.model.toLowerCase();(o==="virtualbox"||o==="kvm"||o==="virtual machine"||o==="bochs"||o.startsWith("vmware")||o.startsWith("qemu")||o.startsWith("parallels"))&&(e.virtual=!0,o.startsWith("virtualbox")&&(e.virtualHost="VirtualBox"),o.startsWith("vmware")&&(e.virtualHost="VMware"),o.startsWith("kvm")&&(e.virtualHost="KVM"),o.startsWith("bochs")&&(e.virtualHost="bochs"),o.startsWith("qemu")&&(e.virtualHost="KVM"),o.startsWith("parallels")&&(e.virtualHost="Parallels"));let a=e.manufacturer.toLowerCase();(a.startsWith("vmware")||a.startsWith("qemu")||a==="xen"||a.startsWith("parallels"))&&(e.virtual=!0,a.startsWith("vmware")&&(e.virtualHost="VMware"),a.startsWith("xen")&&(e.virtualHost="Xen"),a.startsWith("qemu")&&(e.virtualHost="KVM"),a.startsWith("parallels")&&(e.virtualHost="Parallels")),v.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((l,c)=>{if(!c){let u=l.split(`\r
|
|
24
|
+
`);e.sku=v.getValue(u,"systemsku",":")}e.virtual?(n&&n(e),t(e)):v.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then((u,p)=>{if(p)n&&n(e),t(e);else{let d=u.toString();(d.indexOf("VRTUAL")>=0||d.indexOf("A M I ")>=0||d.indexOf("VirtualBox")>=0||d.indexOf("VMWare")>=0||d.indexOf("Xen")>=0||d.indexOf("Parallels")>=0)&&(e.virtual=!0,d.indexOf("VirtualBox")>=0&&!e.virtualHost&&(e.virtualHost="VirtualBox"),d.indexOf("VMware")>=0&&!e.virtualHost&&(e.virtualHost="VMware"),d.indexOf("Xen")>=0&&!e.virtualHost&&(e.virtualHost="Xen"),d.indexOf("VRTUAL")>=0&&!e.virtualHost&&(e.virtualHost="Hyper-V"),d.indexOf("A M I")>=0&&!e.virtualHost&&(e.virtualHost="Virtual PC"),d.indexOf("Parallels")>=0&&!e.virtualHost&&(e.virtualHost="Parallels")),n&&n(e),t(e)}})})}})}catch{n&&n(e),t(e)}})})}ir.system=Xc;function Y(n){let t=n.toLowerCase();return t.indexOf("o.e.m.")===-1&&t.indexOf("default string")===-1&&t!=="default"&&n||""}function Zc(n){return new Promise(t=>{process.nextTick(()=>{let e={vendor:"",version:"",releaseDate:"",revision:""},r="";if((Gr||nr||rr||sr)&&(process.arch==="arm"?r="cat /proc/cpuinfo | grep Serial":r="export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL",bn(r,function(i,s){let o=s.toString().split(`
|
|
25
|
+
`);e.vendor=v.getValue(o,"Vendor"),e.version=v.getValue(o,"Version");let a=v.getValue(o,"Release Date");e.releaseDate=v.parseDateTime(a).date,e.revision=v.getValue(o,"BIOS Revision"),e.serial=v.getValue(o,"SerialNumber");let l=v.getValue(o,"Currently Installed Language").split("|")[0];if(l&&(e.language=l),o.length&&s.toString().indexOf("Characteristics:")>=0){let u=[];o.forEach(p=>{if(p.indexOf(" is supported")>=0){let d=p.split(" is supported")[0].trim();u.push(d)}}),e.features=u}let c=`echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;
|
|
26
26
|
echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
|
|
27
|
-
echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;try{o=
|
|
28
|
-
`),e.vendor=e.vendor?e.vendor:
|
|
29
|
-
`),a=
|
|
30
|
-
`):[""];e.manufacturer=
|
|
27
|
+
echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;try{o=Mn(c,v.execOptsLinux).toString().split(`
|
|
28
|
+
`),e.vendor=e.vendor?e.vendor:v.getValue(o,"bios_vendor"),e.version=e.version?e.version:v.getValue(o,"bios_version"),a=v.getValue(o,"bios_date"),e.releaseDate=e.releaseDate?e.releaseDate:v.parseDateTime(a).date}catch{v.noop()}n&&n(e),t(e)})),Wr&&(e.vendor="Apple Inc.",bn("system_profiler SPHardwareDataType -json",function(i,s){try{let o=JSON.parse(s.toString());if(o&&o.SPHardwareDataType&&o.SPHardwareDataType.length){let a=o.SPHardwareDataType[0].boot_rom_version;a=a?a.split("(")[0].trim():null,e.version=a}}catch{v.noop()}n&&n(e),t(e)})),zr&&(e.vendor="Sun Microsystems",n&&n(e),t(e)),Ur)try{v.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then((i,s)=>{if(!s){let o=i.toString().split(`\r
|
|
29
|
+
`),a=v.getValue(o,"description",":"),l=v.getValue(o,"SMBIOSBIOSVersion",":");a.indexOf(" Version ")!==-1?(e.vendor=a.split(" Version ")[0].trim(),e.version=a.split(" Version ")[1].trim()):a.indexOf(" Ver: ")!==-1?(e.vendor=v.getValue(o,"manufacturer",":"),e.version=a.split(" Ver: ")[1].trim()):(e.vendor=v.getValue(o,"manufacturer",":"),e.version=l||v.getValue(o,"version",":")),e.releaseDate=v.getValue(o,"releasedate",":"),e.revision=v.getValue(o,"buildnumber",":"),e.serial=Y(v.getValue(o,"serialnumber",":"))}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}ir.bios=Zc;function Jc(n){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},r="";if(Gr||nr||rr||sr){process.arch==="arm"?r="cat /proc/cpuinfo | grep Serial":r="export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";let i=[];i.push(Fr(r)),i.push(Fr("export LC_ALL=C; dmidecode -t memory 2>/dev/null")),v.promiseAll(i).then(s=>{let o=s.results[0]?s.results[0].toString().split(`
|
|
30
|
+
`):[""];e.manufacturer=Y(v.getValue(o,"Manufacturer")),e.model=Y(v.getValue(o,"Product Name")),e.version=Y(v.getValue(o,"Version")),e.serial=Y(v.getValue(o,"Serial Number")),e.assetTag=Y(v.getValue(o,"Asset Tag"));let a=`echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;
|
|
31
31
|
echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;
|
|
32
32
|
echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;
|
|
33
33
|
echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
|
|
34
|
-
echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;try{o=
|
|
35
|
-
`),e.manufacturer=
|
|
36
|
-
`):[""],e.memMax=
|
|
37
|
-
`)
|
|
38
|
-
`):[""];e.manufacturer=
|
|
39
|
-
`):[""]
|
|
40
|
-
`):[""],e.memMax=w.toInt(w.getValue(l,o,":"))*(n?1024:1)||null,e.memSlots=w.toInt(w.getValue(l,"MemoryDevices",":"))||null,s&&s(e),t(e)})}catch{s&&s(e),t(e)}})})}rr.baseboard=Bc;function Wc(s){return s=s.toLowerCase(),s.startsWith("macbookair")?"Notebook":s.startsWith("macbookpro")?"Laptop":s.startsWith("macbook")?"Notebook":s.startsWith("macmini")||s.startsWith("imac")||s.startsWith("macstudio")?"Desktop":s.startsWith("macpro")?"Tower":"Other"}function Uc(s){let t=["Other","Unknown","Desktop","Low Profile Desktop","Pizza Box","Mini Tower","Tower","Portable","Laptop","Notebook","Hand Held","Docking Station","All in One","Sub Notebook","Space-Saving","Lunch Box","Main System Chassis","Expansion Chassis","SubChassis","Bus Expansion Chassis","Peripheral Chassis","Storage Chassis","Rack Mount Chassis","Sealed-Case PC","Multi-System Chassis","Compact PCI","Advanced TCA","Blade","Blade Enclosure","Tablet","Convertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise(e=>{process.nextTick(()=>{let r={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if((Rr||er||tr||sr)&&Vs(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
|
|
34
|
+
echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;try{o=Mn(a,v.execOptsLinux).toString().split(`
|
|
35
|
+
`),e.manufacturer=Y(e.manufacturer?e.manufacturer:v.getValue(o,"board_vendor")),e.model=Y(e.model?e.model:v.getValue(o,"board_name")),e.version=Y(e.version?e.version:v.getValue(o,"board_version")),e.serial=Y(e.serial?e.serial:v.getValue(o,"board_serial")),e.assetTag=Y(e.assetTag?e.assetTag:v.getValue(o,"board_asset_tag"))}catch{v.noop()}if(o=s.results[1]?s.results[1].toString().split(`
|
|
36
|
+
`):[""],e.memMax=v.toInt(v.getValue(o,"Maximum Capacity"))*1024*1024*1024||null,e.memSlots=v.toInt(v.getValue(o,"Number Of Devices"))||null,v.isRaspberry()){let l=v.decodePiCpuinfo();e.manufacturer=l.manufacturer,e.model="Raspberry Pi",e.serial=l.serial,e.version=l.type+" - "+l.revision,e.memMax=dn.totalmem(),e.memSlots=0}n&&n(e),t(e)})}if(Wr){let i=[];i.push(Fr("ioreg -c IOPlatformExpertDevice -d 2")),i.push(Fr("system_profiler SPMemoryDataType")),v.promiseAll(i).then(s=>{let o=s.results[0]?s.results[0].toString().replace(/[<>"]/g,"").split(`
|
|
37
|
+
`):[""];e.manufacturer=v.getValue(o,"manufacturer","=",!0),e.model=v.getValue(o,"model","=",!0),e.version=v.getValue(o,"version","=",!0),e.serial=v.getValue(o,"ioplatformserialnumber","=",!0),e.assetTag=v.getValue(o,"board-id","=",!0);let a=s.results[1]?s.results[1].toString().split(" BANK "):[""];a.length===1&&(a=s.results[1]?s.results[1].toString().split(" DIMM"):[""]),a.shift(),e.memSlots=a.length,dn.arch()==="arm64"&&(e.memSlots=0,e.memMax=dn.totalmem()),n&&n(e),t(e)})}if(zr&&(n&&n(e),t(e)),Ur)try{let i=[],s=parseInt(dn.release())>=10,o=s?"MaxCapacityEx":"MaxCapacity";i.push(v.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")),i.push(v.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${o}, MemoryDevices | fl`)),v.promiseAll(i).then(a=>{let l=a.results[0]?a.results[0].toString().split(`\r
|
|
38
|
+
`):[""];e.manufacturer=Y(v.getValue(l,"manufacturer",":")),e.model=Y(v.getValue(l,"model",":")),e.model||(e.model=Y(v.getValue(l,"product",":"))),e.version=Y(v.getValue(l,"version",":")),e.serial=Y(v.getValue(l,"serialnumber",":")),e.assetTag=Y(v.getValue(l,"partnumber",":")),e.assetTag||(e.assetTag=Y(v.getValue(l,"sku",":"))),l=a.results[1]?a.results[1].toString().split(`\r
|
|
39
|
+
`):[""],e.memMax=v.toInt(v.getValue(l,o,":"))*(s?1024:1)||null,e.memSlots=v.toInt(v.getValue(l,"MemoryDevices",":"))||null,n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}ir.baseboard=Jc;function Qi(n){return n=n.toLowerCase(),n.indexOf("macbookair")>=0||n.indexOf("macbook air")>=0||n.indexOf("macbookpro")>=0||n.indexOf("macbook pro")>=0||n.indexOf("macbook")>=0?"Notebook":n.indexOf("macmini")>=0||n.indexOf("mac mini")>=0||n.indexOf("imac")>=0||n.indexOf("macstudio")>=0||n.indexOf("mac studio")>=0?"Desktop":n.indexOf("macpro")>=0||n.indexOf("mac pro")>=0?"Tower":"Other"}function Qc(n){let t=["Other","Unknown","Desktop","Low Profile Desktop","Pizza Box","Mini Tower","Tower","Portable","Laptop","Notebook","Hand Held","Docking Station","All in One","Sub Notebook","Space-Saving","Lunch Box","Main System Chassis","Expansion Chassis","SubChassis","Bus Expansion Chassis","Peripheral Chassis","Storage Chassis","Rack Mount Chassis","Sealed-Case PC","Multi-System Chassis","Compact PCI","Advanced TCA","Blade","Blade Enclosure","Tablet","Convertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise(e=>{process.nextTick(()=>{let r={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if((Gr||nr||rr||sr)&&bn(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
|
|
41
40
|
echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
|
|
42
41
|
echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
|
|
43
42
|
echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
|
|
44
|
-
echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`,function(
|
|
45
|
-
`);r.manufacturer=
|
|
46
|
-
`),a=
|
|
47
|
-
`);r.manufacturer=
|
|
48
|
-
`).forEach(function(u){u.indexOf("=")!==-1&&(
|
|
49
|
-
`),o=F.getValue(
|
|
50
|
-
`);e.serial=F.getValue(
|
|
51
|
-
`);e.distro=
|
|
52
|
-
`):[""];e.distro=F.getValue(
|
|
53
|
-
`);return
|
|
54
|
-
\r`)[0];return
|
|
55
|
-
`)[0].trim().split(" ");
|
|
56
|
-
`)[0]),a()}),{}.hasOwnProperty.call(
|
|
57
|
-
`)[0].trim();p.startsWith("[PM2]")||(
|
|
58
|
-
`)[0]),a()}),{}.hasOwnProperty.call(
|
|
59
|
-
`)[0]||"";
|
|
60
|
-
`)[0]||"";
|
|
61
|
-
`)[0]||"";
|
|
62
|
-
`)[0]||"";
|
|
63
|
-
`)[0]||"";
|
|
64
|
-
`)[0]||"").split("
|
|
65
|
-
`)[0]||"";
|
|
66
|
-
`)[0]||"";
|
|
67
|
-
`)[0]||"").split("(");
|
|
68
|
-
`)[0]||"").split("
|
|
69
|
-
`)[0]||"").split(" ");
|
|
70
|
-
`)
|
|
71
|
-
`)[
|
|
72
|
-
`)[0].split("
|
|
73
|
-
`).
|
|
74
|
-
`)
|
|
75
|
-
`)
|
|
76
|
-
`)
|
|
77
|
-
`)
|
|
78
|
-
`)
|
|
79
|
-
`)[0]
|
|
80
|
-
`)
|
|
81
|
-
`)[0]||"";
|
|
82
|
-
`)[0]||"";
|
|
83
|
-
`)[0]||""
|
|
84
|
-
`)[0]||""
|
|
85
|
-
`)[0]||"").split(" ");
|
|
86
|
-
`)[0]||"").split(" ");
|
|
87
|
-
`)[0]||"").split(
|
|
88
|
-
`)[0]||"").split(
|
|
89
|
-
`)[0]
|
|
90
|
-
`)[0]
|
|
91
|
-
`)[0]
|
|
92
|
-
`)[0].
|
|
93
|
-
`)[0].split("
|
|
94
|
-
`)[0].split(" version ");
|
|
95
|
-
`).
|
|
96
|
-
`)
|
|
97
|
-
`)[0]
|
|
43
|
+
echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`,function(s,o){let a=o.toString().split(`
|
|
44
|
+
`);r.manufacturer=Y(v.getValue(a,"chassis_vendor"));let l=parseInt(v.getValue(a,"chassis_type").replace(/\D/g,""));r.type=Y(l&&!isNaN(l)&&l<t.length?t[l-1]:""),r.version=Y(v.getValue(a,"chassis_version")),r.serial=Y(v.getValue(a,"chassis_serial")),r.assetTag=Y(v.getValue(a,"chassis_asset_tag")),n&&n(r),e(r)}),Wr&&bn("ioreg -c IOPlatformExpertDevice -d 2",function(i,s){if(!i){let o=s.toString().replace(/[<>"]/g,"").split(`
|
|
45
|
+
`),a=v.getAppleModel(v.getValue(o,"model","=",!0));r.manufacturer=v.getValue(o,"manufacturer","=",!0),r.model=a.key,r.type=Qi(a.model),r.version=a.version,r.serial=v.getValue(o,"ioplatformserialnumber","=",!0),r.assetTag=v.getValue(o,"board-id","=",!0)||v.getValue(o,"target-type","=",!0),r.sku=v.getValue(o,"target-sub-type","=",!0)}n&&n(r),e(r)}),zr&&(n&&n(r),e(r)),Ur)try{v.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then((i,s)=>{if(!s){let o=i.toString().split(`\r
|
|
46
|
+
`);r.manufacturer=Y(v.getValue(o,"manufacturer",":")),r.model=Y(v.getValue(o,"model",":"));let a=parseInt(v.getValue(o,"ChassisTypes",":").replace(/\D/g,""));r.type=a&&!isNaN(a)&&a<t.length?t[a-1]:"",r.version=Y(v.getValue(o,"version",":")),r.serial=Y(v.getValue(o,"serialnumber",":")),r.assetTag=Y(v.getValue(o,"partnumber",":")),r.assetTag||(r.assetTag=Y(v.getValue(o,"SMBIOSAssetTag",":"))),r.sku=Y(v.getValue(o,"sku",":"))}n&&n(r),e(r)})}catch{n&&n(r),e(r)}})})}ir.chassis=Qc});var no=oe(Nn=>{"use strict";var Re=require("os"),Ve=require("fs"),F=ue(),W=require("child_process").exec,ar=require("child_process").execSync,Ye=process.platform,Dn=Ye==="linux"||Ye==="android",ke=Ye==="darwin",Be=Ye==="win32",Vs=Ye==="freebsd",ks=Ye==="openbsd",Bs=Ye==="netbsd",eu=Ye==="sunos";function tu(){let n=new Date().toString().split(" "),t={current:Date.now(),uptime:Re.uptime(),timezone:n.length>=7?n[5]:"",timezoneName:Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:n.length>=7?n.slice(6).join(" ").replace(/\(/g,"").replace(/\)/g,""):""};if(ke||Dn)try{let r=ar("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null",F.execOptsLinux).toString().split(Re.EOL);r.length>3&&!r[0]&&r.shift();let i=r[0]||"";return(i.startsWith("+")||i.startsWith("-"))&&(i="GMT"),{current:Date.now(),uptime:Re.uptime(),timezone:r[1]?i+r[1]:i,timezoneName:r[2]&&r[2].indexOf("/zoneinfo/")>0&&r[2].split("/zoneinfo/")[1]||""}}catch{F.noop()}return t}Nn.time=tu;function or(n){n=n||"",n=n.toLowerCase();let t=Ye;return Be?t="windows":n.indexOf("mac os")!==-1||n.indexOf("macos")!==-1?t="apple":n.indexOf("arch")!==-1?t="arch":n.indexOf("cachy")!==-1?t="cachy":n.indexOf("centos")!==-1?t="centos":n.indexOf("coreos")!==-1?t="coreos":n.indexOf("debian")!==-1?t="debian":n.indexOf("deepin")!==-1?t="deepin":n.indexOf("elementary")!==-1?t="elementary":n.indexOf("endeavour")!==-1?t="endeavour":n.indexOf("fedora")!==-1?t="fedora":n.indexOf("gentoo")!==-1?t="gentoo":n.indexOf("mageia")!==-1?t="mageia":n.indexOf("mandriva")!==-1?t="mandriva":n.indexOf("manjaro")!==-1?t="manjaro":n.indexOf("mint")!==-1?t="mint":n.indexOf("mx")!==-1?t="mx":n.indexOf("openbsd")!==-1?t="openbsd":n.indexOf("freebsd")!==-1?t="freebsd":n.indexOf("opensuse")!==-1?t="opensuse":n.indexOf("pclinuxos")!==-1?t="pclinuxos":n.indexOf("puppy")!==-1?t="puppy":n.indexOf("popos")!==-1?t="popos":n.indexOf("raspbian")!==-1?t="raspbian":n.indexOf("reactos")!==-1?t="reactos":n.indexOf("redhat")!==-1?t="redhat":n.indexOf("slackware")!==-1?t="slackware":n.indexOf("sugar")!==-1?t="sugar":n.indexOf("steam")!==-1?t="steam":n.indexOf("suse")!==-1?t="suse":n.indexOf("mate")!==-1?t="ubuntu-mate":n.indexOf("lubuntu")!==-1?t="lubuntu":n.indexOf("xubuntu")!==-1?t="xubuntu":n.indexOf("ubuntu")!==-1?t="ubuntu":n.indexOf("solaris")!==-1?t="solaris":n.indexOf("tails")!==-1?t="tails":n.indexOf("feren")!==-1?t="ferenos":n.indexOf("robolinux")!==-1?t="robolinux":Dn&&n&&(t=n.toLowerCase().trim().replace(/\s+/g,"-")),t}function nu(){let n=Re.hostname;if(Dn||ke)try{n=ar("hostname -f 2>/dev/null",F.execOptsLinux).toString().split(Re.EOL)[0]}catch{F.noop()}if(Vs||ks||Bs)try{n=ar("hostname 2>/dev/null").toString().split(Re.EOL)[0]}catch{F.noop()}if(Be)try{n=ar("echo %COMPUTERNAME%.%USERDNSDOMAIN%",F.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(Re.EOL)[0]}catch{F.noop()}return n}function ru(n){return new Promise(t=>{process.nextTick(()=>{let e={platform:Ye==="win32"?"Windows":Ye,distro:"unknown",release:"unknown",codename:"",kernel:Re.release(),arch:Re.arch(),hostname:Re.hostname(),fqdn:nu(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(Dn&&W("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",function(r,i){let s={};i.toString().split(`
|
|
47
|
+
`).forEach(function(u){u.indexOf("=")!==-1&&(s[u.split("=")[0].trim().toUpperCase()]=u.split("=")[1].trim())}),e.distro=(s.DISTRIB_ID||s.NAME||"unknown").replace(/"/g,""),e.logofile=or(e.distro);let a=(s.VERSION||"").replace(/"/g,""),l=(s.DISTRIB_CODENAME||s.VERSION_CODENAME||"").replace(/"/g,""),c=(s.PRETTY_NAME||"").replace(/"/g,"");c.indexOf(e.distro+" ")===0&&(a=c.replace(e.distro+" ","").trim()),a.indexOf("(")>=0&&(l=a.split("(")[1].replace(/[()]/g,"").trim(),a=a.split("(")[0].trim()),e.release=(a||s.DISTRIB_RELEASE||s.VERSION_ID||"unknown").replace(/"/g,""),e.codename=l,e.codepage=F.getCodepage(),e.build=(s.BUILD_ID||"").replace(/"/g,"").trim(),su().then(u=>{e.uefi=u,to().then(p=>{e.serial=p.os,n&&n(e),t(e)})})}),(Vs||ks||Bs)&&W("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml",function(r,i){let s=i.toString().split(`
|
|
48
|
+
`),o=F.getValue(s,"kern.ostype"),a=or(o),l=F.getValue(s,"kern.osrelease").split("-")[0],c=F.getValue(s,"kern.uuid"),u=F.getValue(s,"machdep.bootmethod"),p=i.toString().indexOf("<type>efi</type>")>=0,d=u?u.toLowerCase().indexOf("uefi")>=0:p||null;e.distro=o||e.distro,e.logofile=a||e.logofile,e.release=l||e.release,e.serial=c||e.serial,e.codename="",e.codepage=F.getCodepage(),e.uefi=d||null,n&&n(e),t(e)}),ke&&W("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",function(r,i){let s=i.toString().split(`
|
|
49
|
+
`);e.serial=F.getValue(s,"kern.uuid"),e.distro=F.getValue(s,"ProductName"),e.release=(F.getValue(s,"ProductVersion",":",!0,!0)+" "+F.getValue(s,"ProductVersionExtra",":",!0,!0)).trim(),e.build=F.getValue(s,"BuildVersion"),e.logofile=or(e.distro),e.codename="macOS",e.codename=e.release.indexOf("10.4")>-1?"OS X Tiger":e.codename,e.codename=e.release.indexOf("10.5")>-1?"OS X Leopard":e.codename,e.codename=e.release.indexOf("10.6")>-1?"OS X Snow Leopard":e.codename,e.codename=e.release.indexOf("10.7")>-1?"OS X Lion":e.codename,e.codename=e.release.indexOf("10.8")>-1?"OS X Mountain Lion":e.codename,e.codename=e.release.indexOf("10.9")>-1?"OS X Mavericks":e.codename,e.codename=e.release.indexOf("10.10")>-1?"OS X Yosemite":e.codename,e.codename=e.release.indexOf("10.11")>-1?"OS X El Capitan":e.codename,e.codename=e.release.indexOf("10.12")>-1?"Sierra":e.codename,e.codename=e.release.indexOf("10.13")>-1?"High Sierra":e.codename,e.codename=e.release.indexOf("10.14")>-1?"Mojave":e.codename,e.codename=e.release.indexOf("10.15")>-1?"Catalina":e.codename,e.codename=e.release.startsWith("11.")?"Big Sur":e.codename,e.codename=e.release.startsWith("12.")?"Monterey":e.codename,e.codename=e.release.startsWith("13.")?"Ventura":e.codename,e.codename=e.release.startsWith("14.")?"Sonoma":e.codename,e.codename=e.release.startsWith("15.")?"Sequoia":e.codename,e.uefi=!0,e.codepage=F.getCodepage(),n&&n(e),t(e)}),eu&&(e.release=e.kernel,W("uname -o",function(r,i){let s=i.toString().split(`
|
|
50
|
+
`);e.distro=s[0],e.logofile=or(e.distro),n&&n(e),t(e)})),Be){e.logofile=or(),e.release=e.kernel;try{let r=[];r.push(F.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")),r.push(F.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),r.push(F.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),F.promiseAll(r).then(i=>{let s=i.results[0]?i.results[0].toString().split(`\r
|
|
51
|
+
`):[""];e.distro=F.getValue(s,"Caption",":").trim(),e.serial=F.getValue(s,"SerialNumber",":").trim(),e.build=F.getValue(s,"BuildNumber",":").trim(),e.servicepack=F.getValue(s,"ServicePackMajorVersion",":").trim()+"."+F.getValue(s,"ServicePackMinorVersion",":").trim(),e.codepage=F.getCodepage();let o=i.results[1]?i.results[1].toString().toLowerCase():"";e.hypervisor=o.indexOf("true")!==-1;let a=i.results[2]?i.results[2].toString():"";e.remoteSession=a.toString().toLowerCase().indexOf("true")>=0,iu().then(l=>{e.uefi=l,n&&n(e),t(e)})})}catch{n&&n(e),t(e)}}})})}Nn.osInfo=ru;function su(){return new Promise(n=>{process.nextTick(()=>{Ve.stat("/sys/firmware/efi",function(t){if(t)W('dmesg | grep -E "EFI v"',function(e,r){if(!e){let i=r.toString().split(`
|
|
52
|
+
`);return n(i.length>0)}return n(!1)});else return n(!0)})})})}function iu(){return new Promise(n=>{process.nextTick(()=>{try{W('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',F.execOptsWin,function(t,e){if(t)W("echo %firmware_type%",F.execOptsWin,function(r,i){if(r)return n(!1);{let s=i.toString()||"";return n(s.toLowerCase().indexOf("efi")>=0)}});else{let r=e.toString().split(`
|
|
53
|
+
\r`)[0];return n(r.toLowerCase().indexOf("efi")>=0)}})}catch{return n(!1)}})})}function ou(n,t){let e={kernel:Re.release(),apache:"",bash:"",bun:"",deno:"",docker:"",dotnet:"",fish:"",gcc:"",git:"",grunt:"",gulp:"",homebrew:"",java:"",mongodb:"",mysql:"",nginx:"",node:"",npm:"",openssl:"",perl:"",php:"",pip3:"",pip:"",pm2:"",postfix:"",postgresql:"",powershell:"",python3:"",python:"",redis:"",systemOpenssl:"",systemOpensslLib:"",tsc:"",v8:process.versions.v8,virtualbox:"",yarn:"",zsh:""};function r(i){if(i==="*")return{versions:e,counter:34};if(!Array.isArray(i)){i=i.trim().toLowerCase().replace(/,+/g,"|").replace(/ /g,"|"),i=i.split("|");let s={versions:{},counter:0};return i.forEach(o=>{if(o)for(let a in e)({}).hasOwnProperty.call(e,a)&&a.toLowerCase()===o.toLowerCase()&&!{}.hasOwnProperty.call(s.versions,a)&&(s.versions[a]=e[a],a==="openssl"&&(s.versions.systemOpenssl="",s.versions.systemOpensslLib=""),s.versions[a]||s.counter++)}),s}}return new Promise(i=>{process.nextTick(()=>{if(F.isFunction(n)&&!t)t=n,n="*";else if(n=n||"*",typeof n!="string")return t&&t({}),i({});let s=r(n),o=s.counter,a=function(){return function(){--o===0&&(t&&t(s.versions),i(s.versions))}}(),l="";try{if({}.hasOwnProperty.call(s.versions,"openssl")&&(s.versions.openssl=process.versions.openssl,W("openssl version",function(c,u){if(!c){let d=u.toString().split(`
|
|
54
|
+
`)[0].trim().split(" ");s.versions.systemOpenssl=d.length>0?d[1]:d[0],s.versions.systemOpensslLib=d.length>0?d[0]:"openssl"}a()})),{}.hasOwnProperty.call(s.versions,"npm")&&W("npm -v",function(c,u){c||(s.versions.npm=u.toString().split(`
|
|
55
|
+
`)[0]),a()}),{}.hasOwnProperty.call(s.versions,"pm2")&&(l="pm2",Be&&(l+=".cmd"),W(`${l} -v`,function(c,u){if(!c){let p=u.toString().split(`
|
|
56
|
+
`)[0].trim();p.startsWith("[PM2]")||(s.versions.pm2=p)}a()})),{}.hasOwnProperty.call(s.versions,"yarn")&&W("yarn --version",function(c,u){c||(s.versions.yarn=u.toString().split(`
|
|
57
|
+
`)[0]),a()}),{}.hasOwnProperty.call(s.versions,"gulp")&&(l="gulp",Be&&(l+=".cmd"),W(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
58
|
+
`)[0]||"";s.versions.gulp=(p.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"homebrew")&&(l="brew",W(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
59
|
+
`)[0]||"";s.versions.homebrew=(p.toLowerCase().split(" ")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"tsc")&&(l="tsc",Be&&(l+=".cmd"),W(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
60
|
+
`)[0]||"";s.versions.tsc=(p.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"grunt")&&(l="grunt",Be&&(l+=".cmd"),W(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
61
|
+
`)[0]||"";s.versions.grunt=(p.toLowerCase().split("cli v")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"git"))if(ke){let c=Ve.existsSync("/usr/local/Cellar/git")||Ve.existsSync("/opt/homebrew/bin/git");F.darwinXcodeExists()||c?W("git --version",function(u,p){if(!u){let d=p.toString().split(`
|
|
62
|
+
`)[0]||"";d=(d.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(d.split(" ")[0]||"").trim()}a()}):a()}else W("git --version",function(c,u){if(!c){let p=u.toString().split(`
|
|
63
|
+
`)[0]||"";p=(p.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(p.split(" ")[0]||"").trim()}a()});if({}.hasOwnProperty.call(s.versions,"apache")&&W("apachectl -v 2>&1",function(c,u){if(!c){let p=(u.toString().split(`
|
|
64
|
+
`)[0]||"").split(":");s.versions.apache=p.length>1?p[1].replace("Apache","").replace("/","").split("(")[0].trim():""}a()}),{}.hasOwnProperty.call(s.versions,"nginx")&&W("nginx -v 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
65
|
+
`)[0]||"";s.versions.nginx=(p.toLowerCase().split("/")[1]||"").trim()}a()}),{}.hasOwnProperty.call(s.versions,"mysql")&&W("mysql -V",function(c,u){if(!c){let p=u.toString().split(`
|
|
66
|
+
`)[0]||"";if(p=p.toLowerCase(),p.indexOf(",")>-1){p=(p.split(",")[0]||"").trim();let d=p.split(" ");s.versions.mysql=(d[d.length-1]||"").trim()}else p.indexOf(" ver ")>-1&&(p=p.split(" ver ")[1],s.versions.mysql=p.split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"php")&&W("php -v",function(c,u){if(!c){let d=(u.toString().split(`
|
|
67
|
+
`)[0]||"").split("(");d[0].indexOf("-")&&(d=d[0].split("-")),s.versions.php=d[0].replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"redis")&&W("redis-server --version",function(c,u){if(!c){let d=(u.toString().split(`
|
|
68
|
+
`)[0]||"").split(" ");s.versions.redis=F.getValue(d,"v","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"docker")&&W("docker --version",function(c,u){if(!c){let d=(u.toString().split(`
|
|
69
|
+
`)[0]||"").split(" ");s.versions.docker=d.length>2&&d[2].endsWith(",")?d[2].slice(0,-1):""}a()}),{}.hasOwnProperty.call(s.versions,"postfix")&&W("postconf -d | grep mail_version",function(c,u){if(!c){let p=u.toString().split(`
|
|
70
|
+
`)||[];s.versions.postfix=F.getValue(p,"mail_version","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"mongodb")&&W("mongod --version",function(c,u){if(!c){let p=u.toString().split(`
|
|
71
|
+
`)[0]||"";s.versions.mongodb=(p.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"postgresql")&&(Dn?W("locate bin/postgres",function(c,u){if(c)W("psql -V",function(p,d){if(!p){let f=d.toString().split(`
|
|
72
|
+
`)[0].split(" ")||[];s.versions.postgresql=f.length?f[f.length-1]:"",s.versions.postgresql=s.versions.postgresql.split("-")[0]}a()});else{let p=u.toString().split(`
|
|
73
|
+
`).sort();p.length?W(p[p.length-1]+" -V",function(d,f){if(!d){let m=f.toString().split(`
|
|
74
|
+
`)[0].split(" ")||[];s.versions.postgresql=m.length?m[m.length-1]:""}a()}):a()}}):Be?F.powerShell("Get-CimInstance Win32_Service | select caption | fl").then(c=>{c.split(/\n\s*\n/).forEach(p=>{if(p.trim()!==""){let d=p.trim().split(`\r
|
|
75
|
+
`),f=F.getValue(d,"caption",":",!0).toLowerCase();if(f.indexOf("postgresql")>-1){let m=f.split(" server ");m.length>1&&(s.versions.postgresql=m[1])}}}),a()}):W("postgres -V",function(c,u){if(c)W("pg_config --version",function(p,d){if(!p){let f=d.toString().split(`
|
|
76
|
+
`)[0].split(" ")||[];s.versions.postgresql=f.length?f[f.length-1]:""}});else{let p=u.toString().split(`
|
|
77
|
+
`)[0].split(" ")||[];s.versions.postgresql=p.length?p[p.length-1]:""}a()})),{}.hasOwnProperty.call(s.versions,"perl")&&W("perl -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
78
|
+
`)||"";for(;p.length>0&&p[0].trim()==="";)p.shift();p.length>0&&(s.versions.perl=p[0].split("(").pop().split(")")[0].replace("v",""))}a()}),{}.hasOwnProperty.call(s.versions,"python"))if(ke)try{let u=ar("sw_vers").toString().split(`
|
|
79
|
+
`),p=F.getValue(u,"ProductVersion",":"),d=Ve.existsSync("/usr/local/Cellar/python"),f=Ve.existsSync("/opt/homebrew/bin/python");F.darwinXcodeExists()&&F.semverCompare("12.0.1",p)<0||d||f?W(d?"/usr/local/Cellar/python -V 2>&1":f?"/opt/homebrew/bin/python -V 2>&1":"python -V 2>&1",function(g,x){if(!g){let h=x.toString().split(`
|
|
80
|
+
`)[0]||"";s.versions.python=h.toLowerCase().replace("python","").trim()}a()}):a()}catch{a()}else W("python -V 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
81
|
+
`)[0]||"";s.versions.python=p.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"python3"))if(ke){let c=Ve.existsSync("/usr/local/Cellar/python3")||Ve.existsSync("/opt/homebrew/bin/python3");F.darwinXcodeExists()||c?W("python3 -V 2>&1",function(u,p){if(!u){let d=p.toString().split(`
|
|
82
|
+
`)[0]||"";s.versions.python3=d.toLowerCase().replace("python","").trim()}a()}):a()}else W("python3 -V 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
83
|
+
`)[0]||"";s.versions.python3=p.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"pip"))if(ke){let c=Ve.existsSync("/usr/local/Cellar/pip")||Ve.existsSync("/opt/homebrew/bin/pip");F.darwinXcodeExists()||c?W("pip -V 2>&1",function(u,p){if(!u){let f=(p.toString().split(`
|
|
84
|
+
`)[0]||"").split(" ");s.versions.pip=f.length>=2?f[1]:""}a()}):a()}else W("pip -V 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
85
|
+
`)[0]||"").split(" ");s.versions.pip=d.length>=2?d[1]:""}a()});if({}.hasOwnProperty.call(s.versions,"pip3"))if(ke){let c=Ve.existsSync("/usr/local/Cellar/pip3")||Ve.existsSync("/opt/homebrew/bin/pip3");F.darwinXcodeExists()||c?W("pip3 -V 2>&1",function(u,p){if(!u){let f=(p.toString().split(`
|
|
86
|
+
`)[0]||"").split(" ");s.versions.pip3=f.length>=2?f[1]:""}a()}):a()}else W("pip3 -V 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
87
|
+
`)[0]||"").split(" ");s.versions.pip3=d.length>=2?d[1]:""}a()});({}).hasOwnProperty.call(s.versions,"java")&&(ke?W("/usr/libexec/java_home -V 2>&1",function(c,u){!c&&u.toString().toLowerCase().indexOf("no java runtime")===-1?W("java -version 2>&1",function(p,d){if(!p){let m=(d.toString().split(`
|
|
88
|
+
`)[0]||"").split('"');s.versions.java=m.length===3?m[1].trim():""}a()}):a()}):W("java -version 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
89
|
+
`)[0]||"").split('"');s.versions.java=d.length===3?d[1].trim():""}a()})),{}.hasOwnProperty.call(s.versions,"gcc")&&(ke&&F.darwinXcodeExists()||!ke?W("gcc -dumpversion",function(c,u){c||(s.versions.gcc=u.toString().split(`
|
|
90
|
+
`)[0].trim()||""),s.versions.gcc.indexOf(".")>-1?a():W("gcc --version",function(p,d){if(!p){let f=d.toString().split(`
|
|
91
|
+
`)[0].trim();if(f.indexOf("gcc")>-1&&f.indexOf(")")>-1){let m=f.split(")");s.versions.gcc=m[1].trim()||s.versions.gcc}}a()})}):a()),{}.hasOwnProperty.call(s.versions,"virtualbox")&&W(F.getVboxmanage()+" -v 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
92
|
+
`)[0]||"").split("r");s.versions.virtualbox=d[0]}a()}),{}.hasOwnProperty.call(s.versions,"bash")&&W("bash --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
93
|
+
`)[0].split(" version ");d.length>1&&(s.versions.bash=d[1].split(" ")[0].split("(")[0])}a()}),{}.hasOwnProperty.call(s.versions,"zsh")&&W("zsh --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
94
|
+
`)[0].split("zsh ");d.length>1&&(s.versions.zsh=d[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"fish")&&W("fish --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
95
|
+
`)[0].split(" version ");d.length>1&&(s.versions.fish=d[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"bun")&&W("bun -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
96
|
+
`)[0].trim();s.versions.bun=p}a()}),{}.hasOwnProperty.call(s.versions,"deno")&&W("deno -v",function(c,u){if(!c){let d=u.toString().split(`
|
|
97
|
+
`)[0].trim().split(" ");d.length>1&&(s.versions.deno=d[1])}a()}),{}.hasOwnProperty.call(s.versions,"node")&&W("node -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
98
|
+
`)[0].trim();p.startsWith("v")&&(p=p.slice(1)),s.versions.node=p}a()}),{}.hasOwnProperty.call(s.versions,"powershell")&&(Be?F.powerShell("$PSVersionTable").then(c=>{let u=c.toString().toLowerCase().split(`
|
|
99
|
+
`).map(p=>p.replace(/ +/g," ").replace(/ +/g,":"));s.versions.powershell=F.getValue(u,"psversion"),a()}):a()),{}.hasOwnProperty.call(s.versions,"dotnet")&&(Be?F.powerShell('gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release').then(c=>{let u=c.toString().split(`\r
|
|
100
|
+
`),p="";u.forEach(d=>{d=d.replace(/ +/g," ");let f=d.split(" ");p=p||(f[0].toLowerCase().startsWith("client")&&f.length>2||f[0].toLowerCase().startsWith("full")&&f.length>2?f[1].trim():"")}),s.versions.dotnet=p.trim(),a()}):a())}catch{t&&t(s.versions),i(s.versions)}})})}Nn.versions=ou;function au(n){return new Promise(t=>{process.nextTick(()=>{if(Be)try{let e="CMD";F.powerShell(`Get-CimInstance -className win32_process | where-object {$_.ProcessId -eq ${process.ppid} } | select Name`).then(r=>{let i="CMD";r&&r.toString().toLowerCase().indexOf("powershell")>=0&&(i="PowerShell"),n&&n(i),t(i)})}catch{n&&n(result),t(result)}else{let e="";W("echo $SHELL",function(r,i){r||(e=i.toString().split(`
|
|
101
|
+
`)[0]),n&&n(e),t(e)})}})})}Nn.shell=au;function lu(){let n=[];try{let t=Re.networkInterfaces();for(let e in t)({}).hasOwnProperty.call(t,e)&&t[e].forEach(function(r){if(r&&r.mac&&r.mac!=="00:00:00:00:00:00"){let i=r.mac.toLowerCase();n.indexOf(i)===-1&&n.push(i)}});n=n.sort(function(e,r){return e<r?-1:e>r?1:0})}catch{n.push("00:00:00:00:00:00")}return n}function to(n){return new Promise(t=>{process.nextTick(()=>{let e={os:"",hardware:"",macs:lu()},r;if(ke&&W("system_profiler SPHardwareDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPHardwareDataType&&o.SPHardwareDataType.length>0){let a=o.SPHardwareDataType[0];e.os=a.platform_UUID.toLowerCase(),e.hardware=a.serial_number}}catch{F.noop()}n&&n(e),t(e)}),Dn&&W(`echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null ||
|
|
98
102
|
cat /etc/machine-id 2> /dev/null; echo;
|
|
99
|
-
echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,function(
|
|
100
|
-
`);if(e.os=F.getValue(a,"os").toLowerCase(),e.hardware=F.getValue(a,"hardware").toLowerCase(),!e.hardware){let l=
|
|
101
|
-
`),c=F.getValue(l,"serial");e.hardware=c||""}
|
|
102
|
-
`);e.os=F.getValue(o,"kern.hostid",":").toLowerCase(),e.hardware=F.getValue(o,"kern.hostuuid",":").toLowerCase(),e.os.indexOf("unknown")>=0&&(e.os=""),e.hardware.indexOf("unknown")>=0&&(e.hardware=""),
|
|
103
|
-
`);e.hardware=F.getValue(o,"uuid",":").toLowerCase(),
|
|
104
|
-
\r`)[0].split("REG_SZ"),e.os=r.length>1?r[1].replace(/\r+|\n+|\s+/ig,"").toLowerCase():"",s&&s(e),t(e)})})}})})}Ns.uuid=to});var lo=le(vt=>{"use strict";var $e=require("os"),Oe=require("child_process").exec,Bn=require("child_process").execSync,Ur=require("fs"),P=ce(),St=process.platform,ar=St==="linux"||St==="android",Gr=St==="darwin",jr=St==="win32",zr=St==="freebsd",qr=St==="openbsd",Hr=St==="netbsd",$r=St==="sunos",Ds=0,K={user:0,nice:0,system:0,idle:0,irq:0,steal:0,guest:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,currentLoadSteal:0,currentLoadGuest:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0,rawCurrentLoadSteal:0,rawCurrentLoadGuest:0},C=[],bn=0,Mn={8346:"1.8",8347:"1.9",8350:"2.0",8354:"2.2","8356|SE":"2.4",8356:"2.3",8360:"2.5",2372:"2.1",2373:"2.1",2374:"2.2",2376:"2.3",2377:"2.3",2378:"2.4",2379:"2.4",2380:"2.5",2381:"2.5",2382:"2.6",2384:"2.7",2386:"2.8",2387:"2.8",2389:"2.9",2393:"3.1",8374:"2.2",8376:"2.3",8378:"2.4",8379:"2.4",8380:"2.5",8381:"2.5",8382:"2.6",8384:"2.7",8386:"2.8",8387:"2.8",8389:"2.9",8393:"3.1","2419EE":"1.8","2423HE":"2.0","2425HE":"2.1",2427:"2.2",2431:"2.4",2435:"2.6","2439SE":"2.8","8425HE":"2.1",8431:"2.4",8435:"2.6","8439SE":"2.8",4122:"2.2",4130:"2.6","4162EE":"1.7","4164EE":"1.8","4170HE":"2.1","4174HE":"2.3","4176HE":"2.4",4180:"2.6",4184:"2.8","6124HE":"1.8","6128HE":"2.0","6132HE":"2.2",6128:"2.0",6134:"2.3",6136:"2.4",6140:"2.6","6164HE":"1.7","6166HE":"1.8",6168:"1.9",6172:"2.1",6174:"2.2",6176:"2.3","6176SE":"2.3","6180SE":"2.5",3250:"2.5",3260:"2.7",3280:"2.4",4226:"2.7",4228:"2.8",4230:"2.9",4234:"3.1",4238:"3.3",4240:"3.4",4256:"1.6",4274:"2.5",4276:"2.6",4280:"2.8",4284:"3.0",6204:"3.3",6212:"2.6",6220:"3.0",6234:"2.4",6238:"2.6","6262HE":"1.6",6272:"2.1",6274:"2.2",6276:"2.3",6278:"2.4","6282SE":"2.6","6284SE":"2.7",6308:"3.5",6320:"2.8",6328:"3.2","6338P":"2.3",6344:"2.6",6348:"2.8",6366:"1.8","6370P":"2.0",6376:"2.3",6378:"2.4",6380:"2.5",6386:"2.8","FX|4100":"3.6","FX|4120":"3.9","FX|4130":"3.8","FX|4150":"3.8","FX|4170":"4.2","FX|6100":"3.3","FX|6120":"3.6","FX|6130":"3.6","FX|6200":"3.8","FX|8100":"2.8","FX|8120":"3.1","FX|8140":"3.2","FX|8150":"3.6","FX|8170":"3.9","FX|4300":"3.8","FX|4320":"4.0","FX|4350":"4.2","FX|6300":"3.5","FX|6350":"3.9","FX|8300":"3.3","FX|8310":"3.4","FX|8320":"3.5","FX|8350":"4.0","FX|8370":"4.0","FX|9370":"4.4","FX|9590":"4.7","FX|8320E":"3.2","FX|8370E":"3.3",1200:"3.1","Pro 1200":"3.1","1300X":"3.5","Pro 1300":"3.5",1400:"3.2","1500X":"3.5","Pro 1500":"3.5",1600:"3.2","1600X":"3.6","Pro 1600":"3.2",1700:"3.0","Pro 1700":"3.0","1700X":"3.4","Pro 1700X":"3.4","1800X":"3.6","1900X":"3.8",1920:"3.2","1920X":"3.5","1950X":"3.4","200GE":"3.2","Pro 200GE":"3.2","220GE":"3.4","240GE":"3.5","3000G":"3.5","300GE":"3.4","3050GE":"3.4","2200G":"3.5","Pro 2200G":"3.5","2200GE":"3.2","Pro 2200GE":"3.2","2400G":"3.6","Pro 2400G":"3.6","2400GE":"3.2","Pro 2400GE":"3.2","Pro 200U":"2.3","300U":"2.4","2200U":"2.5","3200U":"2.6","2300U":"2.0","Pro 2300U":"2.0","2500U":"2.0","Pro 2500U":"2.2","2600H":"3.2","2700U":"2.0","Pro 2700U":"2.2","2800H":"3.3",7351:"2.4","7351P":"2.4",7401:"2.0","7401P":"2.0","7551P":"2.0",7551:"2.0",7251:"2.1",7261:"2.5",7281:"2.1",7301:"2.2",7371:"3.1",7451:"2.3",7501:"2.0",7571:"2.2",7601:"2.2",V1500B:"2.2",V1780B:"3.35",V1202B:"2.3",V1404I:"2.0",V1605B:"2.0",V1756B:"3.25",V1807B:"3.35",3101:"2.1",3151:"2.7",3201:"1.5",3251:"2.5",3255:"2.5",3301:"2.0",3351:"1.9",3401:"1.85",3451:"2.15","1200|AF":"3.1","2300X":"3.5","2500X":"3.6",2600:"3.4","2600E":"3.1","1600|AF":"3.2","2600X":"3.6",2700:"3.2","2700E":"2.8","Pro 2700":"3.2","2700X":"3.7","Pro 2700X":"3.6","2920X":"3.5","2950X":"3.5","2970WX":"3.0","2990WX":"3.0","Pro 300GE":"3.4","Pro 3125GE":"3.4","3150G":"3.5","Pro 3150G":"3.5","3150GE":"3.3","Pro 3150GE":"3.3","3200G":"3.6","Pro 3200G":"3.6","3200GE":"3.3","Pro 3200GE":"3.3","3350G":"3.6","Pro 3350G":"3.6","3350GE":"3.3","Pro 3350GE":"3.3","3400G":"3.7","Pro 3400G":"3.7","3400GE":"3.3","Pro 3400GE":"3.3","3300U":"2.1","PRO 3300U":"2.1","3450U":"2.1","3500U":"2.1","PRO 3500U":"2.1","3500C":"2.1","3550H":"2.1","3580U":"2.1","3700U":"2.3","PRO 3700U":"2.3","3700C":"2.3","3750H":"2.3","3780U":"2.3",3100:"3.6","3300X":"3.8",3500:"3.6","3500X":"3.6",3600:"3.6","Pro 3600":"3.6","3600X":"3.8","3600XT":"3.8","Pro 3700":"3.6","3700X":"3.6","3800X":"3.9","3800XT":"3.9",3900:"3.1","Pro 3900":"3.1","3900X":"3.8","3900XT":"3.8","3950X":"3.5","3960X":"3.8","3970X":"3.7","3990X":"2.9","3945WX":"4.0","3955WX":"3.9","3975WX":"3.5","3995WX":"2.7","4300GE":"3.5","Pro 4300GE":"3.5","4300G":"3.8","Pro 4300G":"3.8","4600GE":"3.3","Pro 4650GE":"3.3","4600G":"3.7","Pro 4650G":"3.7","4700GE":"3.1","Pro 4750GE":"3.1","4700G":"3.6","Pro 4750G":"3.6","4300U":"2.7","4450U":"2.5","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4680U":"2.1","4600HS":"3.0","4600H":"3.0","4700U":"2.0","PRO 4750U":"1.7","4800U":"1.8","4800HS":"2.9","4800H":"2.9","4900HS":"3.0","4900H":"3.3","5300U":"2.6","5500U":"2.1","5700U":"1.8","7232P":"3.1","7302P":"3.0","7402P":"2.8","7502P":"2.5","7702P":"2.0",7252:"3.1",7262:"3.2",7272:"2.9",7282:"2.8",7302:"3.0",7352:"2.3",7402:"2.8",7452:"2.35",7502:"2.5",7532:"2.4",7542:"2.9",7552:"2.2",7642:"2.3",7662:"2.0",7702:"2.0",7742:"2.25","7H12":"2.6","7F32":"3.7","7F52":"3.5","7F72":"3.2","7773X":"2.2",7763:"2.45",7713:"2.0","7713P":"2.0",7663:"2.0",7643:"2.3","7573X":"2.8","75F3":"2.95",7543:"2.8","7543P":"2.8",7513:"2.6","7473X":"2.8",7453:"2.75","74F3":"3.2",7443:"2.85","7443P":"2.85",7413:"2.65","7373X":"3.05","73F3":"3.5",7343:"3.2",7313:"3.0","7313P":"3.0","72F3":"3.7","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4","5945WX":"4.1","5955WX":"4.0","5965WX":"3.8","5975WX":"3.6","5995WX":"2.7","7960X":"4.2","7970X":"4.0","7980X":"3.2","7965WX":"4.2","7975WX":"4.0","7985WX":"3.2","7995WX":"2.5",9754:"2.25","9754S":"2.25",9734:"2.2","9684X":"2.55","9384X":"3.1","9184X":"3.55","9654P":"2.4",9654:"2.4",9634:"2.25","9554P":"3.1",9554:"3.1",9534:"2.45","9474F":"3.6","9454P":"2.75",9454:"2.75","9374F":"3.85","9354P":"3.25",9354:"3.25",9334:"2.7","9274F":"4.05",9254:"2.9",9224:"2.5","9174F":"4.1",9124:"3.0"},ro={1:"Other",2:"Unknown",3:"Daughter Board",4:"ZIF Socket",5:"Replacement/Piggy Back",6:"None",7:"LIF Socket",8:"Slot 1",9:"Slot 2",10:"370 Pin Socket",11:"Slot A",12:"Slot M",13:"423",14:"A (Socket 462)",15:"478",16:"754",17:"940",18:"939",19:"mPGA604",20:"LGA771",21:"LGA775",22:"S1",23:"AM2",24:"F (1207)",25:"LGA1366",26:"G34",27:"AM3",28:"C32",29:"LGA1156",30:"LGA1567",31:"PGA988A",32:"BGA1288",33:"rPGA988B",34:"BGA1023",35:"BGA1224",36:"LGA1155",37:"LGA1356",38:"LGA2011",39:"FS1",40:"FS2",41:"FM1",42:"FM2",43:"LGA2011-3",44:"LGA1356-3",45:"LGA1150",46:"BGA1168",47:"BGA1234",48:"BGA1364",49:"AM4",50:"LGA1151",51:"BGA1356",52:"BGA1440",53:"BGA1515",54:"LGA3647-1",55:"SP3",56:"SP3r2",57:"LGA2066",58:"BGA1392",59:"BGA1510",60:"BGA1528",61:"LGA4189",62:"LGA1200",63:"LGA4677",64:"LGA1700",65:"BGA1744",66:"BGA1781",67:"BGA1211",68:"BGA2422",69:"LGA1211",70:"LGA2422",71:"LGA5773",72:"BGA5773"},no={LGA1150:"i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",LGA1151:"i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",1155:"G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"};function Zc(s){let t="";for(let e in no)no[e].split(" ").forEach(i=>{s.indexOf(i)>=0&&(t=e)});return t}function kn(s){let t=s;return s=s.toLowerCase(),s.indexOf("intel")>=0&&(t="Intel"),s.indexOf("amd")>=0&&(t="AMD"),s.indexOf("qemu")>=0&&(t="QEMU"),s.indexOf("hygon")>=0&&(t="Hygon"),s.indexOf("centaur")>=0&&(t="WinChip/Via"),s.indexOf("vmware")>=0&&(t="VMware"),s.indexOf("Xen")>=0&&(t="Xen Hypervisor"),s.indexOf("tcg")>=0&&(t="QEMU"),s.indexOf("apple")>=0&&(t="Apple"),t}function Wr(s){s.brand=s.brand.replace(/\(R\)+/g,"\xAE").replace(/\s+/g," ").trim(),s.brand=s.brand.replace(/\(TM\)+/g,"\u2122").replace(/\s+/g," ").trim(),s.brand=s.brand.replace(/\(C\)+/g,"\xA9").replace(/\s+/g," ").trim(),s.brand=s.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),s.manufacturer=kn(s.brand);let t=s.brand.split(" ");return t.shift(),s.brand=t.join(" "),s}function Rn(s){let t="0";for(let e in Mn)if({}.hasOwnProperty.call(Mn,e)){let r=e.split("|"),i=0;r.forEach(n=>{s.indexOf(n)>-1&&i++}),i===r.length&&(t=Mn[e])}return parseFloat(t)}function Jc(){return new Promise(s=>{process.nextTick(()=>{let t="unknown",e={manufacturer:t,brand:t,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:P.cores(),physicalCores:P.cores(),performanceCores:P.cores(),efficiencyCores:0,processors:1,socket:"",flags:"",virtualization:!1,cache:{}};io().then(r=>{if(e.flags=r,e.virtualization=r.indexOf("vmx")>-1||r.indexOf("svm")>-1,Gr&&Oe("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",function(i,n){let o=n.toString().split(`
|
|
105
|
-
`),l=
|
|
106
|
-
`),g=m.filter(h=>h.indexOf('"E"')>=0).length,
|
|
107
|
-
`)),i=
|
|
108
|
-
`),
|
|
109
|
-
`),m&&m.length&&(e.socket=
|
|
110
|
-
`)}if(e.brand=i.split("@")[0].trim(),e.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=
|
|
111
|
-
`);let m=
|
|
112
|
-
`),a=
|
|
113
|
-
`);if(
|
|
114
|
-
`)
|
|
115
|
-
`)
|
|
116
|
-
`)
|
|
117
|
-
`),
|
|
118
|
-
`);m.
|
|
119
|
-
`);m.length>0&&
|
|
120
|
-
`)
|
|
121
|
-
`).
|
|
122
|
-
`).forEach(function(
|
|
123
|
-
`)
|
|
124
|
-
`)
|
|
125
|
-
`)
|
|
126
|
-
`).
|
|
127
|
-
`)
|
|
128
|
-
`).
|
|
129
|
-
`)
|
|
130
|
-
`),
|
|
131
|
-
`)
|
|
132
|
-
`);
|
|
133
|
-
`)
|
|
103
|
+
echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,function(s,o){let a=o.toString().split(`
|
|
104
|
+
`);if(e.os=F.getValue(a,"os").toLowerCase(),e.hardware=F.getValue(a,"hardware").toLowerCase(),!e.hardware){let l=Ve.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
|
|
105
|
+
`),c=F.getValue(l,"serial");e.hardware=c||""}n&&n(e),t(e)}),(Vs||ks||Bs)&&W("sysctl -i kern.hostid kern.hostuuid",function(i,s){let o=s.toString().split(`
|
|
106
|
+
`);e.os=F.getValue(o,"kern.hostid",":").toLowerCase(),e.hardware=F.getValue(o,"kern.hostuuid",":").toLowerCase(),e.os.indexOf("unknown")>=0&&(e.os=""),e.hardware.indexOf("unknown")>=0&&(e.hardware=""),n&&n(e),t(e)}),Be){let i="%windir%\\System32";process.arch==="ia32"&&Object.prototype.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")&&(i="%windir%\\sysnative\\cmd.exe /c %windir%\\System32"),F.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then(s=>{let o=s.split(`\r
|
|
107
|
+
`);e.hardware=F.getValue(o,"uuid",":").toLowerCase(),W(`${i}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`,F.execOptsWin,function(a,l){r=l.toString().split(`
|
|
108
|
+
\r`)[0].split("REG_SZ"),e.os=r.length>1?r[1].replace(/\r+|\n+|\s+/ig,"").toLowerCase():"",n&&n(e),t(e)})})}})})}Nn.uuid=to});var lo=oe(vt=>{"use strict";var Xe=require("os"),Ie=require("child_process").exec,Kr=require("child_process").execSync,qr=require("fs"),O=ue(),Ct=process.platform,kn=Ct==="linux"||Ct==="android",$r=Ct==="darwin",Yr=Ct==="win32",Xr=Ct==="freebsd",Zr=Ct==="openbsd",Jr=Ct==="netbsd",Qr=Ct==="sunos",Vn=0,Z={user:0,nice:0,system:0,idle:0,irq:0,steal:0,guest:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,currentLoadSteal:0,currentLoadGuest:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0,rawCurrentLoadSteal:0,rawCurrentLoadGuest:0},w=[],Rs=0,Fs={8346:"1.8",8347:"1.9",8350:"2.0",8354:"2.2","8356|SE":"2.4",8356:"2.3",8360:"2.5",2372:"2.1",2373:"2.1",2374:"2.2",2376:"2.3",2377:"2.3",2378:"2.4",2379:"2.4",2380:"2.5",2381:"2.5",2382:"2.6",2384:"2.7",2386:"2.8",2387:"2.8",2389:"2.9",2393:"3.1",8374:"2.2",8376:"2.3",8378:"2.4",8379:"2.4",8380:"2.5",8381:"2.5",8382:"2.6",8384:"2.7",8386:"2.8",8387:"2.8",8389:"2.9",8393:"3.1","2419EE":"1.8","2423HE":"2.0","2425HE":"2.1",2427:"2.2",2431:"2.4",2435:"2.6","2439SE":"2.8","8425HE":"2.1",8431:"2.4",8435:"2.6","8439SE":"2.8",4122:"2.2",4130:"2.6","4162EE":"1.7","4164EE":"1.8","4170HE":"2.1","4174HE":"2.3","4176HE":"2.4",4180:"2.6",4184:"2.8","6124HE":"1.8","6128HE":"2.0","6132HE":"2.2",6128:"2.0",6134:"2.3",6136:"2.4",6140:"2.6","6164HE":"1.7","6166HE":"1.8",6168:"1.9",6172:"2.1",6174:"2.2",6176:"2.3","6176SE":"2.3","6180SE":"2.5",3250:"2.5",3260:"2.7",3280:"2.4",4226:"2.7",4228:"2.8",4230:"2.9",4234:"3.1",4238:"3.3",4240:"3.4",4256:"1.6",4274:"2.5",4276:"2.6",4280:"2.8",4284:"3.0",6204:"3.3",6212:"2.6",6220:"3.0",6234:"2.4",6238:"2.6","6262HE":"1.6",6272:"2.1",6274:"2.2",6276:"2.3",6278:"2.4","6282SE":"2.6","6284SE":"2.7",6308:"3.5",6320:"2.8",6328:"3.2","6338P":"2.3",6344:"2.6",6348:"2.8",6366:"1.8","6370P":"2.0",6376:"2.3",6378:"2.4",6380:"2.5",6386:"2.8","FX|4100":"3.6","FX|4120":"3.9","FX|4130":"3.8","FX|4150":"3.8","FX|4170":"4.2","FX|6100":"3.3","FX|6120":"3.6","FX|6130":"3.6","FX|6200":"3.8","FX|8100":"2.8","FX|8120":"3.1","FX|8140":"3.2","FX|8150":"3.6","FX|8170":"3.9","FX|4300":"3.8","FX|4320":"4.0","FX|4350":"4.2","FX|6300":"3.5","FX|6350":"3.9","FX|8300":"3.3","FX|8310":"3.4","FX|8320":"3.5","FX|8350":"4.0","FX|8370":"4.0","FX|9370":"4.4","FX|9590":"4.7","FX|8320E":"3.2","FX|8370E":"3.3",1200:"3.1","Pro 1200":"3.1","1300X":"3.5","Pro 1300":"3.5",1400:"3.2","1500X":"3.5","Pro 1500":"3.5",1600:"3.2","1600X":"3.6","Pro 1600":"3.2",1700:"3.0","Pro 1700":"3.0","1700X":"3.4","Pro 1700X":"3.4","1800X":"3.6","1900X":"3.8",1920:"3.2","1920X":"3.5","1950X":"3.4","200GE":"3.2","Pro 200GE":"3.2","220GE":"3.4","240GE":"3.5","3000G":"3.5","300GE":"3.4","3050GE":"3.4","2200G":"3.5","Pro 2200G":"3.5","2200GE":"3.2","Pro 2200GE":"3.2","2400G":"3.6","Pro 2400G":"3.6","2400GE":"3.2","Pro 2400GE":"3.2","Pro 200U":"2.3","300U":"2.4","2200U":"2.5","3200U":"2.6","2300U":"2.0","Pro 2300U":"2.0","2500U":"2.0","Pro 2500U":"2.2","2600H":"3.2","2700U":"2.0","Pro 2700U":"2.2","2800H":"3.3",7351:"2.4","7351P":"2.4",7401:"2.0","7401P":"2.0","7551P":"2.0",7551:"2.0",7251:"2.1",7261:"2.5",7281:"2.1",7301:"2.2",7371:"3.1",7451:"2.3",7501:"2.0",7571:"2.2",7601:"2.2",V1500B:"2.2",V1780B:"3.35",V1202B:"2.3",V1404I:"2.0",V1605B:"2.0",V1756B:"3.25",V1807B:"3.35",3101:"2.1",3151:"2.7",3201:"1.5",3251:"2.5",3255:"2.5",3301:"2.0",3351:"1.9",3401:"1.85",3451:"2.15","1200|AF":"3.1","2300X":"3.5","2500X":"3.6",2600:"3.4","2600E":"3.1","1600|AF":"3.2","2600X":"3.6",2700:"3.2","2700E":"2.8","Pro 2700":"3.2","2700X":"3.7","Pro 2700X":"3.6","2920X":"3.5","2950X":"3.5","2970WX":"3.0","2990WX":"3.0","Pro 300GE":"3.4","Pro 3125GE":"3.4","3150G":"3.5","Pro 3150G":"3.5","3150GE":"3.3","Pro 3150GE":"3.3","3200G":"3.6","Pro 3200G":"3.6","3200GE":"3.3","Pro 3200GE":"3.3","3350G":"3.6","Pro 3350G":"3.6","3350GE":"3.3","Pro 3350GE":"3.3","3400G":"3.7","Pro 3400G":"3.7","3400GE":"3.3","Pro 3400GE":"3.3","3300U":"2.1","PRO 3300U":"2.1","3450U":"2.1","3500U":"2.1","PRO 3500U":"2.1","3500C":"2.1","3550H":"2.1","3580U":"2.1","3700U":"2.3","PRO 3700U":"2.3","3700C":"2.3","3750H":"2.3","3780U":"2.3",3100:"3.6","3300X":"3.8",3500:"3.6","3500X":"3.6",3600:"3.6","Pro 3600":"3.6","3600X":"3.8","3600XT":"3.8","Pro 3700":"3.6","3700X":"3.6","3800X":"3.9","3800XT":"3.9",3900:"3.1","Pro 3900":"3.1","3900X":"3.8","3900XT":"3.8","3950X":"3.5","3960X":"3.8","3970X":"3.7","3990X":"2.9","3945WX":"4.0","3955WX":"3.9","3975WX":"3.5","3995WX":"2.7","4300GE":"3.5","Pro 4300GE":"3.5","4300G":"3.8","Pro 4300G":"3.8","4600GE":"3.3","Pro 4650GE":"3.3","4600G":"3.7","Pro 4650G":"3.7","4700GE":"3.1","Pro 4750GE":"3.1","4700G":"3.6","Pro 4750G":"3.6","4300U":"2.7","4450U":"2.5","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4680U":"2.1","4600HS":"3.0","4600H":"3.0","4700U":"2.0","PRO 4750U":"1.7","4800U":"1.8","4800HS":"2.9","4800H":"2.9","4900HS":"3.0","4900H":"3.3","5300U":"2.6","5500U":"2.1","5700U":"1.8","7232P":"3.1","7302P":"3.0","7402P":"2.8","7502P":"2.5","7702P":"2.0",7252:"3.1",7262:"3.2",7272:"2.9",7282:"2.8",7302:"3.0",7352:"2.3",7402:"2.8",7452:"2.35",7502:"2.5",7532:"2.4",7542:"2.9",7552:"2.2",7642:"2.3",7662:"2.0",7702:"2.0",7742:"2.25","7H12":"2.6","7F32":"3.7","7F52":"3.5","7F72":"3.2","7773X":"2.2",7763:"2.45",7713:"2.0","7713P":"2.0",7663:"2.0",7643:"2.3","7573X":"2.8","75F3":"2.95",7543:"2.8","7543P":"2.8",7513:"2.6","7473X":"2.8",7453:"2.75","74F3":"3.2",7443:"2.85","7443P":"2.85",7413:"2.65","7373X":"3.05","73F3":"3.5",7343:"3.2",7313:"3.0","7313P":"3.0","72F3":"3.7","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4","5945WX":"4.1","5955WX":"4.0","5965WX":"3.8","5975WX":"3.6","5995WX":"2.7","7960X":"4.2","7970X":"4.0","7980X":"3.2","7965WX":"4.2","7975WX":"4.0","7985WX":"3.2","7995WX":"2.5",9754:"2.25","9754S":"2.25",9734:"2.2","9684X":"2.55","9384X":"3.1","9184X":"3.55","9654P":"2.4",9654:"2.4",9634:"2.25","9554P":"3.1",9554:"3.1",9534:"2.45","9474F":"3.6","9454P":"2.75",9454:"2.75","9374F":"3.85","9354P":"3.25",9354:"3.25",9334:"2.7","9274F":"4.05",9254:"2.9",9224:"2.5","9174F":"4.1",9124:"3.0"},ro={1:"Other",2:"Unknown",3:"Daughter Board",4:"ZIF Socket",5:"Replacement/Piggy Back",6:"None",7:"LIF Socket",8:"Slot 1",9:"Slot 2",10:"370 Pin Socket",11:"Slot A",12:"Slot M",13:"423",14:"A (Socket 462)",15:"478",16:"754",17:"940",18:"939",19:"mPGA604",20:"LGA771",21:"LGA775",22:"S1",23:"AM2",24:"F (1207)",25:"LGA1366",26:"G34",27:"AM3",28:"C32",29:"LGA1156",30:"LGA1567",31:"PGA988A",32:"BGA1288",33:"rPGA988B",34:"BGA1023",35:"BGA1224",36:"LGA1155",37:"LGA1356",38:"LGA2011",39:"FS1",40:"FS2",41:"FM1",42:"FM2",43:"LGA2011-3",44:"LGA1356-3",45:"LGA1150",46:"BGA1168",47:"BGA1234",48:"BGA1364",49:"AM4",50:"LGA1151",51:"BGA1356",52:"BGA1440",53:"BGA1515",54:"LGA3647-1",55:"SP3",56:"SP3r2",57:"LGA2066",58:"BGA1392",59:"BGA1510",60:"BGA1528",61:"LGA4189",62:"LGA1200",63:"LGA4677",64:"LGA1700",65:"BGA1744",66:"BGA1781",67:"BGA1211",68:"BGA2422",69:"LGA1211",70:"LGA2422",71:"LGA5773",72:"BGA5773"},so={LGA1150:"i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",LGA1151:"i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",1155:"G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"};function cu(n){let t="";for(let e in so)so[e].split(" ").forEach(i=>{n.indexOf(i)>=0&&(t=e)});return t}function jr(n){let t=n;return n=n.toLowerCase(),n.indexOf("intel")>=0&&(t="Intel"),n.indexOf("amd")>=0&&(t="AMD"),n.indexOf("qemu")>=0&&(t="QEMU"),n.indexOf("hygon")>=0&&(t="Hygon"),n.indexOf("centaur")>=0&&(t="WinChip/Via"),n.indexOf("vmware")>=0&&(t="VMware"),n.indexOf("Xen")>=0&&(t="Xen Hypervisor"),n.indexOf("tcg")>=0&&(t="QEMU"),n.indexOf("apple")>=0&&(t="Apple"),n.indexOf("sifive")>=0&&(t="SiFive"),n.indexOf("thead")>=0&&(t="T-Head"),n.indexOf("andestech")>=0&&(t="Andes Technology"),t}function Hr(n){n.brand=n.brand.replace(/\(R\)+/g,"\xAE").replace(/\s+/g," ").trim(),n.brand=n.brand.replace(/\(TM\)+/g,"\u2122").replace(/\s+/g," ").trim(),n.brand=n.brand.replace(/\(C\)+/g,"\xA9").replace(/\s+/g," ").trim(),n.brand=n.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),n.manufacturer=jr(n.brand);let t=n.brand.split(" ");return t.shift(),n.brand=t.join(" "),n}function Gs(n){let t="0";for(let e in Fs)if({}.hasOwnProperty.call(Fs,e)){let r=e.split("|"),i=0;r.forEach(s=>{n.indexOf(s)>-1&&i++}),i===r.length&&(t=Fs[e])}return parseFloat(t)}function uu(){return new Promise(n=>{process.nextTick(()=>{let t="unknown",e={manufacturer:t,brand:t,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:O.cores(),physicalCores:O.cores(),performanceCores:O.cores(),efficiencyCores:0,processors:1,socket:"",flags:"",virtualization:!1,cache:{}};io().then(r=>{if(e.flags=r,e.virtualization=r.indexOf("vmx")>-1||r.indexOf("svm")>-1,$r&&Ie("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",function(i,s){let o=s.toString().split(`
|
|
109
|
+
`),l=O.getValue(o,"machdep.cpu.brand_string").split("@");e.brand=l[0].trim();let c=l[1]?l[1].trim():"0";e.speed=parseFloat(c.replace(/GHz+/g,""));let u=O.getValue(o,"hw.tbfrequency")/1e9;u=u<.1?u*100:u,e.speed=e.speed===0?u:e.speed,Vn=e.speed,e=Hr(e),e.speedMin=O.getValue(o,"hw.cpufrequency_min")?O.getValue(o,"hw.cpufrequency_min")/1e9:e.speed,e.speedMax=O.getValue(o,"hw.cpufrequency_max")?O.getValue(o,"hw.cpufrequency_max")/1e9:e.speed,e.vendor=O.getValue(o,"machdep.cpu.vendor")||"Apple",e.family=O.getValue(o,"machdep.cpu.family")||O.getValue(o,"hw.cpufamily"),e.model=O.getValue(o,"machdep.cpu.model"),e.stepping=O.getValue(o,"machdep.cpu.stepping")||O.getValue(o,"hw.cpusubfamily"),e.virtualization=!0;let p=O.getValue(o,"hw.packages"),d=O.getValue(o,"hw.physicalcpu_max"),f=O.getValue(o,"hw.ncpu");if(Xe.arch()==="arm64"){e.socket="SOC";try{let m=Kr("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split(`
|
|
110
|
+
`),g=m.filter(h=>h.indexOf('"E"')>=0).length,x=m.filter(h=>h.indexOf('"P"')>=0).length;e.efficiencyCores=g,e.performanceCores=x}catch{O.noop()}}p&&(e.processors=parseInt(p)||1),d&&f&&(e.cores=parseInt(f)||O.cores(),e.physicalCores=parseInt(d)||O.cores()),oo().then(m=>{e.cache=m,n(e)})}),kn){let i="",s=[];Xe.cpus()[0]&&Xe.cpus()[0].model&&(i=Xe.cpus()[0].model),Ie('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL',function(o,a){o||(s=a.toString().split(`
|
|
111
|
+
`)),i=O.getValue(s,"model name")||i,i=O.getValue(s,"bios model name")||i,i=O.cleanString(i);let l=i.split("@");if(e.brand=l[0].trim(),e.speed=l[1]?parseFloat(l[1].trim()):0,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=Gs(e.brand)),e.speed===0){let g=Ws();g.avg!==0&&(e.speed=g.avg)}Vn=e.speed,e.speedMin=Math.round(parseFloat(O.getValue(s,"cpu min mhz").replace(/,/g,"."))/10)/100,e.speedMax=Math.round(parseFloat(O.getValue(s,"cpu max mhz").replace(/,/g,"."))/10)/100,e=Hr(e),e.vendor=jr(O.getValue(s,"vendor id")),e.family=O.getValue(s,"cpu family"),e.model=O.getValue(s,"model:"),e.stepping=O.getValue(s,"stepping"),e.revision=O.getValue(s,"cpu revision"),e.cache.l1d=O.getValue(s,"l1d cache"),e.cache.l1d&&(e.cache.l1d=parseInt(e.cache.l1d)*(e.cache.l1d.indexOf("M")!==-1?1024*1024:e.cache.l1d.indexOf("K")!==-1?1024:1)),e.cache.l1i=O.getValue(s,"l1i cache"),e.cache.l1i&&(e.cache.l1i=parseInt(e.cache.l1i)*(e.cache.l1i.indexOf("M")!==-1?1024*1024:e.cache.l1i.indexOf("K")!==-1?1024:1)),e.cache.l2=O.getValue(s,"l2 cache"),e.cache.l2&&(e.cache.l2=parseInt(e.cache.l2)*(e.cache.l2.indexOf("M")!==-1?1024*1024:e.cache.l2.indexOf("K")!==-1?1024:1)),e.cache.l3=O.getValue(s,"l3 cache"),e.cache.l3&&(e.cache.l3=parseInt(e.cache.l3)*(e.cache.l3.indexOf("M")!==-1?1024*1024:e.cache.l3.indexOf("K")!==-1?1024:1));let c=O.getValue(s,"thread(s) per core")||"1",u=O.getValue(s,"socket(s)")||"1",p=parseInt(c,10),d=parseInt(u,10)||1,f=parseInt(O.getValue(s,"core(s) per socket"),10);if(e.physicalCores=f?f*d:e.cores/p,e.performanceCores=p>1?e.cores-e.physicalCores:e.cores,e.efficiencyCores=p>1?e.cores-p*e.performanceCores:0,e.processors=d,e.governor=O.getValue(s,"governor")||"",e.vendor==="ARM"&&O.isRaspberry()){let g=O.decodePiCpuinfo();e.family=e.manufacturer,e.manufacturer=g.manufacturer,e.brand=g.processor,e.revision=g.revisionCode,e.socket="SOC"}if(O.getValue(s,"architecture")==="riscv64"){let g=qr.readFileSync("/proc/cpuinfo").toString().split(`
|
|
112
|
+
`),x=O.getValue(g,"uarch")||"";if(x.indexOf(",")>-1){let h=x.split(",");e.manufacturer=jr(h[0]),e.brand=h[1]}}let m=[];Ie('export LC_ALL=C; dmidecode \u2013t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL',function(g,x){m=x.toString().split(`
|
|
113
|
+
`),m&&m.length&&(e.socket=O.getValue(m,"Upgrade").replace("Socket","").trim()||e.socket),n(e)})})}if(Xr||Zr||Jr){let i="",s=[];Xe.cpus()[0]&&Xe.cpus()[0].model&&(i=Xe.cpus()[0].model),Ie("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL",function(o,a){let l=[];if(!o){let f=a.toString().split("# dmidecode"),m=f.length>1?f[1]:"";l=f.length>2?f[2].split("Cache Information"):[],s=m.split(`
|
|
114
|
+
`)}if(e.brand=i.split("@")[0].trim(),e.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=Gs(e.brand)),e.speed===0){let f=Ws();f.avg!==0&&(e.speed=f.avg)}Vn=e.speed,e.speedMin=e.speed,e.speedMax=Math.round(parseFloat(O.getValue(s,"max speed").replace(/Mhz/g,""))/10)/100,e=Hr(e),e.vendor=jr(O.getValue(s,"manufacturer"));let c=O.getValue(s,"signature");c=c.split(",");for(let f=0;f<c.length;f++)c[f]=c[f].trim();e.family=O.getValue(c,"Family"," ",!0),e.model=O.getValue(c,"Model"," ",!0),e.stepping=O.getValue(c,"Stepping"," ",!0),e.revision="";let u=parseFloat(O.getValue(s,"voltage"));e.voltage=isNaN(u)?"":u.toFixed(2);for(let f=0;f<l.length;f++){s=l[f].split(`
|
|
115
|
+
`);let m=O.getValue(s,"Socket Designation").toLowerCase().replace(" ","-").split("-");m=m.length?m[0]:"";let g=O.getValue(s,"Installed Size").split(" "),x=parseInt(g[0],10),h=g.length>1?g[1]:"kb";x=x*(h==="kb"?1024:h==="mb"?1024*1024:h==="gb"?1024*1024*1024:1),m&&(m==="l1"?(e.cache[m+"d"]=x/2,e.cache[m+"i"]=x/2):e.cache[m]=x)}e.socket=O.getValue(s,"Upgrade").replace("Socket","").trim();let p=O.getValue(s,"thread count").trim(),d=O.getValue(s,"core count").trim();d&&p&&(e.cores=parseInt(p,10),e.physicalCores=parseInt(d,10)),n(e)})}if(Qr&&n(e),Yr)try{let i=[];i.push(O.powerShell("Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl")),i.push(O.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),i.push(O.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),Promise.all(i).then(s=>{let o=s[0].split(`\r
|
|
116
|
+
`),a=O.getValue(o,"name",":")||"";a.indexOf("@")>=0?(e.brand=a.split("@")[0].trim(),e.speed=a.split("@")[1]?parseFloat(a.split("@")[1].trim()):0,Vn=e.speed):(e.brand=a.trim(),e.speed=0),e=Hr(e),e.revision=O.getValue(o,"revision",":"),e.vendor=O.getValue(o,"manufacturer",":"),e.speedMax=Math.round(parseFloat(O.getValue(o,"maxclockspeed",":").replace(/,/g,"."))/10)/100,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=Gs(e.brand)),e.speed===0&&(e.speed=e.speedMax),e.speedMin=e.speed;let l=O.getValue(o,"description",":").split(" ");for(let g=0;g<l.length;g++)l[g].toLowerCase().startsWith("family")&&g+1<l.length&&l[g+1]&&(e.family=l[g+1]),l[g].toLowerCase().startsWith("model")&&g+1<l.length&&l[g+1]&&(e.model=l[g+1]),l[g].toLowerCase().startsWith("stepping")&&g+1<l.length&&l[g+1]&&(e.stepping=l[g+1]);let c=O.getValue(o,"UpgradeMethod",":");ro[c]&&(e.socket=ro[c]);let u=cu(a);u&&(e.socket=u);let p=O.countLines(o,"Caption"),d=O.getValue(o,"NumberOfLogicalProcessors",":"),f=O.getValue(o,"NumberOfCores",":");p&&(e.processors=parseInt(p)||1),f&&d&&(e.cores=parseInt(d)||O.cores(),e.physicalCores=parseInt(f)||O.cores()),p>1&&(e.cores=e.cores*p,e.physicalCores=e.physicalCores*p),e.cache=ao(s[0],s[1]);let m=s[2]?s[2].toString().toLowerCase():"";e.virtualization=m.indexOf("true")!==-1,n(e)})}catch{n(e)}})})})}function pu(n){return new Promise(t=>{process.nextTick(()=>{uu().then(e=>{n&&n(e),t(e)})})})}vt.cpu=pu;function Ws(){let n=Xe.cpus(),t=999999999,e=0,r=0,i=[],s=[];if(n&&n.length&&n[0].speed)for(let o in n)s.push(n[o].speed>100?(n[o].speed+1)/1e3:n[o].speed/10);else if(kn)try{let o=Kr('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3',O.execOptsLinux).toString().split(`
|
|
117
|
+
`).filter(a=>a.length>0);for(let a in o)s.push(Math.floor(parseInt(o[a],10)/10)/100)}catch{O.noop()}if(s&&s.length){for(let o in s)r=r+s[o],s[o]>e&&(e=s[o]),s[o]<t&&(t=s[o]),i.push(parseFloat(s[o].toFixed(2)));return r=r/s.length,{min:parseFloat(t.toFixed(2)),max:parseFloat(e.toFixed(2)),avg:parseFloat(r.toFixed(2)),cores:i}}else return{min:0,max:0,avg:0,cores:i}}function du(n){return new Promise(t=>{process.nextTick(()=>{let e=Ws();if(e.avg===0&&Vn!==0){let r=parseFloat(Vn);e={min:r,max:r,avg:r,cores:[]}}n&&n(e),t(e)})})}vt.cpuCurrentSpeed=du;function fu(n){return new Promise(t=>{process.nextTick(()=>{let e={main:null,cores:[],max:null,socket:[],chipset:null};if(kn){try{let s=Kr('cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;',O.execOptsLinux).toString().split(`-----
|
|
118
|
+
`);if(s.length===2){let o=s[0].split(`
|
|
119
|
+
`),a=s[1].split(`
|
|
120
|
+
`);for(let l=0;l<o.length;l++){let c=o[l].trim();c.startsWith("acpi")&&a[l]&&e.socket.push(Math.round(parseInt(a[l],10)/100)/10),c.startsWith("pch")&&a[l]&&(e.chipset=Math.round(parseInt(a[l],10)/100)/10)}}}catch{O.noop()}let r='for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';try{Ie(r,function(i,s){s=s.toString();let o=s.toLowerCase().indexOf("tdie");o!==-1&&(s=s.substring(o));let a=s.split(`
|
|
121
|
+
`),l=0;if(a.forEach(c=>{let u=c.split("___"),p=u[0],d=u.length>1&&u[1]?u[1]:"0";d&&p&&p.toLowerCase()==="tctl"&&(l=e.main=Math.round(parseInt(d,10)/100)/10),d&&(p===void 0||p&&p.toLowerCase().startsWith("core"))?e.cores.push(Math.round(parseInt(d,10)/100)/10):d&&p&&e.main===null&&(p.toLowerCase().indexOf("package")>=0||p.toLowerCase().indexOf("physical")>=0||p.toLowerCase()==="tccd1")&&(e.main=Math.round(parseInt(d,10)/100)/10)}),l&&e.main===null&&(e.main=l),e.cores.length>0){e.main===null&&(e.main=Math.round(e.cores.reduce((u,p)=>u+p,0)/e.cores.length));let c=Math.max.apply(Math,e.cores);e.max=c>e.main?c:e.main}if(e.main!==null){e.max===null&&(e.max=e.main),n&&n(e),t(e);return}Ie("sensors",function(c,u){if(!c){let p=u.toString().split(`
|
|
122
|
+
`),d=null,f=!0,m="";if(p.forEach(function(g){g.trim()===""?f=!0:f&&(g.trim().toLowerCase().startsWith("acpi")&&(m="acpi"),g.trim().toLowerCase().startsWith("pch")&&(m="pch"),g.trim().toLowerCase().startsWith("core")&&(m="core"),f=!1);let x=/[+-]([^°]*)/g,h=g.match(x),y=g.split(":")[0].toUpperCase();m==="acpi"?y.indexOf("TEMP")!==-1&&e.socket.push(parseFloat(h)):m==="pch"&&y.indexOf("TEMP")!==-1&&!e.chipset&&(e.chipset=parseFloat(h)),(y.indexOf("PHYSICAL")!==-1||y.indexOf("PACKAGE")!==-1)&&(e.main=parseFloat(h)),y.indexOf("CORE ")!==-1&&e.cores.push(parseFloat(h)),y.indexOf("TDIE")!==-1&&d===null&&(d=parseFloat(h))}),e.cores.length>0){e.main=Math.round(e.cores.reduce((x,h)=>x+h,0)/e.cores.length);let g=Math.max.apply(Math,e.cores);e.max=g>e.main?g:e.main}else e.main===null&&d!==null&&(e.main=d,e.max=d);if(e.main!==null||e.max!==null){n&&n(e),t(e);return}}qr.stat("/sys/class/thermal/thermal_zone0/temp",function(p){p===null?qr.readFile("/sys/class/thermal/thermal_zone0/temp",function(d,f){if(!d){let m=f.toString().split(`
|
|
123
|
+
`);m.length>0&&(e.main=parseFloat(m[0])/1e3,e.max=e.main)}n&&n(e),t(e)}):Ie("/opt/vc/bin/vcgencmd measure_temp",function(d,f){if(!d){let m=f.toString().split(`
|
|
124
|
+
`);m.length>0&&m[0].indexOf("=")&&(e.main=parseFloat(m[0].split("=")[1]),e.max=e.main)}n&&n(e),t(e)})})})})}catch{n&&n(e),t(e)}}if((Xr||Zr||Jr)&&Ie("sysctl dev.cpu | grep temp",function(r,i){if(!r){let s=i.toString().split(`
|
|
125
|
+
`),o=0;s.forEach(function(a){let l=a.split(":");if(l.length>1){let c=parseFloat(l[1].replace(",","."));c>e.max&&(e.max=c),o=o+c,e.cores.push(c)}}),e.cores.length&&(e.main=Math.round(o/e.cores.length*100)/100)}n&&n(e),t(e)}),$r){let r=null;try{r=require("osx-temperature-sensor")}catch{r=null}if(r&&(e=r.cpuTemperature(),e.main&&(e.main=Math.round(e.main*100)/100),e.max&&(e.max=Math.round(e.max*100)/100),e.cores&&e.cores.length))for(let i=0;i<e.cores.length;i++)e.cores[i]=Math.round(e.cores[i]*100)/100;n&&n(e),t(e)}if(Qr&&(n&&n(e),t(e)),Yr)try{O.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then((r,i)=>{if(!i){let s=0;r.split(`\r
|
|
126
|
+
`).filter(a=>a.trim()!=="").filter((a,l)=>l>0).forEach(function(a){let l=(parseInt(a,10)-2732)/10;isNaN(l)||(s=s+l,l>e.max&&(e.max=l),e.cores.push(l))}),e.cores.length&&(e.main=s/e.cores.length)}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}vt.cpuTemperature=fu;function io(n){return new Promise(t=>{process.nextTick(()=>{let e="";if(Yr)try{Ie('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet',O.execOptsWin,function(r,i){if(!r){let s=i.split("0x").pop().trim(),o=parseInt(s,16).toString(2),a="0".repeat(32-o.length)+o,l=["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","","sep","mtrr","pge","mca","cmov","pat","pse-36","psn","clfsh","","ds","acpi","mmx","fxsr","sse","sse2","ss","htt","tm","ia64","pbe"];for(let c=0;c<l.length;c++)a[c]==="1"&&l[c]!==""&&(e+=" "+l[c]);e=e.trim().toLowerCase()}n&&n(e),t(e)})}catch{n&&n(e),t(e)}if(kn)try{Ie("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
|
|
127
|
+
`).forEach(function(o){o.split(":")[0].toUpperCase().indexOf("FLAGS")!==-1&&(e=o.split(":")[1].trim().toLowerCase())}),e?(n&&n(e),t(e)):qr.readFile("/proc/cpuinfo",function(s,o){if(!s){let a=o.toString().split(`
|
|
128
|
+
`);e=O.getValue(a,"features",":",!0).toLowerCase()}n&&n(e),t(e)})})}catch{n&&n(e),t(e)}(Xr||Zr||Jr)&&Ie("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL",function(r,i){let s=[];if(!r){let o=i.toString().split(" Flags:");(o.length>1?o[1].split(" Version:")[0].split(`
|
|
129
|
+
`):[]).forEach(function(l){let c=(l.indexOf("(")?l.split("(")[0].toLowerCase():"").trim().replace(/\t/g,"");c&&s.push(c)})}e=s.join(" ").trim().toLowerCase(),n&&n(e),t(e)}),$r&&Ie("sysctl machdep.cpu.features",function(r,i){if(!r){let s=i.toString().split(`
|
|
130
|
+
`);s.length>0&&s[0].indexOf("machdep.cpu.features:")!==-1&&(e=s[0].split(":")[1].trim().toLowerCase())}n&&n(e),t(e)}),Qr&&(n&&n(e),t(e))})})}vt.cpuFlags=io;function oo(n){return new Promise(t=>{process.nextTick(()=>{let e={l1d:null,l1i:null,l2:null,l3:null};if(kn)try{Ie("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
|
|
131
|
+
`).forEach(function(o){let a=o.split(":");a[0].toUpperCase().indexOf("L1D CACHE")!==-1&&(e.l1d=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L1I CACHE")!==-1&&(e.l1i=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L2 CACHE")!==-1&&(e.l2=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L3 CACHE")!==-1&&(e.l3=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1))}),n&&n(e),t(e)})}catch{n&&n(e),t(e)}if((Xr||Zr||Jr)&&Ie("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL",function(r,i){let s=[];r||(s=i.toString().split("Cache Information"),s.shift());for(let o=0;o<s.length;o++){let a=s[o].split(`
|
|
132
|
+
`),l=O.getValue(a,"Socket Designation").toLowerCase().replace(" ","-").split("-");l=l.length?l[0]:"";let c=O.getValue(a,"Installed Size").split(" "),u=parseInt(c[0],10),p=c.length>1?c[1]:"kb";u=u*(p==="kb"?1024:p==="mb"?1024*1024:p==="gb"?1024*1024*1024:1),l&&(l==="l1"?(e.cache[l+"d"]=u/2,e.cache[l+"i"]=u/2):e.cache[l]=u)}n&&n(e),t(e)}),$r&&Ie("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize",function(r,i){r||i.toString().split(`
|
|
133
|
+
`).forEach(function(o){let a=o.split(":");a[0].toLowerCase().indexOf("hw.l1icachesize")!==-1&&(e.l1d=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l1dcachesize")!==-1&&(e.l1i=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l2cachesize")!==-1&&(e.l2=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l3cachesize")!==-1&&(e.l3=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1))}),n&&n(e),t(e)}),Qr&&(n&&n(e),t(e)),Yr)try{let r=[];r.push(O.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")),r.push(O.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),Promise.all(r).then(i=>{e=ao(i[0],i[1]),n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}function ao(n,t){let e={l1d:null,l1i:null,l2:null,l3:null},r=n.split(`\r
|
|
134
|
+
`);e.l1d=0,e.l1i=0,e.l2=O.getValue(r,"l2cachesize",":"),e.l3=O.getValue(r,"l3cachesize",":"),e.l2?e.l2=parseInt(e.l2,10)*1024:e.l2=0,e.l3?e.l3=parseInt(e.l3,10)*1024:e.l3=0;let i=t.split(/\n\s*\n/),s=0,o=0,a=0;return i.forEach(function(l){let c=l.split(`\r
|
|
135
|
+
`),u=O.getValue(c,"CacheType"),p=O.getValue(c,"Level"),d=O.getValue(c,"InstalledSize");p==="3"&&u==="3"&&(e.l1i=e.l1i+parseInt(d,10)*1024),p==="3"&&u==="4"&&(e.l1d=e.l1d+parseInt(d,10)*1024),p==="3"&&u==="5"&&(s=parseInt(d,10)/2,o=parseInt(d,10)/2),p==="4"&&u==="5"&&(a=a+parseInt(d,10)*1024)}),!e.l1i&&!e.l1d&&(e.l1i=s,e.l1d=o),a&&(e.l2=a),e}vt.cpuCache=oo;function mu(){return new Promise(n=>{process.nextTick(()=>{let t=Xe.loadavg().map(function(s){return s/O.cores()}),e=parseFloat(Math.max.apply(Math,t).toFixed(2)),r={};if(Date.now()-Z.ms>=200){Z.ms=Date.now();let s=Xe.cpus().map(function(h){return h.times.steal=0,h.times.guest=0,h}),o=0,a=0,l=0,c=0,u=0,p=0,d=0,f=[];if(Rs=s&&s.length?s.length:0,kn)try{let h=Kr("cat /proc/stat 2>/dev/null | grep cpu",O.execOptsLinux).toString().split(`
|
|
136
|
+
`);if(h.length>1&&(h.shift(),h.length===s.length))for(let y=0;y<h.length;y++){let S=h[y].split(" ");if(S.length>=10){let _=parseFloat(S[8])||0,C=parseFloat(S[9])||0;s[y].times.steal=_,s[y].times.guest=C}}}catch{O.noop()}for(let h=0;h<Rs;h++){let y=s[h].times;o+=y.user,a+=y.sys,l+=y.nice,u+=y.idle,c+=y.irq,p+=y.steal||0,d+=y.guest||0;let S=w&&w[h]&&w[h].totalTick?w[h].totalTick:0,_=w&&w[h]&&w[h].totalLoad?w[h].totalLoad:0,C=w&&w[h]&&w[h].user?w[h].user:0,D=w&&w[h]&&w[h].sys?w[h].sys:0,T=w&&w[h]&&w[h].nice?w[h].nice:0,Q=w&&w[h]&&w[h].idle?w[h].idle:0,E=w&&w[h]&&w[h].irq?w[h].irq:0,J=w&&w[h]&&w[h].steal?w[h].steal:0,U=w&&w[h]&&w[h].guest?w[h].guest:0;w[h]=y,w[h].totalTick=w[h].user+w[h].sys+w[h].nice+w[h].irq+w[h].steal+w[h].guest+w[h].idle,w[h].totalLoad=w[h].user+w[h].sys+w[h].nice+w[h].irq+w[h].steal+w[h].guest,w[h].currentTick=w[h].totalTick-S,w[h].load=w[h].totalLoad-_,w[h].loadUser=w[h].user-C,w[h].loadSystem=w[h].sys-D,w[h].loadNice=w[h].nice-T,w[h].loadIdle=w[h].idle-Q,w[h].loadIrq=w[h].irq-E,w[h].loadSteal=w[h].steal-J,w[h].loadGuest=w[h].guest-U,f[h]={},f[h].load=w[h].load/w[h].currentTick*100,f[h].loadUser=w[h].loadUser/w[h].currentTick*100,f[h].loadSystem=w[h].loadSystem/w[h].currentTick*100,f[h].loadNice=w[h].loadNice/w[h].currentTick*100,f[h].loadIdle=w[h].loadIdle/w[h].currentTick*100,f[h].loadIrq=w[h].loadIrq/w[h].currentTick*100,f[h].loadSteal=w[h].loadSteal/w[h].currentTick*100,f[h].loadGuest=w[h].loadGuest/w[h].currentTick*100,f[h].rawLoad=w[h].load,f[h].rawLoadUser=w[h].loadUser,f[h].rawLoadSystem=w[h].loadSystem,f[h].rawLoadNice=w[h].loadNice,f[h].rawLoadIdle=w[h].loadIdle,f[h].rawLoadIrq=w[h].loadIrq,f[h].rawLoadSteal=w[h].loadSteal,f[h].rawLoadGuest=w[h].loadGuest}let m=o+a+l+c+p+d+u,g=o+a+l+c+p+d,x=m-Z.tick;r={avgLoad:e,currentLoad:(g-Z.load)/x*100,currentLoadUser:(o-Z.user)/x*100,currentLoadSystem:(a-Z.system)/x*100,currentLoadNice:(l-Z.nice)/x*100,currentLoadIdle:(u-Z.idle)/x*100,currentLoadIrq:(c-Z.irq)/x*100,currentLoadSteal:(p-Z.steal)/x*100,currentLoadGuest:(d-Z.guest)/x*100,rawCurrentLoad:g-Z.load,rawCurrentLoadUser:o-Z.user,rawCurrentLoadSystem:a-Z.system,rawCurrentLoadNice:l-Z.nice,rawCurrentLoadIdle:u-Z.idle,rawCurrentLoadIrq:c-Z.irq,rawCurrentLoadSteal:p-Z.steal,rawCurrentLoadGuest:d-Z.guest,cpus:f},Z={user:o,nice:l,system:a,idle:u,irq:c,steal:p,guest:d,tick:m,load:g,ms:Z.ms,currentLoad:r.currentLoad,currentLoadUser:r.currentLoadUser,currentLoadSystem:r.currentLoadSystem,currentLoadNice:r.currentLoadNice,currentLoadIdle:r.currentLoadIdle,currentLoadIrq:r.currentLoadIrq,currentLoadSteal:r.currentLoadSteal,currentLoadGuest:r.currentLoadGuest,rawCurrentLoad:r.rawCurrentLoad,rawCurrentLoadUser:r.rawCurrentLoadUser,rawCurrentLoadSystem:r.rawCurrentLoadSystem,rawCurrentLoadNice:r.rawCurrentLoadNice,rawCurrentLoadIdle:r.rawCurrentLoadIdle,rawCurrentLoadIrq:r.rawCurrentLoadIrq,rawCurrentLoadSteal:r.rawCurrentLoadSteal,rawCurrentLoadGuest:r.rawCurrentLoadGuest}}else{let s=[];for(let o=0;o<Rs;o++)s[o]={},s[o].load=w[o].load/w[o].currentTick*100,s[o].loadUser=w[o].loadUser/w[o].currentTick*100,s[o].loadSystem=w[o].loadSystem/w[o].currentTick*100,s[o].loadNice=w[o].loadNice/w[o].currentTick*100,s[o].loadIdle=w[o].loadIdle/w[o].currentTick*100,s[o].loadIrq=w[o].loadIrq/w[o].currentTick*100,s[o].rawLoad=w[o].load,s[o].rawLoadUser=w[o].loadUser,s[o].rawLoadSystem=w[o].loadSystem,s[o].rawLoadNice=w[o].loadNice,s[o].rawLoadIdle=w[o].loadIdle,s[o].rawLoadIrq=w[o].loadIrq,s[o].rawLoadSteal=w[o].loadSteal,s[o].rawLoadGuest=w[o].loadGuest;r={avgLoad:e,currentLoad:Z.currentLoad,currentLoadUser:Z.currentLoadUser,currentLoadSystem:Z.currentLoadSystem,currentLoadNice:Z.currentLoadNice,currentLoadIdle:Z.currentLoadIdle,currentLoadIrq:Z.currentLoadIrq,currentLoadSteal:Z.currentLoadSteal,currentLoadGuest:Z.currentLoadGuest,rawCurrentLoad:Z.rawCurrentLoad,rawCurrentLoadUser:Z.rawCurrentLoadUser,rawCurrentLoadSystem:Z.rawCurrentLoadSystem,rawCurrentLoadNice:Z.rawCurrentLoadNice,rawCurrentLoadIdle:Z.rawCurrentLoadIdle,rawCurrentLoadIrq:Z.rawCurrentLoadIrq,rawCurrentLoadSteal:Z.rawCurrentLoadSteal,rawCurrentLoadGuest:Z.rawCurrentLoadGuest,cpus:s}}n(r)})})}function hu(n){return new Promise(t=>{process.nextTick(()=>{mu().then(e=>{n&&n(e),t(e)})})})}vt.currentLoad=hu;function gu(){return new Promise(n=>{process.nextTick(()=>{let t=Xe.cpus(),e=0,r=0,i=0,s=0,o=0,a=0;if(t&&t.length){for(let c=0,u=t.length;c<u;c++){let p=t[c].times;e+=p.user,r+=p.sys,i+=p.nice,s+=p.irq,o+=p.idle}let l=o+s+i+r+e;a=(l-o)/l*100}n(a)})})}function yu(n){return new Promise(t=>{process.nextTick(()=>{gu().then(e=>{n&&n(e),t(e)})})})}vt.fullLoad=yu});var So=oe(Us=>{"use strict";var Qe=require("os"),lr=require("child_process").exec,es=require("child_process").execSync,M=ue(),xu=require("fs"),wt=process.platform,po=wt==="linux"||wt==="android",fo=wt==="darwin",mo=wt==="win32",ho=wt==="freebsd",go=wt==="openbsd",yo=wt==="netbsd",xo=wt==="sunos",co={"0x014F":"Transcend Information","0x2C00":"Micron Technology Inc.","0x802C":"Micron Technology Inc.","0x80AD":"Hynix Semiconductor Inc.","0x80CE":"Samsung Electronics Inc.","0xAD00":"Hynix Semiconductor Inc.","0xCE00":"Samsung Electronics Inc.","0x02FE":"Elpida","0x5105":"Qimonda AG i. In.","0x8551":"Qimonda AG i. In.","0x859B":"Crucial","0x04CD":"G-Skill"},uo={"017A":"Apacer","0198":"HyperX","029E":"Corsair","04CB":"A-DATA","04CD":"G-Skill","059B":"Crucial","00CE":"Samsung",1315:"Crucial","014F":"Transcend Information","2C00":"Micron Technology Inc.","802C":"Micron Technology Inc.","80AD":"Hynix Semiconductor Inc.","80CE":"Samsung Electronics Inc.",AD00:"Hynix Semiconductor Inc.",CE00:"Samsung Electronics Inc.","02FE":"Elpida",5105:"Qimonda AG i. In.",8551:"Qimonda AG i. In.","859B":"Crucial"};function Su(n){return new Promise(t=>{process.nextTick(()=>{let e={total:Qe.totalmem(),free:Qe.freemem(),used:Qe.totalmem()-Qe.freemem(),active:Qe.totalmem()-Qe.freemem(),available:Qe.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0,writeback:null,dirty:null};if(po)try{xu.readFile("/proc/meminfo",function(r,i){if(!r){let s=i.toString().split(`
|
|
137
|
+
`);e.total=parseInt(M.getValue(s,"memtotal"),10),e.total=e.total?e.total*1024:Qe.totalmem(),e.free=parseInt(M.getValue(s,"memfree"),10),e.free=e.free?e.free*1024:Qe.freemem(),e.used=e.total-e.free,e.buffers=parseInt(M.getValue(s,"buffers"),10),e.buffers=e.buffers?e.buffers*1024:0,e.cached=parseInt(M.getValue(s,"cached"),10),e.cached=e.cached?e.cached*1024:0,e.slab=parseInt(M.getValue(s,"slab"),10),e.slab=e.slab?e.slab*1024:0,e.buffcache=e.buffers+e.cached+e.slab;let o=parseInt(M.getValue(s,"memavailable"),10);e.available=o?o*1024:e.free+e.buffcache,e.active=e.total-e.available,e.swaptotal=parseInt(M.getValue(s,"swaptotal"),10),e.swaptotal=e.swaptotal?e.swaptotal*1024:0,e.swapfree=parseInt(M.getValue(s,"swapfree"),10),e.swapfree=e.swapfree?e.swapfree*1024:0,e.swapused=e.swaptotal-e.swapfree,e.writeback=parseInt(M.getValue(s,"writeback"),10),e.writeback=e.writeback?e.writeback*1024:0,e.dirty=parseInt(M.getValue(s,"dirty"),10),e.dirty=e.dirty?e.dirty*1024:0}n&&n(e),t(e)})}catch{n&&n(e),t(e)}if(ho||go||yo)try{lr("/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size",function(r,i){if(!r){let s=i.toString().split(`
|
|
138
|
+
`),o=parseInt(M.getValue(s,"vm.stats.vm.v_page_size"),10),a=parseInt(M.getValue(s,"vm.stats.vm.v_inactive_count"),10)*o,l=parseInt(M.getValue(s,"vm.stats.vm.v_cache_count"),10)*o;e.total=parseInt(M.getValue(s,"hw.realmem"),10),isNaN(e.total)&&(e.total=parseInt(M.getValue(s,"hw.physmem"),10)),e.free=parseInt(M.getValue(s,"vm.stats.vm.v_free_count"),10)*o,e.buffcache=a+l,e.available=e.buffcache+e.free,e.active=e.total-e.free-e.buffcache,e.swaptotal=0,e.swapfree=0,e.swapused=0}n&&n(e),t(e)})}catch{n&&n(e),t(e)}if(xo&&(n&&n(e),t(e)),fo){let r=4096;try{r=M.toInt(es("sysctl -n vm.pagesize").toString())||r}catch{M.noop()}try{lr('vm_stat 2>/dev/null | grep "Pages active"',function(i,s){if(!i){let o=s.toString().split(`
|
|
134
139
|
`);e.active=parseInt(o[0].split(":")[1],10)*r,e.buffcache=e.used-e.active,e.available=e.free+e.buffcache}lr("sysctl -n vm.swapusage 2>/dev/null",function(o,a){if(!o){let l=a.toString().split(`
|
|
135
|
-
`);l.length>0&&l[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach(p=>{p.toLowerCase().indexOf("total")!==-1&&(e.swaptotal=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("used")!==-1&&(e.swapused=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("free")!==-1&&(e.swapfree=parseFloat(p.split("=")[1].trim())*1024*1024)})}
|
|
136
|
-
`).filter(l=>l.trim()!=="").filter((l,c)=>c>0).forEach(function(l){l!==""&&(l=l.trim().split(/\s\s+/),r=r+(parseInt(l[0],10)||0),i=i+(parseInt(l[1],10)||0))}),e.swaptotal=r*1024*1024,e.swapused=i*1024*1024,e.swapfree=e.swaptotal-e.swapused,
|
|
137
|
-
`),u=
|
|
138
|
-
`),c=
|
|
139
|
-
`);let
|
|
140
|
-
`);let d=parseFloat(
|
|
141
|
-
`),l=
|
|
142
|
-
`),
|
|
143
|
-
`),l=parseInt(
|
|
144
|
-
`),
|
|
145
|
-
`);e.isCharging=
|
|
146
|
-
`),o=parseInt("0"+
|
|
147
|
-
`);e.cycleCount=parseInt("0"+
|
|
140
|
+
`);l.length>0&&l[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach(p=>{p.toLowerCase().indexOf("total")!==-1&&(e.swaptotal=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("used")!==-1&&(e.swapused=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("free")!==-1&&(e.swapfree=parseFloat(p.split("=")[1].trim())*1024*1024)})}n&&n(e),t(e)})})}catch{n&&n(e),t(e)}}if(mo){let r=0,i=0;try{M.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then((s,o)=>{o||s.split(`\r
|
|
141
|
+
`).filter(l=>l.trim()!=="").filter((l,c)=>c>0).forEach(function(l){l!==""&&(l=l.trim().split(/\s\s+/),r=r+(parseInt(l[0],10)||0),i=i+(parseInt(l[1],10)||0))}),e.swaptotal=r*1024*1024,e.swapused=i*1024*1024,e.swapfree=e.swaptotal-e.swapused,n&&n(e),t(e)})}catch{n&&n(e),t(e)}}})})}Us.mem=Su;function _u(n){function t(r){return{}.hasOwnProperty.call(co,r)?co[r]:r}function e(r){let i=r.replace("0x","").toUpperCase();return i.length===4&&{}.hasOwnProperty.call(uo,i)?uo[i]:r}return new Promise(r=>{process.nextTick(()=>{let i=[];if((po||ho||go||yo)&&lr('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',function(s,o){if(!s){let a=o.toString().split("Memory Device");a.shift(),a.forEach(function(l){let c=l.split(`
|
|
142
|
+
`),u=M.getValue(c,"Size"),p=u.indexOf("GB")>=0?parseInt(u,10)*1024*1024*1024:parseInt(u,10)*1024*1024,d=M.getValue(c,"Bank Locator");if(d.toLowerCase().indexOf("bad")>=0&&(d=""),parseInt(M.getValue(c,"Size"),10)>0){let f=M.toInt(M.getValue(c,"Total Width")),m=M.toInt(M.getValue(c,"Data Width"));i.push({size:p,bank:d,type:M.getValue(c,"Type:"),ecc:m&&f?f>m:!1,clockSpeed:M.getValue(c,"Configured Clock Speed:")?parseInt(M.getValue(c,"Configured Clock Speed:"),10):M.getValue(c,"Speed:")?parseInt(M.getValue(c,"Speed:"),10):null,formFactor:M.getValue(c,"Form Factor:"),manufacturer:e(M.getValue(c,"Manufacturer:")),partNum:M.getValue(c,"Part Number:"),serialNum:M.getValue(c,"Serial Number:"),voltageConfigured:parseFloat(M.getValue(c,"Configured Voltage:"))||null,voltageMin:parseFloat(M.getValue(c,"Minimum Voltage:"))||null,voltageMax:parseFloat(M.getValue(c,"Maximum Voltage:"))||null})}else i.push({size:0,bank:d,type:"Empty",ecc:null,clockSpeed:0,formFactor:M.getValue(c,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){i.push({size:Qe.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let a=es("cat /proc/cpuinfo 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
143
|
+
`),c=M.getValue(l,"revision",":",!0).toLowerCase();if(M.isRaspberry(l)){let u={0:400,1:450,2:450,3:3200,4:4267};i[0].type="LPDDR2",i[0].type=c&&c[2]&&c[2]==="3"?"LPDDR4":i[0].type,i[0].type=c&&c[2]&&c[2]==="4"?"LPDDR4X":i[0].type,i[0].ecc=!1,i[0].clockSpeed=c&&c[2]&&u[c[2]]||400,i[0].clockSpeed=c&&c[4]&&c[4]==="d"?500:i[0].clockSpeed,i[0].formFactor="SoC",a=es("vcgencmd get_config sdram_freq 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
144
|
+
`);let p=parseInt(M.getValue(l,"sdram_freq","=",!0),10)||0;p&&(i[0].clockSpeed=p),a=es("vcgencmd measure_volts sdram_p 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
145
|
+
`);let d=parseFloat(M.getValue(l,"volt","=",!0))||0;d&&(i[0].voltageConfigured=d,i[0].voltageMin=d,i[0].voltageMax=d)}}catch{M.noop()}}n&&n(i),r(i)}),fo&&lr("system_profiler SPMemoryDataType",function(s,o){if(!s){let a=o.toString().split(`
|
|
146
|
+
`),l=M.getValue(a,"ecc",":",!0).toLowerCase(),c=o.toString().split(" BANK "),u=!0;c.length===1&&(c=o.toString().split(" DIMM"),u=!1),c.shift(),c.forEach(function(p){let d=p.split(`
|
|
147
|
+
`),f=(u?"BANK ":"DIMM")+d[0].trim().split("/")[0],m=parseInt(M.getValue(d," Size"));m?i.push({size:m*1024*1024*1024,bank:f,type:M.getValue(d," Type:"),ecc:l?l==="enabled":null,clockSpeed:parseInt(M.getValue(d," Speed:"),10),formFactor:"",manufacturer:t(M.getValue(d," Manufacturer:")),partNum:M.getValue(d," Part Number:"),serialNum:M.getValue(d," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):i.push({size:0,bank:f,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){let a=o.toString().split(`
|
|
148
|
+
`),l=parseInt(M.getValue(a," Memory:")),c=M.getValue(a," Type:"),u=M.getValue(a," Manufacturer:");l&&c&&i.push({size:l*1024*1024*1024,bank:"0",type:c,ecc:!1,clockSpeed:null,formFactor:"SOC",manufacturer:t(u),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}n&&n(i),r(i)}),xo&&(n&&n(i),r(i)),mo){let s="Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"),o="Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");try{M.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl").then((a,l)=>{if(!l){let c=a.toString().split(/\n\s*\n/);c.shift(),c.forEach(function(u){let p=u.split(`\r
|
|
149
|
+
`),d=M.toInt(M.getValue(p,"DataWidth",":")),f=M.toInt(M.getValue(p,"TotalWidth",":")),m=parseInt(M.getValue(p,"Capacity",":"),10)||0,g=M.getValue(p,"Tag",":"),x=M.splitByNumber(g);m&&i.push({size:m,bank:M.getValue(p,"BankLabel",":")+(x[1]?"/"+x[1]:""),type:s[parseInt(M.getValue(p,"MemoryType",":"),10)||parseInt(M.getValue(p,"SMBIOSMemoryType",":"),10)],ecc:d&&f?f>d:!1,clockSpeed:parseInt(M.getValue(p,"ConfiguredClockSpeed",":"),10)||parseInt(M.getValue(p,"Speed",":"),10)||0,formFactor:o[parseInt(M.getValue(p,"FormFactor",":"),10)||0],manufacturer:M.getValue(p,"Manufacturer",":"),partNum:M.getValue(p,"PartNumber",":"),serialNum:M.getValue(p,"SerialNumber",":"),voltageConfigured:(parseInt(M.getValue(p,"ConfiguredVoltage",":"),10)||0)/1e3,voltageMin:(parseInt(M.getValue(p,"MinVoltage",":"),10)||0)/1e3,voltageMax:(parseInt(M.getValue(p,"MaxVoltage",":"),10)||0)/1e3})})}n&&n(i),r(i)})}catch{n&&n(i),r(i)}}})})}Us.memLayout=_u});var vo=oe((gf,Co)=>{"use strict";var _o=require("child_process").exec,Bn=require("fs"),q=ue(),It=process.platform,Cu=It==="linux"||It==="android",vu=It==="darwin",wu=It==="win32",Iu=It==="freebsd",Lu=It==="openbsd",Ou=It==="netbsd",Eu=It==="sunos";function Pu(n,t,e){let r={},i=q.getValue(n,"BatteryStatus",":").trim();if(i>=0){let s=i?parseInt(i):0;r.status=s,r.hasBattery=!0,r.maxCapacity=e||parseInt(q.getValue(n,"DesignCapacity",":")||0),r.designedCapacity=parseInt(q.getValue(n,"DesignCapacity",":")||t),r.voltage=parseInt(q.getValue(n,"DesignVoltage",":")||0)/1e3,r.capacityUnit="mWh",r.percent=parseInt(q.getValue(n,"EstimatedChargeRemaining",":")||0),r.currentCapacity=parseInt(r.maxCapacity*r.percent/100),r.isCharging=s>=6&&s<=9||s===11||s!==3&&s!==1&&r.percent<100,r.acConnected=r.isCharging||s===2,r.model=q.getValue(n,"DeviceID",":")}else r.status=-1;return r}Co.exports=function(n){return new Promise(t=>{process.nextTick(()=>{let e={hasBattery:!1,cycleCount:0,isCharging:!1,designedCapacity:0,maxCapacity:0,currentCapacity:0,voltage:0,capacityUnit:"",percent:0,timeRemaining:null,acConnected:!0,type:"",model:"",manufacturer:"",serial:""};if(Cu){let r="";Bn.existsSync("/sys/class/power_supply/BAT1/uevent")?r="/sys/class/power_supply/BAT1/":Bn.existsSync("/sys/class/power_supply/BAT0/uevent")&&(r="/sys/class/power_supply/BAT0/");let i=!1,s="";Bn.existsSync("/sys/class/power_supply/AC/online")?s="/sys/class/power_supply/AC/online":Bn.existsSync("/sys/class/power_supply/AC0/online")&&(s="/sys/class/power_supply/AC0/online"),s&&(i=Bn.readFileSync(s).toString().trim()==="1"),r?Bn.readFile(r+"uevent",function(o,a){if(o)n&&n(e),t(e);else{let l=a.toString().split(`
|
|
150
|
+
`);e.isCharging=q.getValue(l,"POWER_SUPPLY_STATUS","=").toLowerCase()==="charging",e.acConnected=i||e.isCharging,e.voltage=parseInt("0"+q.getValue(l,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,e.capacityUnit=e.voltage?"mWh":"mAh",e.cycleCount=parseInt("0"+q.getValue(l,"POWER_SUPPLY_CYCLE_COUNT","="),10),e.maxCapacity=Math.round(parseInt("0"+q.getValue(l,"POWER_SUPPLY_CHARGE_FULL","=",!0,!0),10)/1e3*(e.voltage||1));let c=parseInt("0"+q.getValue(l,"POWER_SUPPLY_VOLTAGE_MIN_DESIGN","="),10)/1e6;e.designedCapacity=Math.round(parseInt("0"+q.getValue(l,"POWER_SUPPLY_CHARGE_FULL_DESIGN","=",!0,!0),10)/1e3*(c||e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+q.getValue(l,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3*(e.voltage||1)),e.maxCapacity||(e.maxCapacity=parseInt("0"+q.getValue(l,"POWER_SUPPLY_ENERGY_FULL","=",!0,!0),10)/1e3,e.designedCapacity=parseInt("0"+q.getValue(l,"POWER_SUPPLY_ENERGY_FULL_DESIGN","=",!0,!0),10)/1e3|e.maxCapacity,e.currentCapacity=parseInt("0"+q.getValue(l,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);let u=q.getValue(l,"POWER_SUPPLY_CAPACITY","="),p=parseInt("0"+q.getValue(l,"POWER_SUPPLY_ENERGY_NOW","="),10),d=parseInt("0"+q.getValue(l,"POWER_SUPPLY_POWER_NOW","="),10),f=parseInt("0"+q.getValue(l,"POWER_SUPPLY_CURRENT_NOW","="),10),m=parseInt("0"+q.getValue(l,"POWER_SUPPLY_CHARGE_NOW","="),10);e.percent=parseInt("0"+u,10),e.maxCapacity&&e.currentCapacity&&(e.hasBattery=!0,u||(e.percent=100*e.currentCapacity/e.maxCapacity)),e.isCharging&&(e.hasBattery=!0),p&&d?e.timeRemaining=Math.floor(p/d*60):f&&m?e.timeRemaining=Math.floor(m/f*60):f&&e.currentCapacity&&(e.timeRemaining=Math.floor(e.currentCapacity/f*60)),e.type=q.getValue(l,"POWER_SUPPLY_TECHNOLOGY","="),e.model=q.getValue(l,"POWER_SUPPLY_MODEL_NAME","="),e.manufacturer=q.getValue(l,"POWER_SUPPLY_MANUFACTURER","="),e.serial=q.getValue(l,"POWER_SUPPLY_SERIAL_NUMBER","="),n&&n(e),t(e)}}):(n&&n(e),t(e))}if((Iu||Lu||Ou)&&_o("sysctl -i hw.acpi.battery hw.acpi.acline",function(r,i){let s=i.toString().split(`
|
|
151
|
+
`),o=parseInt("0"+q.getValue(s,"hw.acpi.battery.units"),10),a=parseInt("0"+q.getValue(s,"hw.acpi.battery.life"),10);e.hasBattery=o>0,e.cycleCount=null,e.isCharging=q.getValue(s,"hw.acpi.acline")!=="1",e.acConnected=e.isCharging,e.maxCapacity=null,e.currentCapacity=null,e.capacityUnit="unknown",e.percent=o?a:null,n&&n(e),t(e)}),vu&&_o('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %',function(r,i){if(i){let s=i.toString().replace(/ +/g,"").replace(/"+/g,"").replace(/-/g,"").split(`
|
|
152
|
+
`);e.cycleCount=parseInt("0"+q.getValue(s,"cyclecount","="),10),e.voltage=parseInt("0"+q.getValue(s,"voltage","="),10)/1e3,e.capacityUnit=e.voltage?"mWh":"mAh",e.maxCapacity=Math.round(parseInt("0"+q.getValue(s,"applerawmaxcapacity","="),10)*(e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+q.getValue(s,"applerawcurrentcapacity","="),10)*(e.voltage||1)),e.designedCapacity=Math.round(parseInt("0"+q.getValue(s,"DesignCapacity","="),10)*(e.voltage||1)),e.manufacturer="Apple",e.serial=q.getValue(s,"BatterySerialNumber","=")||q.getValue(s,"Serial","="),e.model=q.getValue(s,"DeviceName","=");let o=null,l=q.getValue(s,"internal","Battery").split(";");if(l&&l[0]){let c=l[0].split(" ");c&&c[1]&&(o=parseFloat(c[1].trim().replace(/%/g,"")))}l&&l[1]?(e.isCharging=l[1].trim()==="charging",e.acConnected=l[1].trim()!=="discharging"):(e.isCharging=q.getValue(s,"ischarging","=").toLowerCase()==="yes",e.acConnected=e.isCharging),e.maxCapacity&&e.currentCapacity&&(e.hasBattery=!0,e.type="Li-ion",e.percent=o!==null?o:Math.round(100*e.currentCapacity/e.maxCapacity),e.isCharging||(e.timeRemaining=parseInt("0"+q.getValue(s,"TimeRemaining","="),10)))}n&&n(e),t(e)}),Eu&&(n&&n(e),t(e)),wu)try{let r=[];r.push(q.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")),r.push(q.powerShell("(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")),r.push(q.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")),q.promiseAll(r).then(i=>{if(i){let s=i.results[0].split(/\n\s*\n/),o=[],a=u=>/\S/.test(u);for(let u=0;u<s.length;u++)a(s[u])&&(!o.length||!a(s[u-1]))&&o.push([]),a(s[u])&&o[o.length-1].push(s[u]);let l=i.results[1].split(`\r
|
|
148
153
|
`).filter(u=>u),c=i.results[2].split(`\r
|
|
149
|
-
`).filter(u=>u);if(o.length){let u=!1,p=[];for(let
|
|
150
|
-
`),m=l&&l.length>=
|
|
151
|
-
`);for(let y=0;y<
|
|
152
|
-
`).filter(Boolean).map(
|
|
153
|
-
`);if(
|
|
154
|
-
`);
|
|
155
|
-
`);
|
|
156
|
-
`);T=parseInt(E[0])||0}
|
|
157
|
-
`);
|
|
158
|
-
`),y=
|
|
159
|
-
`),y=
|
|
160
|
-
`);y=
|
|
161
|
-
`),E=
|
|
162
|
-
`),
|
|
163
|
-
`),
|
|
164
|
-
`);if(c.shift(),l.toString().toLowerCase().indexOf("filesystem")){let u=0;for(let p=0;p<c.length;p++)c[p]&&c[p].toLowerCase().startsWith("filesystem")&&(u=p);for(let p=0;p<u;p++)c.shift()}return c}function a(l){let c=[];return l.forEach(function(u){if(u!==""&&(u=u.replace(/ +/g," ").split(" "),u&&(u[0].startsWith("/")||u[6]&&u[6]==="/"||u[0].indexOf("/")>0||u[0].indexOf(":")===1||!
|
|
154
|
+
`).filter(u=>u);if(o.length){let u=!1,p=[];for(let d=0;d<o.length;d++){let f=o[d][0].split(`\r
|
|
155
|
+
`),m=l&&l.length>=d+1&&l[d]?q.toInt(l[d]):0,g=c&&c.length>=d+1&&c[d]?q.toInt(c[d]):0,x=Pu(f,m,g);!u&&x.status>0&&x.status!==10?(e.hasBattery=x.hasBattery,e.maxCapacity=x.maxCapacity,e.designedCapacity=x.designedCapacity,e.voltage=x.voltage,e.capacityUnit=x.capacityUnit,e.percent=x.percent,e.currentCapacity=x.currentCapacity,e.isCharging=x.isCharging,e.acConnected=x.acConnected,e.model=x.model,u=!0):x.status!==-1&&p.push({hasBattery:x.hasBattery,maxCapacity:x.maxCapacity,designedCapacity:x.designedCapacity,voltage:x.voltage,capacityUnit:x.capacityUnit,percent:x.percent,currentCapacity:x.currentCapacity,isCharging:x.isCharging,timeRemaining:null,acConnected:x.acConnected,model:x.model,type:"",manufacturer:"",serial:""})}!u&&p.length&&(e=p[0],p.shift()),p.length&&(e.additionalBatteries=p)}}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}});var Eo=oe(Oo=>{"use strict";var ts=require("fs"),Rn=require("child_process").exec,zs=require("child_process").execSync,V=ue(),Lt=process.platform,cr="",ns=Lt==="linux"||Lt==="android",Au=Lt==="darwin",wo=Lt==="win32",Tu=Lt==="freebsd",Mu=Lt==="openbsd",bu=Lt==="netbsd",Du=Lt==="sunos",ur=0,pr=0,rs=0,ss=0,Io={"-2":"UNINITIALIZED","-1":"OTHER",0:"HD15",1:"SVIDEO",2:"Composite video",3:"Component video",4:"DVI",5:"HDMI",6:"LVDS",8:"D_JPN",9:"SDI",10:"DP",11:"DP embedded",12:"UDI",13:"UDI embedded",14:"SDTVDONGLE",15:"MIRACAST","2147483648":"INTERNAL"};function Lo(n){let t=[{pattern:"^LG.+",manufacturer:"LG"},{pattern:"^BENQ.+",manufacturer:"BenQ"},{pattern:"^ASUS.+",manufacturer:"Asus"},{pattern:"^DELL.+",manufacturer:"Dell"},{pattern:"^SAMSUNG.+",manufacturer:"Samsung"},{pattern:"^VIEWSON.+",manufacturer:"ViewSonic"},{pattern:"^SONY.+",manufacturer:"Sony"},{pattern:"^ACER.+",manufacturer:"Acer"},{pattern:"^AOC.+",manufacturer:"AOC Monitors"},{pattern:"^HP.+",manufacturer:"HP"},{pattern:"^EIZO.?",manufacturer:"Eizo"},{pattern:"^PHILIPS.?",manufacturer:"Philips"},{pattern:"^IIYAMA.?",manufacturer:"Iiyama"},{pattern:"^SHARP.?",manufacturer:"Sharp"},{pattern:"^NEC.?",manufacturer:"NEC"},{pattern:"^LENOVO.?",manufacturer:"Lenovo"},{pattern:"COMPAQ.?",manufacturer:"Compaq"},{pattern:"APPLE.?",manufacturer:"Apple"},{pattern:"INTEL.?",manufacturer:"Intel"},{pattern:"AMD.?",manufacturer:"AMD"},{pattern:"NVIDIA.?",manufacturer:"NVDIA"}],e="";return n&&(n=n.toUpperCase(),t.forEach(r=>{RegExp(r.pattern).test(n)&&(e=r.manufacturer)})),e}function Nu(n){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[n]||""}function Vu(n){let t="";return n=(n||"").toLowerCase(),n.indexOf("apple")>=0?t="0x05ac":n.indexOf("nvidia")>=0?t="0x10de":n.indexOf("intel")>=0?t="0x8086":(n.indexOf("ati")>=0||n.indexOf("amd")>=0)&&(t="0x1002"),t}function ku(n){return{spdisplays_mtlgpufamilymac1:"mac1",spdisplays_mtlgpufamilymac2:"mac2",spdisplays_mtlgpufamilyapple1:"apple1",spdisplays_mtlgpufamilyapple2:"apple2",spdisplays_mtlgpufamilyapple3:"apple3",spdisplays_mtlgpufamilyapple4:"apple4",spdisplays_mtlgpufamilyapple5:"apple5",spdisplays_mtlgpufamilyapple6:"apple6",spdisplays_mtlgpufamilyapple7:"apple7",spdisplays_metalfeaturesetfamily11:"family1_v1",spdisplays_metalfeaturesetfamily12:"family1_v2",spdisplays_metalfeaturesetfamily13:"family1_v3",spdisplays_metalfeaturesetfamily14:"family1_v4",spdisplays_metalfeaturesetfamily21:"family2_v1"}[n]||""}function Bu(n){function t(d){let f={controllers:[],displays:[]};try{return d.forEach(function(m){let g=(m.sppci_bus||"").indexOf("builtin")>-1?"Built-In":(m.sppci_bus||"").indexOf("pcie")>-1?"PCIe":"",x=(parseInt(m.spdisplays_vram||"",10)||0)*((m.spdisplays_vram||"").indexOf("GB")>-1?1024:1),h=(parseInt(m.spdisplays_vram_shared||"",10)||0)*((m.spdisplays_vram_shared||"").indexOf("GB")>-1?1024:1),y=ku(m.spdisplays_metal||m.spdisplays_metalfamily||"");f.controllers.push({vendor:Lo(m.spdisplays_vendor||"")||m.spdisplays_vendor||"",model:m.sppci_model||"",bus:g,vramDynamic:g==="Built-In",vram:x||h||null,deviceId:m["spdisplays_device-id"]||"",vendorId:m["spdisplays_vendor-id"]||Vu((m.spdisplays_vendor||"")+(m.sppci_model||"")),external:m.sppci_device_type==="spdisplays_egpu",cores:m.sppci_cores||null,metalVersion:y}),m.spdisplays_ndrvs&&m.spdisplays_ndrvs.length&&m.spdisplays_ndrvs.forEach(function(S){let _=S.spdisplays_connection_type||"",C=(S._spdisplays_resolution||"").split("@"),D=C[0].split("x"),T=(S._spdisplays_pixels||"").split("x"),Q=S.spdisplays_depth||"",E=S["_spdisplays_display-serial-number"]||S["_spdisplays_display-serial-number2"]||null;f.displays.push({vendor:Nu(S["_spdisplays_display-vendor-id"]||"")||Lo(S._name||""),vendorId:S["_spdisplays_display-vendor-id"]||"",model:S._name||"",productionYear:S["_spdisplays_display-year"]||null,serial:E!=="0"?E:null,displayId:S._spdisplays_displayID||null,main:S.spdisplays_main?S.spdisplays_main==="spdisplays_yes":!1,builtin:(S.spdisplays_display_type||"").indexOf("built-in")>-1,connection:_.indexOf("_internal")>-1?"Internal":_.indexOf("_displayport")>-1?"Display Port":_.indexOf("_hdmi")>-1?"HDMI":null,sizeX:null,sizeY:null,pixelDepth:Q==="CGSThirtyBitColor"?30:Q==="CGSThirtytwoBitColor"?32:Q==="CGSTwentyfourBitColor"?24:null,resolutionX:T.length>1?parseInt(T[0],10):null,resolutionY:T.length>1?parseInt(T[1],10):null,currentResX:D.length>1?parseInt(D[0],10):null,currentResY:D.length>1?parseInt(D[1],10):null,positionX:0,positionY:0,currentRefreshRate:C.length>1?parseInt(C[1],10):null})})}),f}catch{return f}}function e(d){let f=[],m={vendor:"",subVendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1,pciID:""},g=!1,x=[];try{x=zs('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "',V.execOptsLinux).toString().split(`
|
|
156
|
+
`);for(let y=0;y<x.length;y++)x[y]=x[y].replace("Bus Address:","").replace("0000:","").trim();x=x.filter(function(y){return y!=null&&y})}catch{V.noop()}let h=1;return d.forEach(y=>{let S="";if(h<d.length&&d[h]&&(S=d[h],S.indexOf(":")>0&&(S=S.split(":")[1])),y.trim()!==""){if(y[0]!==" "&&y[0]!==" "){let _=x.indexOf(y.split(" ")[0])>=0,C=y.toLowerCase().indexOf(" vga "),D=y.toLowerCase().indexOf("3d controller");if(C!==-1||D!==-1){D!==-1&&C===-1&&(C=D),(m.vendor||m.model||m.bus||m.vram!==null||m.vramDynamic)&&(f.push(m),m={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1});let T=y.split(" ")[0];/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(T)&&(m.busAddress=T),g=!0;let Q=y.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),E=y.substr(C,Q-C).split(":");if(m.busAddress=y.substr(0,C).trim(),E.length>1&&(E[1]=E[1].trim(),E[1].toLowerCase().indexOf("corporation")>=0?(m.vendor=E[1].substr(0,E[1].toLowerCase().indexOf("corporation")+11).trim(),m.model=E[1].substr(E[1].toLowerCase().indexOf("corporation")+11,200).split("(")[0].trim(),m.bus=x.length>0&&_?"PCIe":"Onboard",m.vram=null,m.vramDynamic=!1):E[1].toLowerCase().indexOf(" inc.")>=0?((E[1].match(/]/g)||[]).length>1?(m.vendor=E[1].substr(0,E[1].toLowerCase().indexOf("]")+1).trim(),m.model=E[1].substr(E[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(m.vendor=E[1].substr(0,E[1].toLowerCase().indexOf(" inc.")+5).trim(),m.model=E[1].substr(E[1].toLowerCase().indexOf(" inc.")+5,200).trim().split("(")[0].trim()),m.bus=x.length>0&&_?"PCIe":"Onboard",m.vram=null,m.vramDynamic=!1):E[1].toLowerCase().indexOf(" ltd.")>=0&&((E[1].match(/]/g)||[]).length>1?(m.vendor=E[1].substr(0,E[1].toLowerCase().indexOf("]")+1).trim(),m.model=E[1].substr(E[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(m.vendor=E[1].substr(0,E[1].toLowerCase().indexOf(" ltd.")+5).trim(),m.model=E[1].substr(E[1].toLowerCase().indexOf(" ltd.")+5,200).trim().split("(")[0].trim())),m.model&&S.indexOf(m.model)!==-1)){let J=S.split(m.model)[0].trim();J&&(m.subVendor=J)}}else g=!1}if(g){let _=y.split(":");if(_.length>1&&_[0].replace(/ +/g,"").toLowerCase().indexOf("devicename")!==-1&&_[1].toLowerCase().indexOf("onboard")!==-1&&(m.bus="Onboard"),_.length>1&&_[0].replace(/ +/g,"").toLowerCase().indexOf("region")!==-1&&_[1].toLowerCase().indexOf("memory")!==-1){let C=_[1].split("=");C.length>1&&(m.vram=parseInt(C[1]))}}}h++}),(m.vendor||m.model||m.bus||m.busAddress||m.vram!==null||m.vramDynamic)&&f.push(m),f}function r(d,f){let m=/\[([^\]]+)\]\s+(\w+)\s+(.*)/,g=f.reduce((x,h)=>{let y=m.exec(h.trim());return y&&(x[y[1]]||(x[y[1]]={}),x[y[1]][y[2]]=y[3]),x},{});for(let x in g){let h=g[x];if(h.CL_DEVICE_TYPE==="CL_DEVICE_TYPE_GPU"){let y;if(h.CL_DEVICE_TOPOLOGY_AMD){let S=h.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);S&&(y=S[0])}else if(h.CL_DEVICE_PCI_BUS_ID_NV&&h.CL_DEVICE_PCI_SLOT_ID_NV){let S=parseInt(h.CL_DEVICE_PCI_BUS_ID_NV),_=parseInt(h.CL_DEVICE_PCI_SLOT_ID_NV);if(!isNaN(S)&&!isNaN(_)){let C=S&255,D=_>>3&255,T=_&7;y=`${C.toString().padStart(2,"0")}:${D.toString().padStart(2,"0")}.${T}`}}if(y){let S=d.find(C=>C.busAddress===y);S||(S={vendor:"",model:"",bus:"",busAddress:y,vram:null,vramDynamic:!1},d.push(S)),S.vendor=h.CL_DEVICE_VENDOR,h.CL_DEVICE_BOARD_NAME_AMD?S.model=h.CL_DEVICE_BOARD_NAME_AMD:S.model=h.CL_DEVICE_NAME;let _=parseInt(h.CL_DEVICE_GLOBAL_MEM_SIZE);isNaN(_)||(S.vram=Math.round(_/1024/1024))}}}return d}function i(){if(cr)return cr;if(wo)try{let d=V.WINDIR+"\\System32\\DriverStore\\FileRepository",m=ts.readdirSync(d).filter(g=>ts.readdirSync([d,g].join("/")).includes("nvidia-smi.exe")).reduce((g,x)=>{let h=ts.statSync([d,g,"nvidia-smi.exe"].join("/")),y=ts.statSync([d,x,"nvidia-smi.exe"].join("/"));return h.ctimeMs>y.ctimeMs?g:x});m&&(cr=[d,m,"nvidia-smi.exe"].join("/"))}catch{V.noop()}else ns&&(cr="nvidia-smi");return cr}function s(d){let f=i();if(d=d||V.execOptsWin,f){let g=f+" "+"--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits"+(ns?" 2>/dev/null":"");ns&&(d.stdio=["pipe","pipe","ignore"]);try{return zs(g,d).toString()}catch{V.noop()}}return""}function o(){function d(x){return[null,void 0].includes(x)?x:parseFloat(x)}let f=s();if(!f)return[];let g=f.split(`
|
|
157
|
+
`).filter(Boolean).map(x=>{let h=x.split(", ").map(y=>y.includes("N/A")?void 0:y);return h.length===16?{driverVersion:h[0],subDeviceId:h[1],name:h[2],pciBus:h[3],fanSpeed:d(h[4]),memoryTotal:d(h[5]),memoryUsed:d(h[6]),memoryFree:d(h[7]),utilizationGpu:d(h[8]),utilizationMemory:d(h[9]),temperatureGpu:d(h[10]),temperatureMemory:d(h[11]),powerDraw:d(h[12]),powerLimit:d(h[13]),clockCore:d(h[14]),clockMemory:d(h[15])}:{}});return g=g.filter(x=>"pciBus"in x),g}function a(d,f){return f.driverVersion&&(d.driverVersion=f.driverVersion),f.subDeviceId&&(d.subDeviceId=f.subDeviceId),f.name&&(d.name=f.name),f.pciBus&&(d.pciBus=f.pciBus),f.fanSpeed&&(d.fanSpeed=f.fanSpeed),f.memoryTotal&&(d.memoryTotal=f.memoryTotal,d.vram=f.memoryTotal,d.vramDynamic=!1),f.memoryUsed&&(d.memoryUsed=f.memoryUsed),f.memoryFree&&(d.memoryFree=f.memoryFree),f.utilizationGpu&&(d.utilizationGpu=f.utilizationGpu),f.utilizationMemory&&(d.utilizationMemory=f.utilizationMemory),f.temperatureGpu&&(d.temperatureGpu=f.temperatureGpu),f.temperatureMemory&&(d.temperatureMemory=f.temperatureMemory),f.powerDraw&&(d.powerDraw=f.powerDraw),f.powerLimit&&(d.powerLimit=f.powerLimit),f.clockCore&&(d.clockCore=f.clockCore),f.clockMemory&&(d.clockMemory=f.clockMemory),d}function l(d){let f={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},m=108;if(d.substr(m,6)==="000000"&&(m+=36),d.substr(m,6)==="000000"&&(m+=36),d.substr(m,6)==="000000"&&(m+=36),d.substr(m,6)==="000000"&&(m+=36),f.resolutionX=parseInt("0x0"+d.substr(m+8,1)+d.substr(m+4,2)),f.resolutionY=parseInt("0x0"+d.substr(m+14,1)+d.substr(m+10,2)),f.sizeX=parseInt("0x0"+d.substr(m+28,1)+d.substr(m+24,2)),f.sizeY=parseInt("0x0"+d.substr(m+29,1)+d.substr(m+26,2)),m=d.indexOf("000000fc00"),m>=0){let g=d.substr(m+10,26);g.indexOf("0a")!==-1&&(g=g.substr(0,g.indexOf("0a")));try{g.length>2&&(f.model=g.match(/.{1,2}/g).map(function(x){return String.fromCharCode(parseInt(x,16))}).join(""))}catch{V.noop()}}else f.model="";return f}function c(d,f){let m=[],g={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},x=!1,h=!1,y="",S=0;for(let _=1;_<d.length;_++)if(d[_].trim()!==""){if(d[_][0]!==" "&&d[_][0]!==" "&&d[_].toLowerCase().indexOf(" connected ")!==-1){(g.model||g.main||g.builtin||g.connection||g.sizeX!==null||g.pixelDepth!==null||g.resolutionX!==null)&&(m.push(g),g={vendor:"",model:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null});let C=d[_].split(" ");g.connection=C[0],g.main=d[_].toLowerCase().indexOf(" primary ")>=0,g.builtin=C[0].toLowerCase().indexOf("edp")>=0}if(x)if(d[_].search(/\S|$/)>S)y+=d[_].toLowerCase().trim();else{let C=l(y);g.vendor=C.vendor,g.model=C.model,g.resolutionX=C.resolutionX,g.resolutionY=C.resolutionY,g.sizeX=C.sizeX,g.sizeY=C.sizeY,g.pixelDepth=f,x=!1}if(d[_].toLowerCase().indexOf("edid:")>=0&&(x=!0,S=d[_].search(/\S|$/)),d[_].toLowerCase().indexOf("*current")>=0){let C=d[_].split("(");if(C&&C.length>1&&C[0].indexOf("x")>=0){let D=C[0].trim().split("x");g.currentResX=V.toInt(D[0]),g.currentResY=V.toInt(D[1])}h=!0}if(h&&d[_].toLowerCase().indexOf("clock")>=0&&d[_].toLowerCase().indexOf("hz")>=0&&d[_].toLowerCase().indexOf("v: height")>=0){let C=d[_].split("clock");C&&C.length>1&&C[1].toLowerCase().indexOf("hz")>=0&&(g.currentRefreshRate=V.toInt(C[1])),h=!1}}return(g.model||g.main||g.builtin||g.connection||g.sizeX!==null||g.pixelDepth!==null||g.resolutionX!==null)&&m.push(g),m}return new Promise(d=>{process.nextTick(()=>{let f={controllers:[],displays:[]};if(Au&&Rn("system_profiler -xml -detailLevel full SPDisplaysDataType",function(g,x){if(!g){try{let h=x.toString();f=t(V.plistParser(h)[0]._items)}catch{V.noop()}try{x=zs('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""',{maxBuffer:1024*2e4});let h=(x||"").toString(),y=V.plistReader(h);if(y.DisplayAnyUserSets&&y.DisplayAnyUserSets.Configs&&y.DisplayAnyUserSets.Configs[0]&&y.DisplayAnyUserSets.Configs[0].DisplayConfig){let S=y.DisplayAnyUserSets.Configs[0].DisplayConfig,_=0;S.forEach(C=>{C.CurrentInfo&&C.CurrentInfo.OriginX!==void 0&&f.displays&&f.displays[_]&&(f.displays[_].positionX=C.CurrentInfo.OriginX),C.CurrentInfo&&C.CurrentInfo.OriginY!==void 0&&f.displays&&f.displays[_]&&(f.displays[_].positionY=C.CurrentInfo.OriginY),_++})}if(y.DisplayAnyUserSets&&y.DisplayAnyUserSets.length>0&&y.DisplayAnyUserSets[0].length>0&&y.DisplayAnyUserSets[0][0].DisplayID){let S=y.DisplayAnyUserSets[0],_=0;S.forEach(C=>{"OriginX"in C&&f.displays&&f.displays[_]&&(f.displays[_].positionX=C.OriginX),"OriginY"in C&&f.displays&&f.displays[_]&&(f.displays[_].positionY=C.OriginY),C.Mode&&C.Mode.BitsPerPixel!==void 0&&f.displays&&f.displays[_]&&(f.displays[_].pixelDepth=C.Mode.BitsPerPixel),_++})}}catch{V.noop()}}n&&n(f),d(f)}),ns&&(V.isRaspberry()&&Rn(`fbset -s 2> /dev/null | grep 'mode "' ; vcgencmd get_mem gpu 2> /dev/null; tvservice -s 2> /dev/null; tvservice -n 2> /dev/null;`,function(x,h){let y=h.toString().split(`
|
|
158
|
+
`);if(y.length>3&&y[0].indexOf('mode "')>=-1&&y[2].indexOf("0x12000a")>-1){let S=y[0].replace("mode","").replace(/"/g,"").trim().split("x");S.length===2&&f.displays.push({vendor:"",model:V.getValue(y,"device_name","="),main:!0,builtin:!1,connection:"HDMI",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:parseInt(S[0],10),resolutionY:parseInt(S[1],10),currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})}y.length>=1&&h.toString().indexOf("gpu=")>=-1&&f.controllers.push({vendor:"Broadcom",model:V.getRpiGpu(),bus:"",vram:V.getValue(y,"gpu","=").replace("M",""),vramDynamic:!0})}),Rn("lspci -vvv 2>/dev/null",function(g,x){if(!g){let y=x.toString().split(`
|
|
159
|
+
`);if(f.controllers.length===0){f.controllers=e(y);let S=o();f.controllers=f.controllers.map(_=>a(_,S.find(C=>C.pciBus.toLowerCase().endsWith(_.busAddress.toLowerCase()))||{}))}}Rn("clinfo --raw",function(y,S){if(!y){let C=S.toString().split(`
|
|
160
|
+
`);f.controllers=r(f.controllers,C)}Rn("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'",function(C,D){let T=0;if(!C){let E=D.toString().split(`
|
|
161
|
+
`);T=parseInt(E[0])||0}Rn("xrandr --verbose 2>/dev/null",function(E,J){if(!E){let U=J.toString().split(`
|
|
162
|
+
`);f.displays=c(U,T)}n&&n(f),d(f)})})})})),(Tu||Mu||bu)&&(n&&n(null),d(null)),Du&&(n&&n(null),d(null)),wo)try{let m=[];m.push(V.powerShell("Get-CimInstance win32_VideoController | fl *")),m.push(V.powerShell('gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl')),m.push(V.powerShell("Get-CimInstance win32_desktopmonitor | fl *")),m.push(V.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")),m.push(V.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")),m.push(V.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")),m.push(V.powerShell('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}'));let g=o();Promise.all(m).then(x=>{let h=x[0].replace(/\r/g,"").split(/\n\s*\n/),y=x[1].replace(/\r/g,"").split(/\n\s*\n/);f.controllers=u(h,y),f.controllers=f.controllers.map(E=>E.vendor.toLowerCase()==="nvidia"?a(E,g.find(J=>{let U=(E.subDeviceId||"").toLowerCase(),ce=J.subDeviceId.split("x"),fe=ce.length>1?ce[1].toLowerCase():ce[0].toLowerCase(),Se=Math.abs(U.length-fe.length);if(U.length>fe.length)for(let X=0;X<Se;X++)fe="0"+fe;else if(U.length<fe.length)for(let X=0;X<Se;X++)U="0"+U;return U===fe})||{}):E);let S=x[2].replace(/\r/g,"").split(/\n\s*\n/);S[0].trim()===""&&S.shift(),S.length&&S[S.length-1].trim()===""&&S.pop();let _=x[3].replace(/\r/g,"").split("Active ");_.shift();let C=x[4].replace(/\r/g,"").split("BitsPerPixel ");C.shift();let D=x[5].replace(/\r/g,"").split(/\n\s*\n/);D.shift();let T=x[6].replace(/\r/g,"").split(/\n/),Q=[];T.forEach(E=>{let J=E.split("|");J.length===5&&Q.push({vendor:J[0],code:J[1],model:J[2],serial:J[3],instanceId:J[4]})}),f.displays=p(C,_,S,D,Q),f.displays.length===1&&(ur&&(f.displays[0].resolutionX=ur,f.displays[0].currentResX||(f.displays[0].currentResX=ur)),pr&&(f.displays[0].resolutionY=pr,f.displays[0].currentResY===0&&(f.displays[0].currentResY=pr)),rs&&(f.displays[0].pixelDepth=rs)),f.displays=f.displays.map(E=>(ss&&!E.currentRefreshRate&&(E.currentRefreshRate=ss),E)),n&&n(f),d(f)}).catch(()=>{n&&n(f),d(f)})}catch{n&&n(f),d(f)}})});function u(d,f){let m={};for(let x in f)if({}.hasOwnProperty.call(f,x)&&f[x].trim()!==""){let h=f[x].trim().split(`
|
|
163
|
+
`),y=V.getValue(h,"MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);if(y){let S=parseInt(V.getValue(h,"HardwareInformation.qwMemorySize"));if(!isNaN(S)){let _=y[1].toUpperCase()+"&"+y[2].toUpperCase();y[3]&&(_+="&"+y[3].toUpperCase()),y[4]&&(_+="&"+y[4].toUpperCase()),m[_]=S}}}let g=[];for(let x in d)if({}.hasOwnProperty.call(d,x)&&d[x].trim()!==""){let h=d[x].trim().split(`
|
|
164
|
+
`),y=V.getValue(h,"PNPDeviceID",":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i),S=null,_=null;if(y){if(S=y[3]||"",S&&(S=S.split("_")[1]),_==null&&y[3]&&y[4]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null&&y[3]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null&&y[4]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}}g.push({vendor:V.getValue(h,"AdapterCompatibility",":"),model:V.getValue(h,"name",":"),bus:V.getValue(h,"PNPDeviceID",":").startsWith("PCI")?"PCI":"",vram:(_??V.toInt(V.getValue(h,"AdapterRAM",":")))/1024/1024,vramDynamic:V.getValue(h,"VideoMemoryType",":")==="2",subDeviceId:S}),ur=V.toInt(V.getValue(h,"CurrentHorizontalResolution",":"))||ur,pr=V.toInt(V.getValue(h,"CurrentVerticalResolution",":"))||pr,ss=V.toInt(V.getValue(h,"CurrentRefreshRate",":"))||ss,rs=V.toInt(V.getValue(h,"CurrentBitsPerPixel",":"))||rs}return g}function p(d,f,m,g,x){let h=[],y="",S="",_="",C=0,D=0;if(m&&m.length){let T=m[0].split(`
|
|
165
|
+
`);y=V.getValue(T,"MonitorManufacturer",":"),S=V.getValue(T,"Name",":"),_=V.getValue(T,"PNPDeviceID",":").replace(/&/g,"&").toLowerCase(),C=V.toInt(V.getValue(T,"ScreenWidth",":")),D=V.toInt(V.getValue(T,"ScreenHeight",":"))}for(let T=0;T<d.length;T++)if(d[T].trim()!==""){d[T]="BitsPerPixel "+d[T],f[T]="Active "+f[T],(g.length===0||g[T]===void 0)&&(g[T]="Unknown");let Q=d[T].split(`
|
|
166
|
+
`),E=f[T].split(`
|
|
167
|
+
`),J=g[T].split(`
|
|
168
|
+
`),U=V.getValue(Q,"BitsPerPixel"),ce=V.getValue(Q,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),fe=V.getValue(Q,"Primary"),Se=V.getValue(E,"MaxHorizontalImageSize"),X=V.getValue(E,"MaxVerticalImageSize"),_e=V.getValue(E,"InstanceName").toLowerCase(),me=V.getValue(J,"VideoOutputTechnology"),be=V.getValue(Q,"DeviceName"),Pe="",se="";x.forEach(ie=>{ie.instanceId.toLowerCase().startsWith(_e)&&y.startsWith("(")&&S.startsWith("PnP")&&(Pe=ie.vendor,se=ie.model)}),h.push({vendor:_e.startsWith(_)&&Pe===""?y:Pe,model:_e.startsWith(_)&&se===""?S:se,deviceName:be,main:fe.toLowerCase()==="true",builtin:me==="2147483648",connection:me&&Io[me]?Io[me]:"",resolutionX:V.toInt(V.getValue(ce,"Width",":")),resolutionY:V.toInt(V.getValue(ce,"Height",":")),sizeX:Se?parseInt(Se,10):null,sizeY:X?parseInt(X,10):null,pixelDepth:U,currentResX:V.toInt(V.getValue(ce,"Width",":")),currentResY:V.toInt(V.getValue(ce,"Height",":")),positionX:V.toInt(V.getValue(ce,"X",":")),positionY:V.toInt(V.getValue(ce,"Y",":"))})}return d.length===0&&h.push({vendor:y,model:S,main:!0,sizeX:null,sizeY:null,resolutionX:C,resolutionY:D,pixelDepth:null,currentResX:C,currentResY:D,positionX:0,positionY:0}),h}}Oo.graphics=Bu});var bo=oe(fn=>{"use strict";var I=ue(),Po=require("fs"),ve=require("child_process").exec,Ot=require("child_process").execSync,Ru=I.promisifySave(require("child_process").exec),Pt=process.platform,Fe=Pt==="linux"||Pt==="android",Et=Pt==="darwin",Fn=Pt==="win32",Ge=Pt==="freebsd",We=Pt==="openbsd",Ue=Pt==="netbsd",Gn=Pt==="sunos",re={},z={};function Fu(n,t){I.isFunction(n)&&(t=n,n="");let e=[],r=[];function i(l){if(!l.startsWith("/"))return"NFS";let c=l.split("/"),u=c[c.length-1],p=e.filter(d=>d.indexOf(u)>=0);return p.length===1&&p[0].indexOf("APFS")>=0?"APFS":"HFS"}function s(l){let c=["rootfs","unionfs","squashfs","cramfs","initrd","initramfs","devtmpfs","tmpfs","udev","devfs","specfs","type","appimaged"],u=!1;return c.forEach(p=>{l.toLowerCase().indexOf(p)>=0&&(u=!0)}),u}function o(l){let c=l.toString().split(`
|
|
169
|
+
`);if(c.shift(),l.toString().toLowerCase().indexOf("filesystem")){let u=0;for(let p=0;p<c.length;p++)c[p]&&c[p].toLowerCase().startsWith("filesystem")&&(u=p);for(let p=0;p<u;p++)c.shift()}return c}function a(l){let c=[];return l.forEach(function(u){if(u!==""&&(u=u.replace(/ +/g," ").split(" "),u&&(u[0].startsWith("/")||u[6]&&u[6]==="/"||u[0].indexOf("/")>0||u[0].indexOf(":")===1||!Et&&!s(u[1])))){let p=u[0],d=Fe||Ge||We||Ue?u[1]:i(u[0]),f=parseInt(Fe||Ge||We||Ue?u[2]:u[1])*1024,m=parseInt(Fe||Ge||We||Ue?u[3]:u[2])*1024,g=parseInt(Fe||Ge||We||Ue?u[4]:u[3])*1024,x=parseFloat((100*(m/(m+g))).toFixed(2)),h=r&&Object.keys(r).length>0?r[p]||!1:null;u.splice(0,Fe||Ge||We||Ue?6:5);let y=u.join(" ");c.find(S=>S.fs===p&&S.type===d)||c.push({fs:p,type:d,size:f,used:m,available:g,use:x,mount:y,rw:h})}}),c}return new Promise(l=>{process.nextTick(()=>{let c=[];if(Fe||Ge||We||Ue||Et){let u="";if(e=[],r={},Et){u="df -kP";try{e=Ot("diskutil list").toString().split(`
|
|
165
170
|
`).filter(p=>!p.startsWith("/")&&p.indexOf(":")>0),Ot("mount").toString().split(`
|
|
166
|
-
`).filter(p=>p.startsWith("/")).forEach(p=>{r[p.split(" ")[0]]=p.toLowerCase().indexOf("read-only")===-1})}catch{
|
|
167
|
-
`).filter(p=>p.startsWith("/")).forEach(p=>{r[p.split(" ")[0]]=r[p.split(" ")[0]]||!1,p.toLowerCase().indexOf("/snap/")===-1&&(r[p.split(" ")[0]]=p.toLowerCase().indexOf("rw,")>=0||p.toLowerCase().indexOf(" rw ")>=0)})}catch{
|
|
168
|
-
`).forEach(p=>{r[p.split(" ")[0]]=p.toLowerCase().indexOf("read-only")===-1})}catch{
|
|
169
|
-
`),
|
|
170
|
-
`);e.max=parseInt(
|
|
171
|
-
`);a[0]&&(e.max=parseInt(a[0],10))}
|
|
172
|
-
`);if(
|
|
173
|
-
`),i=
|
|
174
|
-
`),i=
|
|
175
|
-
`)}function
|
|
176
|
-
`);e=
|
|
177
|
-
`);e=
|
|
178
|
-
`);e=
|
|
179
|
-
`),u=
|
|
180
|
-
`),l=[];a.forEach(function(u){u!==""&&(u=u.trim().split(" "),l.indexOf(u[0])===-1&&l.push(u[0]))});let c=l.join("|");
|
|
181
|
-
`).forEach(function(
|
|
182
|
-
"`,{maxBuffer:1024*1024},function(
|
|
183
|
-
`).forEach(function(l){l=l.trim(),l!==""&&(l=l.split(","),r+=parseInt(l[2]),i+=parseInt(l[9]))}),e=
|
|
184
|
-
`).forEach(function(
|
|
171
|
+
`).filter(p=>p.startsWith("/")).forEach(p=>{r[p.split(" ")[0]]=p.toLowerCase().indexOf("read-only")===-1})}catch{I.noop()}}if(Fe)try{u="export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL",Ot("cat /proc/mounts 2>/dev/null",I.execOptsLinux).toString().split(`
|
|
172
|
+
`).filter(p=>p.startsWith("/")).forEach(p=>{r[p.split(" ")[0]]=r[p.split(" ")[0]]||!1,p.toLowerCase().indexOf("/snap/")===-1&&(r[p.split(" ")[0]]=p.toLowerCase().indexOf("rw,")>=0||p.toLowerCase().indexOf(" rw ")>=0)})}catch{I.noop()}if(Ge||We||Ue)try{u="df -lkPT",Ot("mount").toString().split(`
|
|
173
|
+
`).forEach(p=>{r[p.split(" ")[0]]=p.toLowerCase().indexOf("read-only")===-1})}catch{I.noop()}ve(u,{maxBuffer:1024*1024},function(p,d){let f=o(d);c=a(f),n&&(c=c.filter(m=>m.fs.toLowerCase().indexOf(n.toLowerCase())>=0||m.mount.toLowerCase().indexOf(n.toLowerCase())>=0)),(!p||c.length)&&d.toString().trim()!==""?(t&&t(c),l(c)):ve("df -kPT",{maxBuffer:1024*1024},function(m,g){if(!m){let x=o(g);c=a(x)}t&&t(c),l(c)})})}if(Gn&&(t&&t(c),l(c)),Fn)try{let u=`Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${n?"| where -property Caption -eq "+n:""} | fl`;I.powerShell(u).then((p,d)=>{d||p.toString().split(/\n\s*\n/).forEach(function(m){let g=m.split(`\r
|
|
174
|
+
`),x=I.toInt(I.getValue(g,"size",":")),h=I.toInt(I.getValue(g,"freespace",":")),y=I.getValue(g,"caption",":"),S=I.getValue(g,"access",":"),_=S?I.toInt(S)!==1:null;x&&c.push({fs:y,type:I.getValue(g,"filesystem",":"),size:x,used:x-h,available:h,use:parseFloat((100*(x-h)/x).toFixed(2)),mount:y,rw:_})}),t&&t(c),l(c)})}catch{t&&t(c),l(c)}})})}fn.fsSize=Fu;function Gu(n){return new Promise(t=>{process.nextTick(()=>{let e={max:null,allocated:null,available:null};(Ge||We||Ue||Et)&&ve("sysctl -i kern.maxfiles kern.num_files kern.open_files",{maxBuffer:1024*1024},function(i,s){if(!i){let o=s.toString().split(`
|
|
175
|
+
`);e.max=parseInt(I.getValue(o,"kern.maxfiles",":"),10),e.allocated=parseInt(I.getValue(o,"kern.num_files",":"),10)||parseInt(I.getValue(o,"kern.open_files",":"),10),e.available=e.max-e.allocated}n&&n(e),t(e)}),Fe&&Po.readFile("/proc/sys/fs/file-nr",function(r,i){if(r)Po.readFile("/proc/sys/fs/file-max",function(s,o){if(!s){let a=o.toString().split(`
|
|
176
|
+
`);a[0]&&(e.max=parseInt(a[0],10))}n&&n(e),t(e)});else{let s=i.toString().split(`
|
|
177
|
+
`);if(s[0]){let o=s[0].replace(/\s+/g," ").split(" ");o.length===3&&(e.allocated=parseInt(o[0],10),e.available=parseInt(o[1],10),e.max=parseInt(o[2],10),e.available||(e.available=e.max-e.allocated))}n&&n(e),t(e)}}),Gn&&(n&&n(null),t(null)),Fn&&(n&&n(null),t(null))})})}fn.fsOpenFiles=Gu;function Wu(n){return parseInt(n.substr(n.indexOf(" (")+2,n.indexOf(" Bytes)")-10))}function Uu(n){let t=[],e=0;return n.forEach(r=>{if(r.length>0)if(r[0]==="*")e++;else{let i=r.split(":");i.length>1&&(t[e]||(t[e]={name:"",identifier:"",type:"disk",fsType:"",mount:"",size:0,physical:"HDD",uuid:"",label:"",model:"",serial:"",removable:!1,protocol:"",group:"",device:""}),i[0]=i[0].trim().toUpperCase().replace(/ +/g,""),i[1]=i[1].trim(),i[0]==="DEVICEIDENTIFIER"&&(t[e].identifier=i[1]),i[0]==="DEVICENODE"&&(t[e].name=i[1]),i[0]==="VOLUMENAME"&&i[1].indexOf("Not applicable")===-1&&(t[e].label=i[1]),i[0]==="PROTOCOL"&&(t[e].protocol=i[1]),i[0]==="DISKSIZE"&&(t[e].size=Wu(i[1])),i[0]==="FILESYSTEMPERSONALITY"&&(t[e].fsType=i[1]),i[0]==="MOUNTPOINT"&&(t[e].mount=i[1]),i[0]==="VOLUMEUUID"&&(t[e].uuid=i[1]),i[0]==="READ-ONLYMEDIA"&&i[1]==="Yes"&&(t[e].physical="CD/DVD"),i[0]==="SOLIDSTATE"&&i[1]==="Yes"&&(t[e].physical="SSD"),i[0]==="VIRTUAL"&&(t[e].type="virtual"),i[0]==="REMOVABLEMEDIA"&&(t[e].removable=i[1]==="Removable"),i[0]==="PARTITIONTYPE"&&(t[e].type="part"),i[0]==="DEVICE/MEDIANAME"&&(t[e].model=i[1]))}}),t}function Hs(n){let t=[];return n.filter(e=>e!=="").forEach(e=>{try{e=decodeURIComponent(e.replace(/\\x/g,"%")),e=e.replace(/\\/g,"\\\\");let r=JSON.parse(e);t.push({name:r.name,type:r.type,fsType:r.fsType,mount:r.mountpoint,size:parseInt(r.size),physical:r.type==="disk"?r.rota==="0"?"SSD":"HDD":r.type==="rom"?"CD/DVD":"",uuid:r.uuid,label:r.label,model:(r.model||"").trim(),serial:r.serial,removable:r.rm==="1",protocol:r.tran,group:r.group||""})}catch{I.noop()}}),t=I.unique(t),t=I.sortByKey(t,["type","name"]),t}function zu(n){let t=I.getValue(n,"md_level","="),e=I.getValue(n,"md_name","="),r=I.getValue(n,"md_uuid","="),i=[];return n.forEach(s=>{s.toLowerCase().startsWith("md_device_dev")&&s.toLowerCase().indexOf("/dev/")>0&&i.push(s.split("/dev/")[1])}),{raid:t,label:e,uuid:r,members:i}}function Ao(n){let t=n;try{n.forEach(e=>{if(e.type.startsWith("raid")){let r=Ot(`mdadm --export --detail /dev/${e.name}`,I.execOptsLinux).toString().split(`
|
|
178
|
+
`),i=zu(r);e.label=i.label,e.uuid=i.uuid,i.members&&i.members.length&&i.raid===e.type&&(t=t.map(s=>(s.fsType==="linux_raid_member"&&i.members.indexOf(s.name)>=0&&(s.group=e.name),s)))}})}catch{I.noop()}return t}function Hu(n){let t=[];return n.forEach(e=>{e.type.startsWith("disk")&&t.push(e.name)}),t}function ju(n){let t=n;try{let e=Hu(n);t=t.map(r=>((r.type.startsWith("part")||r.type.startsWith("disk"))&&e.forEach(i=>{r.name.startsWith(i)&&(r.device="/dev/"+i)}),r))}catch{I.noop()}return t}function qu(n){let t=[];return n.forEach(e=>{if(e.type.startsWith("disk")&&t.push({name:e.name,model:e.model,device:e.name}),e.type.startsWith("virtual")){let r="";t.forEach(i=>{i.model===e.model&&(r=i.device)}),r&&t.push({name:e.name,model:e.model,device:r})}}),t}function Ku(n){let t=n;try{let e=qu(n);t=t.map(r=>((r.type.startsWith("part")||r.type.startsWith("disk")||r.type.startsWith("virtual"))&&e.forEach(i=>{r.name.startsWith(i.name)&&(r.device=i.device)}),r))}catch{I.noop()}return t}function $u(n){let t=[];return n.forEach(e=>{let r=e.split(`\r
|
|
179
|
+
`),i=I.getValue(r,"DeviceID",":"),s=e.split("@{DeviceID=");s.length>1&&(s=s.slice(1),s.forEach(o=>{t.push({name:o.split(";")[0].toUpperCase(),device:i})}))}),t}function Yu(n,t){let e=$u(t);return n.map(r=>{let i=e.filter(s=>s.name===r.name.toUpperCase());return i.length>0&&(r.device=i[0].device),r}),n}function js(n){return n.toString().replace(/NAME=/g,'{"name":').replace(/FSTYPE=/g,',"fsType":').replace(/TYPE=/g,',"type":').replace(/SIZE=/g,',"size":').replace(/MOUNTPOINT=/g,',"mountpoint":').replace(/UUID=/g,',"uuid":').replace(/ROTA=/g,',"rota":').replace(/RO=/g,',"ro":').replace(/RM=/g,',"rm":').replace(/TRAN=/g,',"tran":').replace(/SERIAL=/g,',"serial":').replace(/LABEL=/g,',"label":').replace(/MODEL=/g,',"model":').replace(/OWNER=/g,',"owner":').replace(/GROUP=/g,',"group":').replace(/\n/g,`}
|
|
180
|
+
`)}function Xu(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Fe&&ve("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1024*1024},function(r,i){if(r)ve("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1024*1024},function(s,o){if(!s){let a=js(o).split(`
|
|
181
|
+
`);e=Hs(a),e=Ao(e)}n&&n(e),t(e)});else{let s=js(i).split(`
|
|
182
|
+
`);e=Hs(s),e=Ao(e),e=ju(e),n&&n(e),t(e)}}),Et&&ve("diskutil info -all",{maxBuffer:1024*1024},function(r,i){if(!r){let s=i.toString().split(`
|
|
183
|
+
`);e=Uu(s),e=Ku(e)}n&&n(e),t(e)}),Gn&&(n&&n(e),t(e)),Fn){let r=["Unknown","NoRoot","Removable","Local","Network","CD/DVD","RAM"];try{let i=[];i.push(I.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")),i.push(I.powerShell("Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl")),I.promiseAll(i).then(s=>{let o=s.results[0].toString().split(/\n\s*\n/),a=s.results[1].toString().split(/\n\s*\n/);o.forEach(function(l){let c=l.split(`\r
|
|
184
|
+
`),u=I.getValue(c,"drivetype",":");u&&e.push({name:I.getValue(c,"name",":"),identifier:I.getValue(c,"caption",":"),type:"disk",fsType:I.getValue(c,"filesystem",":").toLowerCase(),mount:I.getValue(c,"caption",":"),size:I.getValue(c,"size",":"),physical:u>=0&&u<=6?r[u]:r[0],uuid:I.getValue(c,"volumeserialnumber",":"),label:I.getValue(c,"volumename",":"),model:"",serial:I.getValue(c,"volumeserialnumber",":"),removable:u==="2",protocol:"",group:"",device:""})}),e=Yu(e,a),n&&n(e),t(e)})}catch{n&&n(e),t(e)}}(Ge||We||Ue)&&(n&&n(null),t(null))})})}fn.blockDevices=Xu;function To(n,t){let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return re&&re.ms?(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,e.ms=Date.now()-re.ms,e.rx_sec=(e.rx-re.bytes_read)/(e.ms/1e3),e.wx_sec=(e.wx-re.bytes_write)/(e.ms/1e3),e.tx_sec=e.rx_sec+e.wx_sec,re.rx_sec=e.rx_sec,re.wx_sec=e.wx_sec,re.tx_sec=e.tx_sec,re.bytes_read=e.rx,re.bytes_write=e.wx,re.bytes_overall=e.rx+e.wx,re.ms=Date.now(),re.last_ms=e.ms):(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,re.rx_sec=null,re.wx_sec=null,re.tx_sec=null,re.bytes_read=e.rx,re.bytes_write=e.wx,re.bytes_overall=e.rx+e.wx,re.ms=Date.now(),re.last_ms=0),e}function Zu(n){return new Promise(t=>{process.nextTick(()=>{if(Fn||Ge||We||Ue||Gn)return t(null);let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0},r=0,i=0;re&&!re.ms||re&&re.ms&&Date.now()-re.ms>=500?(Fe&&ve("lsblk -r 2>/dev/null | grep /",{maxBuffer:1024*1024},function(s,o){if(s)n&&n(e),t(e);else{let a=o.toString().split(`
|
|
185
|
+
`),l=[];a.forEach(function(u){u!==""&&(u=u.trim().split(" "),l.indexOf(u[0])===-1&&l.push(u[0]))});let c=l.join("|");ve('cat /proc/diskstats | egrep "'+c+'"',{maxBuffer:1024*1024},function(u,p){u||(p.toString().split(`
|
|
186
|
+
`).forEach(function(f){f=f.trim(),f!==""&&(f=f.replace(/ +/g," ").split(" "),r+=parseInt(f[5])*512,i+=parseInt(f[9])*512)}),e=To(r,i)),n&&n(e),t(e)})}}),Et&&ve(`ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
|
|
187
|
+
"`,{maxBuffer:1024*1024},function(s,o){s||(o.toString().split(`
|
|
188
|
+
`).forEach(function(l){l=l.trim(),l!==""&&(l=l.split(","),r+=parseInt(l[2]),i+=parseInt(l[9]))}),e=To(r,i)),n&&n(e),t(e)})):(e.ms=re.last_ms,e.rx=re.bytes_read,e.wx=re.bytes_write,e.tx=re.bytes_read+re.bytes_write,e.rx_sec=re.rx_sec,e.wx_sec=re.wx_sec,e.tx_sec=re.tx_sec,n&&n(e),t(e))})})}fn.fsStats=Zu;function Mo(n,t,e,r,i){let s={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0};return z&&z.ms?(s.rIO=n,s.wIO=t,s.tIO=n+t,s.ms=Date.now()-z.ms,s.rIO_sec=(s.rIO-z.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-z.wIO)/(s.ms/1e3),s.tIO_sec=s.rIO_sec+s.wIO_sec,s.rWaitTime=e,s.wWaitTime=r,s.tWaitTime=i,s.rWaitPercent=(s.rWaitTime-z.rWaitTime)*100/s.ms,s.wWaitPercent=(s.wWaitTime-z.wWaitTime)*100/s.ms,s.tWaitPercent=(s.tWaitTime-z.tWaitTime)*100/s.ms,z.rIO=n,z.wIO=t,z.rIO_sec=s.rIO_sec,z.wIO_sec=s.wIO_sec,z.tIO_sec=s.tIO_sec,z.rWaitTime=e,z.wWaitTime=r,z.tWaitTime=i,z.rWaitPercent=s.rWaitPercent,z.wWaitPercent=s.wWaitPercent,z.tWaitPercent=s.tWaitPercent,z.last_ms=s.ms,z.ms=Date.now()):(s.rIO=n,s.wIO=t,s.tIO=n+t,s.rWaitTime=e,s.wWaitTime=r,s.tWaitTime=i,z.rIO=n,z.wIO=t,z.rIO_sec=null,z.wIO_sec=null,z.tIO_sec=null,z.rWaitTime=e,z.wWaitTime=r,z.tWaitTime=i,z.rWaitPercent=null,z.wWaitPercent=null,z.tWaitPercent=null,z.last_ms=0,z.ms=Date.now()),s}function Ju(n){return new Promise(t=>{process.nextTick(()=>{if(Fn||Gn)return t(null);let e={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0},r=0,i=0,s=0,o=0,a=0;z&&!z.ms||z&&z.ms&&Date.now()-z.ms>=500?((Fe||Ge||We||Ue)&&ve('for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[\u2502\u2514\u2500\u251C]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done',{maxBuffer:1024*1024},function(c,u){c?(n&&n(e),t(e)):(u.split(`
|
|
189
|
+
`).forEach(function(d){if(!d)return;let f=d.split(";");r+=parseInt(f[0]),i+=parseInt(f[4]),s+=parseInt(f[3]),o+=parseInt(f[7]),a+=parseInt(f[10])}),e=Mo(r,i,s,o,a),n&&n(e),t(e))}),Et&&ve(`ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
|
|
185
190
|
"`,{maxBuffer:1024*1024},function(l,c){l||(c.toString().split(`
|
|
186
|
-
`).forEach(function(p){p=p.trim(),p!==""&&(p=p.split(","),r+=parseInt(p[10]),i+=parseInt(p[0]))}),e=
|
|
187
|
-
`);u=
|
|
188
|
-
`)[0]}catch{
|
|
189
|
-
${
|
|
190
|
-
"`,
|
|
191
|
-
`).forEach(g=>{if(g){let
|
|
192
|
-
`),c=[],u=[],p=[],
|
|
193
|
-
`).split(" Physical Interconnect: ");
|
|
194
|
-
`),
|
|
195
|
-
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{
|
|
191
|
+
`).forEach(function(p){p=p.trim(),p!==""&&(p=p.split(","),r+=parseInt(p[10]),i+=parseInt(p[0]))}),e=Mo(r,i,s,o,a)),n&&n(e),t(e)})):(e.rIO=z.rIO,e.wIO=z.wIO,e.tIO=z.rIO+z.wIO,e.ms=z.last_ms,e.rIO_sec=z.rIO_sec,e.wIO_sec=z.wIO_sec,e.tIO_sec=z.tIO_sec,e.rWaitTime=z.rWaitTime,e.wWaitTime=z.wWaitTime,e.tWaitTime=z.tWaitTime,e.rWaitPercent=z.rWaitPercent,e.wWaitPercent=z.wWaitPercent,e.tWaitPercent=z.tWaitPercent,n&&n(e),t(e))})})}fn.disksIO=Ju;function Qu(n){function t(e){let r=[{pattern:"WESTERN.*",manufacturer:"Western Digital"},{pattern:"^WDC.*",manufacturer:"Western Digital"},{pattern:"WD.*",manufacturer:"Western Digital"},{pattern:"TOSHIBA.*",manufacturer:"Toshiba"},{pattern:"HITACHI.*",manufacturer:"Hitachi"},{pattern:"^IC.*",manufacturer:"Hitachi"},{pattern:"^HTS.*",manufacturer:"Hitachi"},{pattern:"SANDISK.*",manufacturer:"SanDisk"},{pattern:"KINGSTON.*",manufacturer:"Kingston Technology"},{pattern:"^SONY.*",manufacturer:"Sony"},{pattern:"TRANSCEND.*",manufacturer:"Transcend"},{pattern:"SAMSUNG.*",manufacturer:"Samsung"},{pattern:"^ST(?!I\\ ).*",manufacturer:"Seagate"},{pattern:"^STI\\ .*",manufacturer:"SimpleTech"},{pattern:"^D...-.*",manufacturer:"IBM"},{pattern:"^IBM.*",manufacturer:"IBM"},{pattern:"^FUJITSU.*",manufacturer:"Fujitsu"},{pattern:"^MP.*",manufacturer:"Fujitsu"},{pattern:"^MK.*",manufacturer:"Toshiba"},{pattern:"MAXTO.*",manufacturer:"Maxtor"},{pattern:"PIONEER.*",manufacturer:"Pioneer"},{pattern:"PHILIPS.*",manufacturer:"Philips"},{pattern:"QUANTUM.*",manufacturer:"Quantum Technology"},{pattern:"FIREBALL.*",manufacturer:"Quantum Technology"},{pattern:"^VBOX.*",manufacturer:"VirtualBox"},{pattern:"CORSAIR.*",manufacturer:"Corsair Components"},{pattern:"CRUCIAL.*",manufacturer:"Crucial"},{pattern:"ECM.*",manufacturer:"ECM"},{pattern:"INTEL.*",manufacturer:"INTEL"},{pattern:"EVO.*",manufacturer:"Samsung"},{pattern:"APPLE.*",manufacturer:"Apple"}],i="";return e&&(e=e.toUpperCase(),r.forEach(s=>{RegExp(s.pattern).test(e)&&(i=s.manufacturer)})),i}return new Promise(e=>{process.nextTick(()=>{let r=o=>{for(let a=0;a<o.length;a++)delete o[a].BSDName;n&&n(o),e(o)},i=[],s="";if(Fe){let o="";ve("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL",{maxBuffer:1024*1024},function(a,l){if(!a)try{let c=l.toString().trim(),u=[];try{let p=JSON.parse(c);p&&{}.hasOwnProperty.call(p,"blockdevices")&&(u=p.blockdevices.filter(d=>d.type==="disk"&&d.size>0&&(d.model!==null||d.mountpoint===null&&d.label===null&&d.fstype===null&&d.parttype===null&&d.path&&d.path.indexOf("/ram")!==0&&d.path.indexOf("/loop")!==0&&d["disc-max"]&&d["disc-max"]!==0)))}catch{try{let d=Ot("export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL",I.execOptsLinux).toString(),f=js(d).split(`
|
|
192
|
+
`);u=Hs(f).filter(g=>g.type==="disk"&&g.size>0&&(g.model!==null&&g.model!==""||g.mount===""&&g.label===""&&g.fsType===""))}catch{I.noop()}}u.forEach(p=>{let d="",f="/dev/"+p.name,m=p.name;try{d=Ot("cat /sys/block/"+m+"/queue/rotational 2>/dev/null",I.execOptsLinux).toString().split(`
|
|
193
|
+
`)[0]}catch{I.noop()}let g=p.tran?p.tran.toUpperCase().trim():"";g==="NVME"&&(d="2",g="PCIe"),i.push({device:f,type:d==="0"?"SSD":d==="1"?"HD":d==="2"?"NVMe":p.model&&p.model.indexOf("SSD")>-1?"SSD":p.model&&p.model.indexOf("NVM")>-1?"NVMe":"HD",name:p.model||"",vendor:t(p.model)||(p.vendor?p.vendor.trim():""),size:p.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:p.rev?p.rev.trim():"",serialNum:p.serial?p.serial.trim():"",interfaceType:g,smartStatus:"unknown",temperature:null,BSDName:f}),s+=`printf "
|
|
194
|
+
${f}|"; smartctl -H ${f} | grep overall;`,o+=`${o?'printf ",";':""}smartctl -a -j ${f};`})}catch{I.noop()}o?ve(o,{maxBuffer:1024*1024},function(c,u){try{JSON.parse(`[${u}]`).forEach(d=>{let f=d.smartctl.argv[d.smartctl.argv.length-1];for(let m=0;m<i.length;m++)i[m].BSDName===f&&(i[m].smartStatus=d.smart_status.passed?"Ok":d.smart_status.passed===!1?"Predicted Failure":"unknown",d.temperature&&d.temperature.current&&(i[m].temperature=d.temperature.current),i[m].smartData=d)}),r(i)}catch{s?(s=s+`printf "
|
|
195
|
+
"`,ve(s,{maxBuffer:1024*1024},function(d,f){f.toString().split(`
|
|
196
|
+
`).forEach(g=>{if(g){let x=g.split("|");if(x.length===2){let h=x[0];x[1]=x[1].trim();let y=x[1].split(":");if(y.length===2){y[1]=y[1].trim();let S=y[1].toLowerCase();for(let _=0;_<i.length;_++)i[_].BSDName===h&&(i[_].smartStatus=S==="passed"?"Ok":S==="failed!"?"Predicted Failure":"unknown")}}}}),r(i)})):r(i)}}):r(i)})}if((Ge||We||Ue)&&(n&&n(i),e(i)),Gn&&(n&&n(i),e(i)),Et&&ve("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType",{maxBuffer:1024*1024},function(o,a){if(!o){let l=a.toString().split(`
|
|
197
|
+
`),c=[],u=[],p=[],d="SATA";l.forEach(f=>{f==="NVMExpress:"?d="NVMe":f==="USB:"?d="USB":f==="SATA/SATA Express:"?d="SATA":d==="SATA"?c.push(f):d==="NVMe"?u.push(f):d==="USB"&&p.push(f)});try{let f=c.join(`
|
|
198
|
+
`).split(" Physical Interconnect: ");f.shift(),f.forEach(function(m){m="InterfaceType: "+m;let g=m.split(`
|
|
199
|
+
`),x=I.getValue(g,"Medium Type",":",!0).trim(),h=I.getValue(g,"capacity",":",!0).trim(),y=I.getValue(g,"BSD Name",":",!0).trim();if(h){let S=0;if(h.indexOf("(")>=0&&(S=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),S||(S=parseInt(h)),S){let _=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:x.startsWith("Solid")?"SSD":"HD",name:I.getValue(g,"Model",":",!0).trim(),vendor:t(I.getValue(g,"Model",":",!0).trim())||I.getValue(g,"Manufacturer",":",!0),size:S,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:I.getValue(g,"InterfaceType",":",!0).trim(),smartStatus:_==="verified"?"OK":_||"unknown",temperature:null,BSDName:y}),s=s+`printf "
|
|
200
|
+
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{I.noop()}try{let f=u.join(`
|
|
196
201
|
`).split(`
|
|
197
202
|
|
|
198
|
-
Capacity:`);
|
|
199
|
-
`),
|
|
200
|
-
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{
|
|
203
|
+
Capacity:`);f.shift(),f.forEach(function(m){m="!Capacity: "+m;let g=m.split(`
|
|
204
|
+
`),x=I.getValue(g,"link width",":",!0).trim(),h=I.getValue(g,"!capacity",":",!0).trim(),y=I.getValue(g,"BSD Name",":",!0).trim();if(h){let S=0;if(h.indexOf("(")>=0&&(S=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),S||(S=parseInt(h)),S){let _=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:"NVMe",name:I.getValue(g,"Model",":",!0).trim(),vendor:t(I.getValue(g,"Model",":",!0).trim()),size:S,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+x).trim(),smartStatus:_==="verified"?"OK":_||"unknown",temperature:null,BSDName:y}),s=s+`printf "
|
|
205
|
+
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{I.noop()}try{let f=p.join(`
|
|
201
206
|
`).replaceAll(`Media:
|
|
202
207
|
`,"Model:").split(`
|
|
203
208
|
|
|
204
|
-
Product ID:`);
|
|
205
|
-
`),
|
|
206
|
-
`+h+'|"; diskutil info /dev/'+h+" | grep SMART;"}}})}catch{
|
|
207
|
-
"`,
|
|
208
|
-
`).forEach(
|
|
209
|
-
`),p=
|
|
210
|
-
`),p=
|
|
211
|
-
`)[0].split(/\s+/);o[0]==="none"&&o[5]?
|
|
212
|
-
`)[0],
|
|
213
|
-
`);r.length&&r[0].indexOf(":")===-1&&r[0].indexOf("/")===0?
|
|
214
|
-
`);for(let o=0;o<
|
|
215
|
-
`);for(let o=0;o<
|
|
216
|
-
`),
|
|
217
|
-
`):[]
|
|
209
|
+
Product ID:`);f.shift(),f.forEach(function(m){let g=m.split(`
|
|
210
|
+
`),x=I.getValue(g,"Capacity",":",!0).trim(),h=I.getValue(g,"BSD Name",":",!0).trim();if(x){let y=0;if(x.indexOf("(")>=0&&(y=parseInt(x.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),y||(y=parseInt(x)),y){let S=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:h,type:"USB",name:I.getValue(g,"Model",":",!0).trim().replaceAll(":",""),vendor:t(I.getValue(g,"Model",":",!0).trim()),size:y,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:S==="verified"?"OK":S||"unknown",temperature:null,BSDName:h}),s=s+`printf "
|
|
211
|
+
`+h+'|"; diskutil info /dev/'+h+" | grep SMART;"}}})}catch{I.noop()}if(s)s=s+`printf "
|
|
212
|
+
"`,ve(s,{maxBuffer:1024*1024},function(f,m){m.toString().split(`
|
|
213
|
+
`).forEach(x=>{if(x){let h=x.split("|");if(h.length===2){let y=h[0];h[1]=h[1].trim();let S=h[1].split(":");if(S.length===2){S[1]=S[1].trim();let _=S[1].toLowerCase();for(let C=0;C<i.length;C++)i[C].BSDName===y&&(i[C].smartStatus=_==="not supported"?"not supported":_==="verified"?"Ok":_==="failing"?"Predicted Failure":"unknown")}}}});for(let x=0;x<i.length;x++)delete i[x].BSDName;n&&n(i),e(i)});else{for(let f=0;f<i.length;f++)delete i[f].BSDName;n&&n(i),e(i)}}}),Fn)try{let o=[];if(o.push(I.powerShell("Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl")),o.push(I.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")),I.smartMonToolsInstalled())try{let a=JSON.parse(Ot("smartctl --scan -j").toString());a&&a.devices&&a.devices.length>0&&a.devices.forEach(l=>{o.push(Ru(`smartctl -j -a ${l.name}`,I.execOptsWin))})}catch{I.noop()}I.promiseAll(o).then(a=>{let l=a.results[0].toString().split(/\n\s*\n/);l.forEach(function(c){let u=c.split(`\r
|
|
214
|
+
`),p=I.getValue(u,"Size",":").trim(),d=I.getValue(u,"Status",":").trim().toLowerCase();p&&i.push({device:I.getValue(u,"DeviceId",":"),type:c.indexOf("SSD")>-1?"SSD":"HD",name:I.getValue(u,"Caption",":"),vendor:t(I.getValue(u,"Caption",":",!0).trim()),size:parseInt(p),bytesPerSector:parseInt(I.getValue(u,"BytesPerSector",":")),totalCylinders:parseInt(I.getValue(u,"TotalCylinders",":")),totalHeads:parseInt(I.getValue(u,"TotalHeads",":")),totalSectors:parseInt(I.getValue(u,"TotalSectors",":")),totalTracks:parseInt(I.getValue(u,"TotalTracks",":")),tracksPerCylinder:parseInt(I.getValue(u,"TracksPerCylinder",":")),sectorsPerTrack:parseInt(I.getValue(u,"SectorsPerTrack",":")),firmwareRevision:I.getValue(u,"FirmwareRevision",":").trim(),serialNum:I.getValue(u,"SerialNumber",":").trim(),interfaceType:I.getValue(u,"InterfaceType",":").trim(),smartStatus:d==="ok"?"Ok":d==="degraded"?"Degraded":d==="pred fail"?"Predicted Failure":"Unknown",temperature:null})}),l=a.results[1].split(/\n\s*\n/),l.forEach(function(c){let u=c.split(`\r
|
|
215
|
+
`),p=I.getValue(u,"SerialNumber",":").trim(),d=I.getValue(u,"FriendlyName",":").trim().replace("Msft ","Microsoft"),f=I.getValue(u,"Size",":").trim(),m=I.getValue(u,"Model",":").trim(),g=I.getValue(u,"BusType",":").trim(),x=I.getValue(u,"MediaType",":").trim();if((x==="3"||x==="HDD")&&(x="HD"),x==="4"&&(x="SSD"),x==="5"&&(x="SCM"),x==="Unspecified"&&(m.toLowerCase().indexOf("virtual")>-1||m.toLowerCase().indexOf("vbox")>-1)&&(x="Virtual"),f){let h=I.findObjectByKey(i,"serialNum",p);(h===-1||p==="")&&(h=I.findObjectByKey(i,"name",d)),h!=-1&&(i[h].type=x,i[h].interfaceType=g)}}),a.results.shift(),a.results.shift(),a.results.length&&a.results.forEach(c=>{try{let u=JSON.parse(c);if(u.serial_number){let p=u.serial_number,d=I.findObjectByKey(i,"serialNum",p);d!=-1&&(i[d].smartStatus=u.smart_status&&u.smart_status.passed?"Ok":u.smart_status&&u.smart_status.passed===!1?"Predicted Failure":"unknown",u.temperature&&u.temperature.current&&(i[d].temperature=u.temperature.current),i[d].smartData=u)}}catch{I.noop()}}),n&&n(i),e(i)})}catch{n&&n(i),e(i)}})})}fn.diskLayout=Qu});var Go=oe(gn=>{"use strict";var os=require("os"),Me=require("child_process").exec,pe=require("child_process").execSync,ep=require("fs"),P=ue(),At=process.platform,at=At==="linux"||At==="android",lt=At==="darwin",dr=At==="win32",Tt=At==="freebsd",Mt=At==="openbsd",bt=At==="netbsd",Do=At==="sunos",ee={},No="",Wn={},Vo=[],Un=[],zn={},mn;function hn(){let n="",t="";try{let e=os.networkInterfaces(),r=9999;for(let i in e)({}).hasOwnProperty.call(e,i)&&e[i].forEach(function(s){s&&s.internal===!1&&(t=t||i,s.scopeid&&s.scopeid<r&&(n=i,r=s.scopeid))});if(n=n||t||"",dr){let i="";if(pe("netstat -r",P.execOptsWin).toString().split(os.EOL).forEach(l=>{if(l=l.replace(/\s+/g," ").trim(),l.indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(l)){let c=l.split(" ");c.length>=5&&(i=c[c.length-2])}}),i)for(let l in e)({}).hasOwnProperty.call(e,l)&&e[l].forEach(function(c){c&&c.address&&c.address===i&&(n=l)})}if(at){let o=pe("ip route 2> /dev/null | grep default",P.execOptsLinux).toString().split(`
|
|
216
|
+
`)[0].split(/\s+/);o[0]==="none"&&o[5]?n=o[5]:o[4]&&(n=o[4]),n.indexOf(":")>-1&&(n=n.split(":")[1].trim())}if(lt||Tt||Mt||bt||Do){let i="";at&&(i="ip route 2> /dev/null | grep default | awk '{print $5}'"),lt&&(i="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(Tt||Mt||bt||Do)&&(i="route get 0.0.0.0 | grep interface:"),n=pe(i).toString().split(`
|
|
217
|
+
`)[0],n.indexOf(":")>-1&&(n=n.split(":")[1].trim())}}catch{P.noop()}return n&&(No=n),No}gn.getDefaultNetworkInterface=hn;function ko(){let n="",t="",e={};if(at||Tt||Mt||bt){if(typeof mn>"u")try{let r=pe("which ip",P.execOptsLinux).toString().split(`
|
|
218
|
+
`);r.length&&r[0].indexOf(":")===-1&&r[0].indexOf("/")===0?mn=r[0]:mn=""}catch{mn=""}try{let r="export LC_ALL=C; "+(mn?mn+" link show up":"/sbin/ifconfig")+"; unset LC_ALL",s=pe(r,P.execOptsLinux).toString().split(`
|
|
219
|
+
`);for(let o=0;o<s.length;o++)if(s[o]&&s[o][0]!==" "){if(mn){let a=s[o+1].trim().split(" ");a[0]==="link/ether"&&(n=s[o].split(" ")[1],n=n.slice(0,n.length-1),t=a[1])}else n=s[o].split(" ")[0],t=s[o].split("HWaddr ")[1];n&&t&&(e[n]=t.trim(),n="",t="")}}catch{P.noop()}}if(lt)try{let s=pe("/sbin/ifconfig").toString().split(`
|
|
220
|
+
`);for(let o=0;o<s.length;o++)s[o]&&s[o][0]!==" "&&s[o].indexOf(":")>0?n=s[o].split(":")[0]:s[o].indexOf(" ether ")===0&&(t=s[o].split(" ether ")[1],n&&t&&(e[n]=t.trim(),n="",t=""))}catch{P.noop()}return e}function tp(n){return new Promise(t=>{process.nextTick(()=>{let e=hn();n&&n(e),t(e)})})}gn.networkInterfaceDefault=tp;function np(n,t){let e=[];for(let r in n)try{if({}.hasOwnProperty.call(n,r)&&n[r].trim()!==""){let i=n[r].trim().split(`\r
|
|
221
|
+
`),s=null;try{s=t&&t[r]?t[r].trim().split(`\r
|
|
222
|
+
`):[]}catch{P.noop()}let o=P.getValue(i,"NetEnabled",":"),a=P.getValue(i,"AdapterTypeID",":")==="9"?"wireless":"wired",l=P.getValue(i,"Name",":").replace(/\]/g,")").replace(/\[/g,"("),c=P.getValue(i,"NetConnectionID",":").replace(/\]/g,")").replace(/\[/g,"(");if((l.toLowerCase().indexOf("wi-fi")>=0||l.toLowerCase().indexOf("wireless")>=0)&&(a="wireless"),o!==""){let u=parseInt(P.getValue(i,"speed",":").trim(),10)/1e6;e.push({mac:P.getValue(i,"MACAddress",":").toLowerCase(),dhcp:P.getValue(s,"dhcpEnabled",":").toLowerCase()==="true",name:l,iface:c,netEnabled:o==="TRUE",speed:isNaN(u)?null:u,operstate:P.getValue(i,"NetConnectionStatus",":")==="2"?"up":"down",type:a})}}}catch{P.noop()}return e}function rp(){return new Promise(n=>{process.nextTick(()=>{let t="Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";t+="Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";try{P.powerShell(t).then(e=>{e=e.split("#-#-#-#");let r=(e[0]||"").split(/\n\s*\n/),i=(e[1]||"").split(/\n\s*\n/);n(np(r,i))})}catch{n([])}})})}function sp(){let n={},t={primaryDNS:"",exitCode:0,ifaces:[]};try{return pe("ipconfig /all",P.execOptsWin).split(`\r
|
|
218
223
|
\r
|
|
219
|
-
`).forEach((i,
|
|
220
|
-
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);t.primaryDNS=a.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(
|
|
221
|
-
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);
|
|
222
|
-
Profile on interface`)}catch(
|
|
223
|
-
`).shift().split(":").pop()}catch{return"Unknown"}}function
|
|
224
|
+
`).forEach((i,s)=>{if(s==1){let o=i.split(`\r
|
|
225
|
+
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);t.primaryDNS=a.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(s>1)if(s%2==0){let o=i.substring(i.lastIndexOf(" ")+1).replace(":","");n.name=o}else{let o=i.split(`\r
|
|
226
|
+
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);n.dnsSuffix=a.trim(),t.ifaces.push(n),n={}}}),t}catch{return{primaryDNS:"",exitCode:0,ifaces:[]}}}function ip(n,t){let e="",r=t+".";try{let i=n.filter(s=>r.includes(s.name+".")).map(s=>s.dnsSuffix);return i[0]&&(e=i[0]),e||(e=""),e}catch{return"Unknown"}}function op(){try{return pe("netsh lan show profiles",P.execOptsWin).split(`\r
|
|
227
|
+
Profile on interface`)}catch(n){return n.status===1&&n.stdout.includes("AutoConfig")?"Disabled":[]}}function ap(n){try{return pe(`netsh wlan show interface name="${n}" | findstr "SSID"`,P.execOptsWin).split(`\r
|
|
228
|
+
`).shift().split(":").pop().trim()}catch{return"Unknown"}}function lp(n,t,e){let r={state:"Unknown",protocol:"Unknown"};if(e==="Disabled")return r.state="Disabled",r.protocol="Not defined",r;if(n=="wired"&&e.length>0)try{let s=e.find(a=>a.includes(t+`\r
|
|
224
229
|
`)).split(`\r
|
|
225
|
-
`),o=
|
|
226
|
-
`),e=
|
|
227
|
-
`).forEach(i=>{let
|
|
228
|
-
`),r=
|
|
229
|
-
`);r.length&&r[0].startsWith("lease_time")&&(t=!0)}catch{
|
|
230
|
-
echo -n "address: "; cat /sys/class/net/${
|
|
231
|
-
echo -n "addr_len: "; cat /sys/class/net/${
|
|
232
|
-
echo -n "broadcast: "; cat /sys/class/net/${
|
|
233
|
-
echo -n "carrier: "; cat /sys/class/net/${
|
|
234
|
-
echo -n "carrier_changes: "; cat /sys/class/net/${
|
|
235
|
-
echo -n "dev_id: "; cat /sys/class/net/${
|
|
236
|
-
echo -n "dev_port: "; cat /sys/class/net/${
|
|
237
|
-
echo -n "dormant: "; cat /sys/class/net/${
|
|
238
|
-
echo -n "duplex: "; cat /sys/class/net/${
|
|
239
|
-
echo -n "flags: "; cat /sys/class/net/${
|
|
240
|
-
echo -n "gro_flush_timeout: "; cat /sys/class/net/${
|
|
241
|
-
echo -n "ifalias: "; cat /sys/class/net/${
|
|
242
|
-
echo -n "ifindex: "; cat /sys/class/net/${
|
|
243
|
-
echo -n "iflink: "; cat /sys/class/net/${
|
|
244
|
-
echo -n "link_mode: "; cat /sys/class/net/${
|
|
245
|
-
echo -n "mtu: "; cat /sys/class/net/${
|
|
246
|
-
echo -n "netdev_group: "; cat /sys/class/net/${
|
|
247
|
-
echo -n "operstate: "; cat /sys/class/net/${
|
|
248
|
-
echo -n "proto_down: "; cat /sys/class/net/${
|
|
249
|
-
echo -n "speed: "; cat /sys/class/net/${
|
|
250
|
-
echo -n "tx_queue_len: "; cat /sys/class/net/${
|
|
251
|
-
echo -n "type: "; cat /sys/class/net/${
|
|
252
|
-
echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${
|
|
253
|
-
echo -n "wirelessspeed: "; iw dev ${
|
|
254
|
-
`);let ie=
|
|
255
|
-
`);r.push({name:
|
|
256
|
-
`),a=g[0].trim(),l=parseInt(g[1],10),c=parseInt(g[2],10),u=parseInt(g[3],10),p=parseInt(g[4],10),
|
|
257
|
-
`);for(let S=1;S<g.length;S++){let
|
|
258
|
-
`),g.length>1&&g[1].trim()!=="")){
|
|
259
|
-
`);!i&&(o.length>1||o[0]!="")?(o.forEach(function(a){if(a=a.replace(/ +/g," ").split(" "),a.length>=7){let l=a[3],c="",u=a[3].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":"));let p=a[4],
|
|
260
|
-
`).forEach(function(u){if(u=u.replace(/ +/g," ").split(" "),u.length>=6){let p=u[4],
|
|
261
|
-
`);c=c.map(
|
|
262
|
-
`).forEach(function(
|
|
263
|
-
`).forEach(function(a){if(a=a.trim().replace(/ +/g," ").split(" "),a.length>=4){let l=a[1],c="",u=a[1].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":")),l=l.replace(/\[/g,"").replace(/\]/g,"");let p=a[2],
|
|
264
|
-
`),l=(o&&o[0]?o[0]:"").split(" via ");l&&l[1]&&(l=l[1].split(" "),e=l[0]),
|
|
265
|
-
`).map(a=>a.trim());e=
|
|
266
|
-
`).map(c=>c.trim()).find(c=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(c)),
|
|
267
|
-
`);a.length>1&&!e&&(e=
|
|
230
|
+
`),o=s.find(a=>a.includes("802.1x"));if(o.includes("Disabled"))r.state="Disabled",r.protocol="Not defined";else if(o.includes("Enabled")){let a=s.find(l=>l.includes("EAP"));r.protocol=a.split(":").pop(),r.state="Enabled"}}catch{return r}else if(n=="wireless"){let i="",s="";try{let o=ap(t);if(o!=="Unknown"){let a="",l=P.isPrototypePolluted()?"---":P.sanitizeShellString(o),c=P.mathMin(l.length,32);for(let u=0;u<=c;u++)l[u]!==void 0&&(a=a+l[u]);i=pe(`netsh wlan show profiles "${a}" | findstr "802.1X"`,P.execOptsWin),s=pe(`netsh wlan show profiles "${a}" | findstr "EAP"`,P.execOptsWin)}i.includes(":")&&s.includes(":")&&(r.state=i.split(":").pop(),r.protocol=s.split(":").pop())}catch(o){return o.status===1&&o.stdout.includes("AutoConfig")&&(r.state="Disabled",r.protocol="Not defined"),r}}return r}function Bo(n){let t=[],e=[];return n.forEach(function(r){!r.startsWith(" ")&&!r.startsWith(" ")&&e.length&&(t.push(e),e=[]),e.push(r)}),e.length&&t.push(e),t}function cp(n){let t=[];return n.forEach(e=>{let r={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1},i=e[0];r.iface=i.split(":")[0].trim();let s=i.split("> mtu");r.mtu=s.length>1?parseInt(s[1],10):null,isNaN(r.mtu)&&(r.mtu=null),r.internal=s[0].toLowerCase().indexOf("loopback")>-1,e.forEach(l=>{l.trim().startsWith("ether ")&&(r.mac=l.split("ether ")[1].toLowerCase().trim()),l.trim().startsWith("inet6 ")&&!r.ip6&&(r.ip6=l.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),l.trim().startsWith("inet ")&&!r.ip4&&(r.ip4=l.split("inet ")[1].toLowerCase().split(" ")[0])});let o=P.getValue(e,"link rate");r.speed=o?parseFloat(o):null,r.speed===null?(o=P.getValue(e,"uplink rate"),r.speed=o?parseFloat(o):null,r.speed!==null&&o.toLowerCase().indexOf("gbps")>=0&&(r.speed=r.speed*1e3)):o.toLowerCase().indexOf("gbps")>=0&&(r.speed=r.speed*1e3),r.type=P.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired";let a=P.getValue(e,"status").toLowerCase();r.operstate=a==="active"?"up":a==="inactive"?"down":"unknown",r.duplex=P.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(r.ip6||r.ip4||r.mac)&&t.push(r)}),t}function up(){let n="/sbin/ifconfig -v";try{let t=pe(n,{maxBuffer:2048e4}).toString().split(`
|
|
231
|
+
`),e=Bo(t);return cp(e)}catch{return[]}}function pp(n){let t=`nmcli device status 2>/dev/null | grep ${n}`;try{let s=pe(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(3).join(" ");return s!="--"?s:""}catch{return""}}function Ro(n){let t=[];try{let e=`cat ${n} 2> /dev/null | grep 'iface\\|source'`;pe(e,P.execOptsLinux).toString().split(`
|
|
232
|
+
`).forEach(i=>{let s=i.replace(/\s+/g," ").trim().split(" ");if(s.length>=4&&i.toLowerCase().indexOf(" inet ")>=0&&i.toLowerCase().indexOf("dhcp")>=0&&t.push(s[1]),i.toLowerCase().includes("source")){let o=i.split(" ")[1];t=t.concat(Ro(o))}})}catch{P.noop()}return t}function dp(){let n="ip a 2> /dev/null",t=[];try{let e=pe(n,P.execOptsLinux).toString().split(`
|
|
233
|
+
`),r=Bo(e);t=fp(r)}catch{P.noop()}try{t=Ro("/etc/network/interfaces")}catch{P.noop()}return t}function fp(n){let t=[];return n&&n.length&&n.forEach(e=>{if(e&&e.length&&e[0].split(":").length>2){for(let i of e)if(i.indexOf(" inet ")>=0&&i.indexOf(" dynamic ")>=0){let s=i.split(" "),o=s[s.length-1].trim();t.push(o);break}}}),t}function mp(n,t,e){let r=!1;if(t){let i=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.method;`;try{switch(pe(i,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString()){case"auto":r=!0;break;default:r=!1;break}return r}catch{return e.indexOf(n)>=0}}else return e.indexOf(n)>=0}function hp(n){let t=!1,e=`ipconfig getpacket "${n}" 2>/dev/null | grep lease_time;`;try{let r=pe(e).toString().split(`
|
|
234
|
+
`);r.length&&r[0].startsWith("lease_time")&&(t=!0)}catch{P.noop()}return t}function gp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep ipv4.dns-search;`;try{let i=pe(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"Not defined":i}catch{return"Unknown"}}else return"Unknown"}function yp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep 802-1x.eap;`;try{let i=pe(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"":i}catch{return"Not defined"}}else return"Not defined"}function xp(n){return n?n=="Not defined"?"Disabled":"Enabled":"Unknown"}function qs(n,t,e){let r=["00:00:00:00:00:00","00:03:FF","00:05:69","00:0C:29","00:0F:4B","00:13:07","00:13:BE","00:15:5d","00:16:3E","00:1C:42","00:21:F6","00:24:0B","00:50:56","00:A0:B1","00:E0:C8","08:00:27","0A:00:27","18:92:2C","16:DF:49","3C:F3:92","54:52:00","FC:15:97"];return e?r.filter(i=>e.toUpperCase().toUpperCase().startsWith(i.substring(0,e.length))).length>0||n.toLowerCase().indexOf(" virtual ")>-1||t.toLowerCase().indexOf(" virtual ")>-1||n.toLowerCase().indexOf("vethernet ")>-1||t.toLowerCase().indexOf("vethernet ")>-1||n.toLowerCase().startsWith("veth")||t.toLowerCase().startsWith("veth")||n.toLowerCase().startsWith("vboxnet")||t.toLowerCase().startsWith("vboxnet"):!1}function Ks(n,t,e){return typeof n=="string"&&(e=n,t=!0,n=null),typeof n=="boolean"&&(t=n,n=null,e=""),typeof t>"u"&&(t=!0),e=e||"",e=""+e,new Promise(r=>{process.nextTick(()=>{let i=os.networkInterfaces(),s=[],o=[],a=[],l=[];if(lt||Tt||Mt||bt)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{let c=hn();Wn=JSON.parse(JSON.stringify(i)),o=up(),o.forEach(u=>{({}).hasOwnProperty.call(i,u.iface)&&i[u.iface].forEach(function(m){(m.family==="IPv4"||m.family===4)&&(u.ip4subnet=m.netmask),(m.family==="IPv6"||m.family===6)&&(u.ip6subnet=m.netmask)});let p="",d=P.isPrototypePolluted()?"---":P.sanitizeShellString(u.iface),f=P.mathMin(d.length,2e3);for(let m=0;m<=f;m++)d[m]!==void 0&&(p=p+d[m]);s.push({iface:u.iface,ifaceName:u.iface,default:u.iface===c,ip4:u.ip4,ip4subnet:u.ip4subnet||"",ip6:u.ip6,ip6subnet:u.ip6subnet||"",mac:u.mac,internal:u.internal,virtual:u.internal?!1:qs(u.iface,u.iface,u.mac),operstate:u.operstate,type:u.type,duplex:u.duplex,mtu:u.mtu,speed:u.speed,dhcp:hp(p),dnsSuffix:"",ieee8021xAuth:"",ieee8021xState:"",carrierChanges:0})}),Un=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(u=>u.default),s.length>0?s=s[0]:s=[]),n&&n(s),r(s)}if(at)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{Wn=JSON.parse(JSON.stringify(i)),Vo=dp();let c=hn();for(let u in i){let p="",d="",f="",m="",g="",x="",h="",y=null,S=0,_=!1,C="",D="",T="",Q="";if({}.hasOwnProperty.call(i,u)){let E=u;i[u].forEach(function(ie){(ie.family==="IPv4"||ie.family===4)&&(p=ie.address,d=ie.netmask),(ie.family==="IPv6"||ie.family===6)&&(!f||f.match(/^fe80::/i))&&(f=ie.address,m=ie.netmask),g=ie.mac;let xi=parseInt(process.versions.node.split("."),10);g.indexOf("00:00:0")>-1&&(at||lt)&&!ie.internal&&xi>=8&&xi<=11&&(Object.keys(zn).length===0&&(zn=ko()),g=zn[u]||"")});let J=u.split(":")[0].trim().toLowerCase(),U="",ce=P.isPrototypePolluted()?"---":P.sanitizeShellString(J),fe=P.mathMin(ce.length,2e3);for(let ie=0;ie<=fe;ie++)ce[ie]!==void 0&&(U=U+ce[ie]);let Se=`echo -n "addr_assign_type: "; cat /sys/class/net/${U}/addr_assign_type 2>/dev/null; echo;
|
|
235
|
+
echo -n "address: "; cat /sys/class/net/${U}/address 2>/dev/null; echo;
|
|
236
|
+
echo -n "addr_len: "; cat /sys/class/net/${U}/addr_len 2>/dev/null; echo;
|
|
237
|
+
echo -n "broadcast: "; cat /sys/class/net/${U}/broadcast 2>/dev/null; echo;
|
|
238
|
+
echo -n "carrier: "; cat /sys/class/net/${U}/carrier 2>/dev/null; echo;
|
|
239
|
+
echo -n "carrier_changes: "; cat /sys/class/net/${U}/carrier_changes 2>/dev/null; echo;
|
|
240
|
+
echo -n "dev_id: "; cat /sys/class/net/${U}/dev_id 2>/dev/null; echo;
|
|
241
|
+
echo -n "dev_port: "; cat /sys/class/net/${U}/dev_port 2>/dev/null; echo;
|
|
242
|
+
echo -n "dormant: "; cat /sys/class/net/${U}/dormant 2>/dev/null; echo;
|
|
243
|
+
echo -n "duplex: "; cat /sys/class/net/${U}/duplex 2>/dev/null; echo;
|
|
244
|
+
echo -n "flags: "; cat /sys/class/net/${U}/flags 2>/dev/null; echo;
|
|
245
|
+
echo -n "gro_flush_timeout: "; cat /sys/class/net/${U}/gro_flush_timeout 2>/dev/null; echo;
|
|
246
|
+
echo -n "ifalias: "; cat /sys/class/net/${U}/ifalias 2>/dev/null; echo;
|
|
247
|
+
echo -n "ifindex: "; cat /sys/class/net/${U}/ifindex 2>/dev/null; echo;
|
|
248
|
+
echo -n "iflink: "; cat /sys/class/net/${U}/iflink 2>/dev/null; echo;
|
|
249
|
+
echo -n "link_mode: "; cat /sys/class/net/${U}/link_mode 2>/dev/null; echo;
|
|
250
|
+
echo -n "mtu: "; cat /sys/class/net/${U}/mtu 2>/dev/null; echo;
|
|
251
|
+
echo -n "netdev_group: "; cat /sys/class/net/${U}/netdev_group 2>/dev/null; echo;
|
|
252
|
+
echo -n "operstate: "; cat /sys/class/net/${U}/operstate 2>/dev/null; echo;
|
|
253
|
+
echo -n "proto_down: "; cat /sys/class/net/${U}/proto_down 2>/dev/null; echo;
|
|
254
|
+
echo -n "speed: "; cat /sys/class/net/${U}/speed 2>/dev/null; echo;
|
|
255
|
+
echo -n "tx_queue_len: "; cat /sys/class/net/${U}/tx_queue_len 2>/dev/null; echo;
|
|
256
|
+
echo -n "type: "; cat /sys/class/net/${U}/type 2>/dev/null; echo;
|
|
257
|
+
echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${U}; echo;
|
|
258
|
+
echo -n "wirelessspeed: "; iw dev ${U} link 2>&1 | grep bitrate; echo;`,X=[];try{X=pe(Se,P.execOptsLinux).toString().split(`
|
|
259
|
+
`);let ie=pp(U);_=mp(U,ie,Vo),C=gp(ie),D=yp(ie),T=xp(D)}catch{P.noop()}x=P.getValue(X,"duplex"),x=x.startsWith("cat")?"":x,h=parseInt(P.getValue(X,"mtu"),10);let _e=parseInt(P.getValue(X,"speed"),10);y=isNaN(_e)?null:_e;let me=P.getValue(X,"wirelessspeed").split("tx bitrate: ");y===null&&me.length===2&&(_e=parseFloat(me[1]),y=isNaN(_e)?null:_e),S=parseInt(P.getValue(X,"carrier_changes"),10);let be=P.getValue(X,"operstate");Q=be==="up"?P.getValue(X,"wireless").trim()?"wireless":"wired":"unknown",(U==="lo"||U.startsWith("bond"))&&(Q="virtual");let Pe=i[u]&&i[u][0]?i[u][0].internal:!1;(u.toLowerCase().indexOf("loopback")>-1||E.toLowerCase().indexOf("loopback")>-1)&&(Pe=!0);let se=Pe?!1:qs(u,E,g);s.push({iface:U,ifaceName:E,default:J===c,ip4:p,ip4subnet:d,ip6:f,ip6subnet:m,mac:g,internal:Pe,virtual:se,operstate:be,type:Q,duplex:x,mtu:h,speed:y,dhcp:_,dnsSuffix:C,ieee8021xAuth:D,ieee8021xState:T,carrierChanges:S})}}Un=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(u=>u.default),s.length>0?s=s[0]:s=[]),n&&n(s),r(s)}if(dr)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{Wn=JSON.parse(JSON.stringify(i));let c=hn();rp().then(function(u){u.forEach(p=>{let d=!1;Object.keys(i).forEach(f=>{d||i[f].forEach(m=>{Object.keys(m).indexOf("mac")>=0&&(d=m.mac===p.mac)})}),d||(i[p.name]=[{mac:p.mac}])}),l=op(),a=sp();for(let p in i){let d="",f=P.isPrototypePolluted()?"---":P.sanitizeShellString(p),m=P.mathMin(f.length,2e3);for(let X=0;X<=m;X++)f[X]!==void 0&&(d=d+f[X]);let g=p,x="",h="",y="",S="",_="",C="",D="",T=null,Q=0,E="down",J=!1,U="",ce="",fe="",Se="";if({}.hasOwnProperty.call(i,p)){let X=p;i[p].forEach(function(se){(se.family==="IPv4"||se.family===4)&&(x=se.address,h=se.netmask),(se.family==="IPv6"||se.family===6)&&(!y||y.match(/^fe80::/i))&&(y=se.address,S=se.netmask),_=se.mac;let ie=parseInt(process.versions.node.split("."),10);_.indexOf("00:00:0")>-1&&(at||lt)&&!se.internal&&ie>=8&&ie<=11&&(Object.keys(zn).length===0&&(zn=ko()),_=zn[p]||"")}),U=ip(a.ifaces,d);let _e=!1;u.forEach(se=>{se.mac===_&&!_e&&(g=se.iface||g,X=se.name,J=se.dhcp,E=se.operstate,T=E==="up"?se.speed:0,Se=se.type,_e=!0)}),(p.toLowerCase().indexOf("wlan")>=0||X.toLowerCase().indexOf("wlan")>=0||X.toLowerCase().indexOf("802.11n")>=0||X.toLowerCase().indexOf("wireless")>=0||X.toLowerCase().indexOf("wi-fi")>=0||X.toLowerCase().indexOf("wifi")>=0)&&(Se="wireless");let me=lp(Se,d,l);ce=me.protocol,fe=me.state;let be=i[p]&&i[p][0]?i[p][0].internal:!1;(p.toLowerCase().indexOf("loopback")>-1||X.toLowerCase().indexOf("loopback")>-1)&&(be=!0);let Pe=be?!1:qs(p,X,_);s.push({iface:g,ifaceName:X,default:g===c,ip4:x,ip4subnet:h,ip6:y,ip6subnet:S,mac:_,internal:be,virtual:Pe,operstate:E,type:Se,duplex:C,mtu:D,speed:T,dhcp:J,dnsSuffix:U,ieee8021xAuth:ce,ieee8021xState:fe,carrierChanges:Q})}}Un=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(p=>p.default),s.length>0?s=s[0]:s=[]),n&&n(s),r(s)})}})})}gn.networkInterfaces=Ks;function is(n,t,e,r,i,s,o,a){let l={iface:n,operstate:r,rx_bytes:t,rx_dropped:i,rx_errors:s,tx_bytes:e,tx_dropped:o,tx_errors:a,rx_sec:null,tx_sec:null,ms:0};return ee[n]&&ee[n].ms?(l.ms=Date.now()-ee[n].ms,l.rx_sec=t-ee[n].rx_bytes>=0?(t-ee[n].rx_bytes)/(l.ms/1e3):0,l.tx_sec=e-ee[n].tx_bytes>=0?(e-ee[n].tx_bytes)/(l.ms/1e3):0,ee[n].rx_bytes=t,ee[n].tx_bytes=e,ee[n].rx_sec=l.rx_sec,ee[n].tx_sec=l.tx_sec,ee[n].ms=Date.now(),ee[n].last_ms=l.ms,ee[n].operstate=r):(ee[n]||(ee[n]={}),ee[n].rx_bytes=t,ee[n].tx_bytes=e,ee[n].rx_sec=null,ee[n].tx_sec=null,ee[n].ms=Date.now(),ee[n].last_ms=0,ee[n].operstate=r),l}function Fo(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(P.isFunction(n)&&!t)t=n,e=[hn()];else{if(typeof n!="string"&&n!==void 0)return t&&t([]),r([]);n=n||hn();try{n.__proto__.toLowerCase=P.stringToLower,n.__proto__.replace=P.stringReplace,n.__proto__.toString=P.stringToString,n.__proto__.substr=P.stringSubstr,n.__proto__.substring=P.stringSubstring,n.__proto__.trim=P.stringTrim,n.__proto__.startsWith=P.stringStartWith}catch{Object.setPrototypeOf(n,P.stringObj)}n=n.trim().toLowerCase().replace(/,+/g,"|"),e=n.split("|")}let i=[],s=[];if(e.length&&e[0].trim()==="*")e=[],Ks(!1).then(o=>{for(let a of o)e.push(a.iface);Fo(e.join(",")).then(a=>{t&&t(a),r(a)})});else{for(let o of e)s.push(Sp(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function Sp(n){function t(e){let r=[];for(let i in e)if({}.hasOwnProperty.call(e,i)&&e[i].trim()!==""){let s=e[i].trim().split(`\r
|
|
260
|
+
`);r.push({name:P.getValue(s,"Name",":").replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase(),rx_bytes:parseInt(P.getValue(s,"BytesReceivedPersec",":"),10),rx_errors:parseInt(P.getValue(s,"PacketsReceivedErrors",":"),10),rx_dropped:parseInt(P.getValue(s,"PacketsReceivedDiscarded",":"),10),tx_bytes:parseInt(P.getValue(s,"BytesSentPersec",":"),10),tx_errors:parseInt(P.getValue(s,"PacketsOutboundErrors",":"),10),tx_dropped:parseInt(P.getValue(s,"PacketsOutboundDiscarded",":"),10)})}return r}return new Promise(e=>{process.nextTick(()=>{let r="",i=P.isPrototypePolluted()?"---":P.sanitizeShellString(n),s=P.mathMin(i.length,2e3);for(let h=0;h<=s;h++)i[h]!==void 0&&(r=r+i[h]);let o={iface:r,operstate:"unknown",rx_bytes:0,rx_dropped:0,rx_errors:0,tx_bytes:0,tx_dropped:0,tx_errors:0,rx_sec:null,tx_sec:null,ms:0},a="unknown",l=0,c=0,u=0,p=0,d=0,f=0,m,g,x;if(!ee[r]||ee[r]&&!ee[r].ms||ee[r]&&ee[r].ms&&Date.now()-ee[r].ms>=500){if(at&&(ep.existsSync("/sys/class/net/"+r)?(m="cat /sys/class/net/"+r+"/operstate; cat /sys/class/net/"+r+"/statistics/rx_bytes; cat /sys/class/net/"+r+"/statistics/tx_bytes; cat /sys/class/net/"+r+"/statistics/rx_dropped; cat /sys/class/net/"+r+"/statistics/rx_errors; cat /sys/class/net/"+r+"/statistics/tx_dropped; cat /sys/class/net/"+r+"/statistics/tx_errors; ",Me(m,function(h,y){h||(g=y.toString().split(`
|
|
261
|
+
`),a=g[0].trim(),l=parseInt(g[1],10),c=parseInt(g[2],10),u=parseInt(g[3],10),p=parseInt(g[4],10),d=parseInt(g[5],10),f=parseInt(g[6],10),o=is(r,l,c,a,u,p,d,f)),e(o)})):e(o)),(Tt||Mt||bt)&&(m="netstat -ibndI "+r,Me(m,function(h,y){if(!h){g=y.toString().split(`
|
|
262
|
+
`);for(let S=1;S<g.length;S++){let _=g[S].replace(/ +/g," ").split(" ");_&&_[0]&&_[7]&&_[10]&&(l=l+parseInt(_[7]),_[6].trim()!=="-"&&(u=u+parseInt(_[6])),_[5].trim()!=="-"&&(p=p+parseInt(_[5])),c=c+parseInt(_[10]),_[12].trim()!=="-"&&(d=d+parseInt(_[12])),_[9].trim()!=="-"&&(f=f+parseInt(_[9])),a="up")}o=is(r,l,c,a,u,p,d,f)}e(o)})),lt&&(m="ifconfig "+r+' | grep "status"',Me(m,function(h,y){o.operstate=(y.toString().split(":")[1]||"").trim(),o.operstate=(o.operstate||"").toLowerCase(),o.operstate=o.operstate==="active"?"up":o.operstate==="inactive"?"down":"unknown",m="netstat -bdI "+r,Me(m,function(S,_){if(!S&&(g=_.toString().split(`
|
|
263
|
+
`),g.length>1&&g[1].trim()!=="")){x=g[1].replace(/ +/g," ").split(" ");let C=x.length>11?1:0;l=parseInt(x[C+5]),u=parseInt(x[C+10]),p=parseInt(x[C+4]),c=parseInt(x[C+8]),d=parseInt(x[C+10]),f=parseInt(x[C+7]),o=is(r,l,c,o.operstate,u,p,d,f)}e(o)})})),dr){let h=[],y=r;P.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then((S,_)=>{if(!_){let C=S.toString().split(/\n\s*\n/);h=t(C)}Ks(!1).then(C=>{l=0,c=0,h.forEach(D=>{C.forEach(T=>{(T.iface.toLowerCase()===r.toLowerCase()||T.mac.toLowerCase()===r.toLowerCase()||T.ip4.toLowerCase()===r.toLowerCase()||T.ip6.toLowerCase()===r.toLowerCase()||T.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===r.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase())&&T.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===D.name&&(y=T.iface,l=D.rx_bytes,u=D.rx_dropped,p=D.rx_errors,c=D.tx_bytes,d=D.tx_dropped,f=D.tx_errors,a=T.operstate)})}),l&&c&&(o=is(y,parseInt(l),parseInt(c),a,u,p,d,f)),e(o)})})}}else o.rx_bytes=ee[r].rx_bytes,o.tx_bytes=ee[r].tx_bytes,o.rx_sec=ee[r].rx_sec,o.tx_sec=ee[r].tx_sec,o.ms=ee[r].last_ms,o.operstate=ee[r].operstate,e(o)})})}gn.networkStats=Fo;function _p(n,t){let e="";return n.forEach(r=>{let i=r.split(" ");(parseInt(i[0],10)||-1)===t&&(i.shift(),e=i.join(" ").split(":")[0])}),e=e.split(" -")[0],e=e.split(" /")[0],e}function Cp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(at||Tt||Mt||bt){let r='export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';(Tt||Mt||bt)&&(r='export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'),Me(r,{maxBuffer:1024*2e4},function(i,s){let o=s.toString().split(`
|
|
264
|
+
`);!i&&(o.length>1||o[0]!="")?(o.forEach(function(a){if(a=a.replace(/ +/g," ").split(" "),a.length>=7){let l=a[3],c="",u=a[3].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":"));let p=a[4],d="",f=a[4].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":"));let m=a[5],g=a[6].split("/");m&&e.push({protocol:a[0],localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:m,pid:g[0]&&g[0]!=="-"?parseInt(g[0],10):null,process:g[1]?g[1].split(" ")[0].split(":")[0]:""})}}),n&&n(e),t(e)):(r='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',Me(r,{maxBuffer:1024*2e4},function(a,l){a||l.toString().split(`
|
|
265
|
+
`).forEach(function(u){if(u=u.replace(/ +/g," ").split(" "),u.length>=6){let p=u[4],d="",f=u[4].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":"));let m=u[5],g="",x=u[5].split(":");x.length>1&&(g=x[x.length-1],x.pop(),m=x.join(":"));let h=u[1];h==="ESTAB"&&(h="ESTABLISHED"),h==="TIME-WAIT"&&(h="TIME_WAIT");let y=null,S="";if(u.length>=7&&u[6].indexOf("users:")>-1){let _=u[6].replace('users:(("',"").replace(/"/g,"").split(",");_.length>2&&(S=_[0].split(" ")[0].split(":")[0],y=parseInt(_[1],10))}h&&e.push({protocol:u[0],localAddress:p,localPort:d,peerAddress:m,peerPort:g,state:h,pid:y,process:S})}}),n&&n(e),t(e)}))})}if(lt){let r='netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"',i="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN".split("|");Me(r,{maxBuffer:1024*2e4},function(s,o){s||Me("ps -axo pid,command",{maxBuffer:1024*2e4},function(a,l){let c=l.toString().split(`
|
|
266
|
+
`);c=c.map(d=>d.trim().replace(/ +/g," "));let u=o.toString().split(`
|
|
267
|
+
`);u.shift();let p=8;u.length>1&&u[0].indexOf("pid")>0&&(p=(u.shift()||"").replace(/ Address/g,"_Address").replace(/ +/g," ").split(" ").indexOf("pid")),u.forEach(function(d){if(d=d.replace(/ +/g," ").split(" "),d.length>=8){let f=d[3],m="",g=d[3].split(".");g.length>1&&(m=g[g.length-1],g.pop(),f=g.join("."));let x=d[4],h="",y=d[4].split(".");y.length>1&&(h=y[y.length-1],y.pop(),x=y.join("."));let S=i.indexOf(d[5])>=0,_=S?d[5]:"UNKNOWN",C=parseInt(d[p+(S?0:-1)],10);_&&e.push({protocol:d[0],localAddress:f,localPort:m,peerAddress:x,peerPort:h,state:_,pid:C,process:_p(c,C)})}}),n&&n(e),t(e)})})}if(dr){let r="netstat -nao";try{Me(r,P.execOptsWin,function(i,s){i||(s.toString().split(`\r
|
|
268
|
+
`).forEach(function(a){if(a=a.trim().replace(/ +/g," ").split(" "),a.length>=4){let l=a[1],c="",u=a[1].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":")),l=l.replace(/\[/g,"").replace(/\]/g,"");let p=a[2],d="",f=a[2].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":")),p=p.replace(/\[/g,"").replace(/\]/g,"");let m=P.toInt(a[4]),g=a[3];g==="HERGESTELLT"&&(g="ESTABLISHED"),g.startsWith("ABH")&&(g="LISTEN"),g==="SCHLIESSEN_WARTEN"&&(g="CLOSE_WAIT"),g==="WARTEND"&&(g="TIME_WAIT"),g==="SYN_GESENDET"&&(g="SYN_SENT"),g==="LISTENING"&&(g="LISTEN"),g==="SYN_RECEIVED"&&(g="SYN_RECV"),g==="FIN_WAIT_1"&&(g="FIN_WAIT1"),g==="FIN_WAIT_2"&&(g="FIN_WAIT2"),a[0].toLowerCase()!=="udp"&&g?e.push({protocol:a[0].toLowerCase(),localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:g,pid:m,process:""}):a[0].toLowerCase()==="udp"&&e.push({protocol:a[0].toLowerCase(),localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:"",pid:parseInt(a[3],10),process:""})}}),n&&n(e),t(e))})}catch{n&&n(e),t(e)}}})})}gn.networkConnections=Cp;function vp(n){return new Promise(t=>{process.nextTick(()=>{let e="";if(at||Tt||Mt||bt){let r="ip route get 1";try{Me(r,{maxBuffer:1024*2e4},function(i,s){if(i)n&&n(e),t(e);else{let o=s.toString().split(`
|
|
269
|
+
`),l=(o&&o[0]?o[0]:"").split(" via ");l&&l[1]&&(l=l[1].split(" "),e=l[0]),n&&n(e),t(e)}})}catch{n&&n(e),t(e)}}if(lt){let r="route -n get default";try{Me(r,{maxBuffer:1024*2e4},function(i,s){if(!i){let o=s.toString().split(`
|
|
270
|
+
`).map(a=>a.trim());e=P.getValue(o,"gateway")}e?(n&&n(e),t(e)):(r="netstat -rn | awk '/default/ {print $2}'",Me(r,{maxBuffer:1024*2e4},function(o,a){e=a.toString().split(`
|
|
271
|
+
`).map(c=>c.trim()).find(c=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(c)),n&&n(e),t(e)}))})}catch{n&&n(e),t(e)}}if(dr)try{Me("netstat -r",P.execOptsWin,function(r,i){i.toString().split(os.EOL).forEach(o=>{if(o=o.replace(/\s+/g," ").trim(),o.indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(o)){let a=o.split(" ");a.length>=5&&a[a.length-3].indexOf(".")>-1&&(e=a[a.length-3])}}),e?(n&&n(e),t(e)):P.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then(o=>{let a=o.toString().split(`\r
|
|
272
|
+
`);a.length>1&&!e&&(e=P.getValue(a,"NextHop"),n&&n(e),t(e))})})}catch{n&&n(e),t(e)}})})}gn.networkGatewayDefault=vp});var jo=oe(cs=>{"use strict";var fr=require("os"),$s=require("child_process").exec,Dt=require("child_process").execSync,A=ue(),as=process.platform,Ys=as==="linux"||as==="android",Xs=as==="darwin",Zs=as==="win32";function Js(n){let t=parseFloat(n);return t<0?0:t>=100?-50:t/2-100}function ls(n){let t=2*(parseFloat(n)+100);return t<=100?t:100}var mr={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484,32:5160,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,50:5250,52:5260,54:5270,56:5280,58:5290,60:5300,62:5310,64:5320,68:5340,96:5480,100:5500,102:5510,104:5520,106:5530,108:5540,110:5550,112:5560,114:5570,116:5580,118:5590,120:5600,122:5610,124:5620,126:5630,128:5640,132:5660,134:5670,136:5680,138:5690,140:5700,142:5710,144:5720,149:5745,151:5755,153:5765,155:5775,157:5785,159:5795,161:5805,165:5825,169:5845,173:5865,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};function hr(n){return{}.hasOwnProperty.call(mr,n)?mr[n]:null}function wp(n){let t=0;for(let e in mr)({}).hasOwnProperty.call(mr,e)&&mr[e]===n&&(t=A.toInt(e));return t}function Uo(){let n=[],t="iw dev 2>/dev/null";try{let r=Dt(t,A.execOptsLinux).toString().split(`
|
|
268
273
|
`).map(i=>i.trim()).join(`
|
|
269
274
|
`).split(`
|
|
270
|
-
Interface `);return r.shift(),r.forEach(i=>{let
|
|
271
|
-
`),o=
|
|
275
|
+
Interface `);return r.shift(),r.forEach(i=>{let s=i.split(`
|
|
276
|
+
`),o=s[0],a=A.toInt(A.getValue(s,"ifindex"," ")),l=A.getValue(s,"addr"," "),c=A.toInt(A.getValue(s,"channel"," "));n.push({id:a,iface:o,mac:l,channel:c})}),n}catch{try{let i=Dt("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null",A.execOptsLinux).toString().split(`
|
|
272
277
|
|
|
273
|
-
`),
|
|
274
|
-
`),l=
|
|
275
|
-
`),r=
|
|
276
|
-
`),r=
|
|
277
|
-
`),r=
|
|
278
|
-
`),
|
|
278
|
+
`),s=1;return i.forEach(o=>{let a=o.split(`
|
|
279
|
+
`),l=A.getValue(a,"GENERAL.DEVICE"),c=A.getValue(a,"GENERAL.TYPE"),u=s++,p=A.getValue(a,"GENERAL.HWADDR");c.toLowerCase()==="wifi"&&n.push({id:u,iface:l,mac:p,channel:""})}),n}catch{return[]}}}function zo(n){let t=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${n} 2> /dev/null`;try{let e=Dt(t,A.execOptsLinux).toString().split(`
|
|
280
|
+
`),r=A.getValue(e,"GENERAL.CONNECTION");return{iface:n,type:A.getValue(e,"GENERAL.TYPE"),vendor:A.getValue(e,"GENERAL.VENDOR"),product:A.getValue(e,"GENERAL.PRODUCT"),mac:A.getValue(e,"GENERAL.HWADDR").toLowerCase(),ssid:r!=="--"?r:null}}catch{return{}}}function Ip(n){let t=`nmcli -t --show-secrets connection show ${n} 2>/dev/null`;try{let e=Dt(t,A.execOptsLinux).toString().split(`
|
|
281
|
+
`),r=A.getValue(e,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:n!=="--"?n:null,uuid:A.getValue(e,"connection.uuid"),type:A.getValue(e,"connection.type"),autoconnect:A.getValue(e,"connection.autoconnect")==="yes",security:A.getValue(e,"802-11-wireless-security.key-mgmt"),bssid:r!=="--"?r:null}}catch{return{}}}function Lp(n){if(!n)return{};let t=`wpa_cli -i ${n} status 2>&1`;try{let e=Dt(t,A.execOptsLinux).toString().split(`
|
|
282
|
+
`),r=A.toInt(A.getValue(e,"freq","="));return{ssid:A.getValue(e,"ssid","="),uuid:A.getValue(e,"uuid","="),security:A.getValue(e,"key_mgmt","="),freq:r,channel:wp(r),bssid:A.getValue(e,"bssid","=").toLowerCase()}}catch{return{}}}function Ho(){let n=[],t="nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null";try{let r=Dt(t,A.execOptsLinux).toString().split("ACTIVE:");return r.shift(),r.forEach(i=>{i="ACTIVE:"+i;let s=i.split(fr.EOL),o=A.getValue(s,"CHAN"),a=A.getValue(s,"FREQ").toLowerCase().replace("mhz","").trim(),l=A.getValue(s,"SECURITY").replace("(","").replace(")",""),c=A.getValue(s,"WPA-FLAGS").replace("(","").replace(")",""),u=A.getValue(s,"RSN-FLAGS").replace("(","").replace(")",""),p=A.getValue(s,"SIGNAL");n.push({ssid:A.getValue(s,"SSID"),bssid:A.getValue(s,"BSSID").toLowerCase(),mode:A.getValue(s,"MODE"),channel:o?parseInt(o,10):null,frequency:a?parseInt(a,10):null,signalLevel:Js(p),quality:p?parseInt(p,10):null,security:l&&l!=="none"?l.split(" "):[],wpaFlags:c&&c!=="none"?c.split(" "):[],rsnFlags:u&&u!=="none"?u.split(" "):[]})}),n}catch{return[]}}function Wo(n){let t=[];try{let e=Dt(`export LC_ALL=C; iwlist ${n} scan 2>&1; unset LC_ALL`,A.execOptsLinux).toString().split(" Cell ");return e[0].indexOf("resource busy")>=0?-1:(e.length>1&&(e.shift(),e.forEach(r=>{let i=r.split(`
|
|
283
|
+
`),s=A.getValue(i,"channel",":",!0),o=i&&i.length&&i[0].indexOf("Address:")>=0?i[0].split("Address:")[1].trim().toLowerCase():"",a=A.getValue(i,"mode",":",!0),l=A.getValue(i,"frequency",":",!0),u=A.getValue(i,"Quality","=",!0).toLowerCase().split("signal level="),p=u.length>1?A.toInt(u[1]):0,d=p?ls(p):0,f=A.getValue(i,"essid",":",!0),m=r.indexOf(" WPA ")>=0,g=r.indexOf("WPA2 ")>=0,x=[];m&&x.push("WPA"),g&&x.push("WPA2");let h=[],y="";i.forEach(function(S){let _=S.trim().toLowerCase();if(_.indexOf("group cipher")>=0){y&&h.push(y);let C=_.split(":");C.length>1&&(y=C[1].trim().toUpperCase())}if(_.indexOf("pairwise cipher")>=0){let C=_.split(":");C.length>1&&(C[1].indexOf("tkip")?y=y?"TKIP/"+y:"TKIP":C[1].indexOf("ccmp")?y=y?"CCMP/"+y:"CCMP":C[1].indexOf("proprietary")&&(y=y?"PROP/"+y:"PROP"))}if(_.indexOf("authentication suites")>=0){let C=_.split(":");C.length>1&&(C[1].indexOf("802.1x")?y=y?"802.1x/"+y:"802.1x":C[1].indexOf("psk")&&(y=y?"PSK/"+y:"PSK"))}}),y&&h.push(y),t.push({ssid:f,bssid:o,mode:a,channel:s?A.toInt(s):null,frequency:l?A.toInt(l.replace(".","")):null,signalLevel:p,quality:d,security:x,wpaFlags:h,rsnFlags:[]})})),t)}catch{return-1}}function Op(n){let t=[];try{let e=JSON.parse(n);return e=e.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_airport_other_local_wireless_networks,e.forEach(function(r){let i=[],s=r.spairport_security_mode;s==="spairport_security_mode_wep"?i.push("WEP"):s==="spairport_security_mode_wpa2_personal"?i.push("WPA2"):s.startsWith("spairport_security_mode_wpa2_enterprise")?i.push("WPA2 EAP"):s.startsWith("pairport_security_mode_wpa3_transition")?i.push("WPA2/WPA3"):s.startsWith("pairport_security_mode_wpa3")&&i.push("WPA3");let o=parseInt((""+r.spairport_network_channel).split(" ")[0])||0,a=r.spairport_signal_noise||null;t.push({ssid:r._name||"",bssid:r.spairport_network_bssid||null,mode:r.spairport_network_phymode,channel:o,frequency:hr(o),signalLevel:a?parseInt(a,10):null,quality:ls(a),security:i,wpaFlags:[],rsnFlags:[]})}),t}catch{return t}}function Ep(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Ys)if(e=Ho(),e.length===0)try{let r=Dt("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL",A.execOptsLinux).toString().split(`
|
|
279
284
|
|
|
280
|
-
`),i="";if(r.forEach(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
`);if(o.length>1){let a=o[1].split(`
|
|
285
|
-
|
|
286
|
-
`)[0].split(`
|
|
287
|
-
`),l=I.getValue(a,"BSD Device Name",":",!0),c=I.getValue(a,"hardware",":",!0);r='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I 2>/dev/null; echo "######" ; ioreg -n AppleBCMWLANSkywalkInterface -r 2>/dev/null',tn(r,function(u,p){let f=p.toString().split("######"),d=f[0].split(`
|
|
288
|
-
`),m=[];if(f[1].indexOf(" | {")>0&&f[1].indexOf(" | }")>f[1].indexOf(" | {")&&(m=f[1].split(" | {")[1].split(" | }")[0].replace(/ \| /g,"").replace(/"/g,"").split(`
|
|
289
|
-
`)),d.length>10){let g=I.getValue(d,"ssid",":",!0),_=I.getValue(d,"bssid",":",!0)||Go(I.getValue(m,"IO80211BSSID","=",!0)),h=I.getValue(d,"link auth",":",!0),y=I.getValue(d,"lastTxRate",":",!0),S=I.getValue(d,"channel",":",!0).split(",")[0],v="802.11",N=I.toInt(I.getValue(d,"agrCtlRSSI",":",!0));(g||_)&&e.push({id:"Wi-Fi",iface:l,model:c,ssid:g,bssid:_,channel:I.toInt(S),frequency:S?Ws(S):null,type:v,security:h,signalLevel:N,quality:rn(N),txRate:y})}if(m.length>10){let g=I.getValue(m,"IO80211SSID","=",!0),_=Go(I.getValue(m,"IO80211BSSID","=",!0)),h="",y=-1,S=-1,v=-1,x=I.getValue(m,"IO80211Channel","=",!0);(g||_)&&!e.length&&e.push({id:"Wi-Fi",iface:l,model:c,ssid:g,bssid:_,channel:I.toInt(x),frequency:x?Ws(x):null,type:"802.11",security:h,signalLevel:S,quality:v,txRate:y})}s&&s(e),t(e)})}else s&&s(e),t(e)})}else Yn?I.powerShell("netsh wlan show interfaces").then(function(i){let n=i.toString().split(`\r
|
|
290
|
-
`);for(let a=0;a<n.length;a++)n[a]=n[a].trim();let o=n.join(`\r
|
|
285
|
+
`),i="";if(r.forEach(s=>{s.indexOf("no wireless")===-1&&s.trim()!==""&&(i=s.split(" ")[0])}),i){let s="",o=A.isPrototypePolluted()?"---":A.sanitizeShellString(i,!0),a=A.mathMin(o.length,2e3);for(let c=0;c<=a;c++)o[c]!==void 0&&(s=s+o[c]);let l=Wo(s);l===-1?setTimeout(function(c){let u=Wo(c);u!=-1&&(e=u),n&&n(e),t(e)},4e3):(e=l,n&&n(e),t(e))}else n&&n(e),t(e)}catch{n&&n(e),t(e)}else n&&n(e),t(e);else Xs?$s("system_profiler SPAirPortDataType -json 2>/dev/null",{maxBuffer:1024*4e4},function(i,s){e=Op(s.toString()),n&&n(e),t(e)}):Zs?A.powerShell("netsh wlan show networks mode=Bssid").then(i=>{let s=i.toString("utf8").split(fr.EOL+fr.EOL+"SSID ");s.shift(),s.forEach(o=>{let a=o.split(fr.EOL);if(a&&a.length>=8&&a[0].indexOf(":")>=0){let l=o.split(" BSSID");l.shift(),l.forEach(c=>{let u=c.split(fr.EOL),p=u[0].split(":");p.shift();let d=p.join(":").trim().toLowerCase(),f=u[3].split(":").pop().trim(),m=u[1].split(":").pop().trim();e.push({ssid:a[0].split(":").pop().trim(),bssid:d,mode:"",channel:f?parseInt(f,10):null,frequency:hr(f),signalLevel:Js(m),quality:m?parseInt(m,10):null,security:[a[2].split(":").pop().trim()],wpaFlags:[a[3].split(":").pop().trim()],rsnFlags:[]})})}}),n&&n(e),t(e)}):(n&&n(e),t(e))})})}cs.wifiNetworks=Ep;function Pp(n){n=n.toLowerCase();let t="";return n.indexOf("intel")>=0?t="Intel":n.indexOf("realtek")>=0?t="Realtek":n.indexOf("qualcom")>=0?t="Qualcom":n.indexOf("broadcom")>=0?t="Broadcom":n.indexOf("cavium")>=0?t="Cavium":n.indexOf("cisco")>=0?t="Cisco":n.indexOf("marvel")>=0?t="Marvel":n.indexOf("zyxel")>=0?t="Zyxel":n.indexOf("melanox")>=0?t="Melanox":n.indexOf("d-link")>=0?t="D-Link":n.indexOf("tp-link")>=0?t="TP-Link":n.indexOf("asus")>=0?t="Asus":n.indexOf("linksys")>=0&&(t="Linksys"),t}function Ap(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Ys){let r=Uo(),i=Ho();r.forEach(s=>{let o="",a=A.isPrototypePolluted()?"---":A.sanitizeShellString(s.iface,!0),l=A.mathMin(a.length,2e3);for(let _=0;_<=l;_++)a[_]!==void 0&&(o=o+a[_]);let c=zo(o),u=Lp(o),p=c.ssid||u.ssid,d=i.filter(_=>_.ssid===p),f="",m=A.isPrototypePolluted()?"---":A.sanitizeShellString(p,!0),g=A.mathMin(m.length,32);for(let _=0;_<=g;_++)m[_]!==void 0&&(f=f+m[_]);let x=Ip(f),h=d&&d.length&&d[0].channel?d[0].channel:u.channel?u.channel:null,y=d&&d.length&&d[0].bssid?d[0].bssid:u.bssid?u.bssid:null,S=d&&d.length&&d[0].signalLevel?d[0].signalLevel:null;p&&y&&e.push({id:s.id,iface:s.iface,model:c.product,ssid:p,bssid:d&&d.length&&d[0].bssid?d[0].bssid:u.bssid?u.bssid:null,channel:h,frequency:h?hr(h):null,type:x.type?x.type:"802.11",security:x.security?x.security:u.security?u.security:null,signalLevel:S,quality:ls(S),txRate:null})}),n&&n(e),t(e)}else Xs?$s('system_profiler SPNetworkDataType SPAirPortDataType -xml 2>/dev/null; echo "######" ; ioreg -n AppleBCMWLANSkywalkInterface -r 2>/dev/null',function(i,s){try{let o=s.toString().split("######"),a=A.plistParser(o[0]),l=a[0]._SPCommandLineArguments.indexOf("SPNetworkDataType")>=0?a[0]._items:a[1]._items,c=a[0]._SPCommandLineArguments.indexOf("SPAirPortDataType")>=0?a[0]._items[0].spairport_airport_interfaces:a[1]._items[0].spairport_airport_interfaces,u=[];o[1].indexOf(" | {")>0&&o[1].indexOf(" | }")>o[1].indexOf(" | {")&&(u=o[1].split(" | {")[1].split(" | }")[0].replace(/ \| /g,"").replace(/"/g,"").split(`
|
|
286
|
+
`));let p=l.find(h=>h._name==="Wi-Fi"),d=c[0].spairport_current_network_information,f=parseInt((""+d.spairport_network_channel).split(" ")[0])||0,m=d.spairport_signal_noise||null,g=[],x=d.spairport_security_mode;x==="spairport_security_mode_wep"?g.push("WEP"):x==="spairport_security_mode_wpa2_personal"?g.push("WPA2"):x.startsWith("spairport_security_mode_wpa2_enterprise")?g.push("WPA2 EAP"):x.startsWith("pairport_security_mode_wpa3_transition")?g.push("WPA2/WPA3"):x.startsWith("pairport_security_mode_wpa3")&&g.push("WPA3"),e.push({id:p._name||"Wi-Fi",iface:p.interface||"",model:p.hardware||"",ssid:d._name||"",bssid:d.spairport_network_bssid||"",channel:f,frequency:f?hr(f):null,type:d.spairport_network_phymode||"802.11",security:g,signalLevel:m?parseInt(m,10):null,quality:ls(m),txRate:d.spairport_network_rate||null})}catch{A.noop()}n&&n(e),t(e)}):Zs?A.powerShell("netsh wlan show interfaces").then(function(i){let s=i.toString().split(`\r
|
|
287
|
+
`);for(let a=0;a<s.length;a++)s[a]=s[a].trim();let o=s.join(`\r
|
|
291
288
|
`).split(`:\r
|
|
292
289
|
\r
|
|
293
290
|
`);o.shift(),o.forEach(a=>{let l=a.split(`\r
|
|
294
|
-
`);if(l.length>=5){let c=l[0].indexOf(":")>=0?l[0].split(":")[1].trim():"",u=l[1].indexOf(":")>=0?l[1].split(":")[1].trim():"",p=l[2].indexOf(":")>=0?l[2].split(":")[1].trim():"",
|
|
291
|
+
`);if(l.length>=5){let c=l[0].indexOf(":")>=0?l[0].split(":")[1].trim():"",u=l[1].indexOf(":")>=0?l[1].split(":")[1].trim():"",p=l[2].indexOf(":")>=0?l[2].split(":")[1].trim():"",d=A.getValue(l,"SSID",":",!0),f=A.getValue(l,"BSSID",":",!0)||A.getValue(l,"AP BSSID",":",!0),m=A.getValue(l,"Signal",":",!0),g=Js(m),x=A.getValue(l,"Radio type",":",!0)||A.getValue(l,"Type de radio",":",!0)||A.getValue(l,"Funktyp",":",!0)||null,h=A.getValue(l,"authentication",":",!0)||A.getValue(l,"Authentification",":",!0)||A.getValue(l,"Authentifizierung",":",!0)||null,y=A.getValue(l,"Channel",":",!0)||A.getValue(l,"Canal",":",!0)||A.getValue(l,"Kanal",":",!0)||null,S=A.getValue(l,"Transmit rate (mbps)",":",!0)||A.getValue(l,"Transmission (mbit/s)",":",!0)||A.getValue(l,"Empfangsrate (MBit/s)",":",!0)||null;u&&p&&d&&f&&e.push({id:p,iface:c,model:u,ssid:d,bssid:f,channel:A.toInt(y),frequency:y?hr(y):null,type:x,security:h,signalLevel:g,quality:m?parseInt(m,10):null,txRate:A.toInt(S)||null})}}),n&&n(e),t(e)}):(n&&n(e),t(e))})})}cs.wifiConnections=Ap;function Tp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];Ys?(Uo().forEach(i=>{let s=zo(i.iface);e.push({id:i.id,iface:i.iface,model:s.product?s.product:null,vendor:s.vendor?s.vendor:null,mac:i.mac})}),n&&n(e),t(e)):Xs?$s("system_profiler SPNetworkDataType",function(i,s){let o=s.toString().split(`
|
|
295
292
|
|
|
296
293
|
Wi-Fi:
|
|
297
294
|
|
|
298
295
|
`);if(o.length>1){let a=o[1].split(`
|
|
299
296
|
|
|
300
297
|
`)[0].split(`
|
|
301
|
-
`),l=
|
|
302
|
-
`);for(let a=0;a<
|
|
298
|
+
`),l=A.getValue(a,"BSD Device Name",":",!0),c=A.getValue(a,"MAC Address",":",!0),u=A.getValue(a,"hardware",":",!0);e.push({id:"Wi-Fi",iface:l,model:u,vendor:"",mac:c})}n&&n(e),t(e)}):Zs?A.powerShell("netsh wlan show interfaces").then(function(i){let s=i.toString().split(`\r
|
|
299
|
+
`);for(let a=0;a<s.length;a++)s[a]=s[a].trim();let o=s.join(`\r
|
|
303
300
|
`).split(`:\r
|
|
304
301
|
\r
|
|
305
302
|
`);o.shift(),o.forEach(a=>{let l=a.split(`\r
|
|
306
|
-
`);if(l.length>=5){let c=l[0].indexOf(":")>=0?l[0].split(":")[1].trim():"",u=l[1].indexOf(":")>=0?l[1].split(":")[1].trim():"",p=l[2].indexOf(":")>=0?l[2].split(":")[1].trim():"",
|
|
307
|
-
`);o=[];for(let p of u){let
|
|
308
|
-
`);for(let
|
|
309
|
-
`).join("");if(r="",
|
|
310
|
-
`);if(o.forEach(function(
|
|
311
|
-
`),
|
|
312
|
-
`);o.forEach(function(
|
|
313
|
-
`),g=
|
|
314
|
-
`)).slice(),a.all=a.list.length,a.running=a.list.filter(function(p){return p.state==="running"}).length,a.blocked=a.list.filter(function(p){return p.state==="blocked"}).length,a.sleeping=a.list.filter(function(p){return p.state==="sleeping"}).length,
|
|
315
|
-
`),m=
|
|
316
|
-
`);
|
|
317
|
-
`),S=parseInt(
|
|
318
|
-
`),y=parseInt(
|
|
319
|
-
`).filter(function(
|
|
320
|
-
`),h=
|
|
321
|
-
`);e=
|
|
322
|
-
`),e=
|
|
323
|
-
`);e=
|
|
324
|
-
`);e=
|
|
325
|
-
`);e=
|
|
326
|
-
`)),l
|
|
327
|
-
`),i=
|
|
328
|
-
`),
|
|
329
|
-
`),
|
|
330
|
-
`),f=p[0]&&p[0].indexOf(" ")>=0?parseInt(p[0].split(" ")[1],10):404;r.status=f||404,r.ok=f===200||f===301||f===302||f===304,r.ms=r.ok?Date.now()-a:null,t&&t(r),e(r)})}if(Qo){let l=i.startsWith("https:")?require("https"):require("http");try{l.get(i,c=>{let u=c.statusCode;r.status=u||404,r.ok=u===200||u===301||u===302||u===304,u!==200?(c.resume(),r.ms=r.ok?Date.now()-a:null,t&&t(r),e(r)):(c.on("data",()=>{}),c.on("end",()=>{r.ms=r.ok?Date.now()-a:null,t&&t(r),e(r)}))}).on("error",()=>{t&&t(r),e(r)})}catch{t&&t(r),e(r)}}}else t&&t(r),e(r)}catch{t&&t(r),e(r)}})})}oi.inetChecksite=Bp;function Wp(s,t){return we.isFunction(s)&&!t&&(t=s,s=""),s=s||"8.8.8.8",new Promise(e=>{process.nextTick(()=>{if(typeof s!="string")return t&&t(null),e(null);let r="",i=(we.isPrototypePolluted()?"8.8.8.8":we.sanitizeShellString(s,!0)).trim(),n=we.mathMin(i.length,2e3);for(let a=0;a<=n;a++)if(i[a]!==void 0){i[a].__proto__.toLowerCase=we.stringToLower;let l=i[a].toLowerCase();l&&l[0]&&!l[1]&&(r=r+l[0])}if(r.__proto__.startsWith=we.stringStartWith,r.startsWith("file:")||r.startsWith("gopher:")||r.startsWith("telnet:")||r.startsWith("mailto:")||r.startsWith("news:")||r.startsWith("nntp:"))return t&&t(null),e(null);let o;if((ti||ri||ni||ii||si)&&(ti&&(o=["-c","2","-w","3",r]),(ri||ni||ii)&&(o=["-c","2","-t","3",r]),si&&(o=["-c2","-t3",r]),we.execSafe("ping",o).then(a=>{let l=null;if(a){let u=a.split(`
|
|
303
|
+
`);if(l.length>=5){let c=l[0].indexOf(":")>=0?l[0].split(":")[1].trim():"",u=l[1].indexOf(":")>=0?l[1].split(":")[1].trim():"",p=l[2].indexOf(":")>=0?l[2].split(":")[1].trim():"",d=l[3].indexOf(":")>=0?l[3].split(":"):[];d.shift();let f=d.join(":").trim(),m=Pp(u);c&&u&&p&&f&&e.push({id:p,iface:c,model:u,vendor:m,mac:f})}}),n&&n(e),t(e)}):(n&&n(e),t(e))})})}cs.wifiInterfaces=Tp});var $o=oe(ds=>{"use strict";var ps=require("os"),Mp=require("fs"),bp=require("path"),gr=require("child_process").exec,Qs=require("child_process").execSync,R=ue(),Nt=process.platform,et=Nt==="linux"||Nt==="android",yn=Nt==="darwin",ei=Nt==="win32",yr=Nt==="freebsd",xr=Nt==="openbsd",Sr=Nt==="netbsd",us=Nt==="sunos",ge={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},Hn={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},Ee={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},qo={0:"unknown",1:"other",2:"ready",3:"running",4:"blocked",5:"suspended blocked",6:"suspended ready",7:"terminated",8:"stopped",9:"growing"};function Dp(n){let t=n,e=n.replace(/ +/g," ").split(" ");return e.length===5&&(t=e[4]+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(e[1].toUpperCase())/3+1)).slice(-2)+"-"+("0"+e[2]).slice(-2)+" "+e[3]),t}function Np(n){let t=new Date;t=new Date(t.getTime()-t.getTimezoneOffset()*6e4);let e=n.split("-"),r=e.length-1,i=r>0?parseInt(e[r-1]):0,s=e[r].split(":"),o=s.length===3?parseInt(s[0]||0):0,a=parseInt(s[s.length===3?1:0]||0),l=parseInt(s[s.length===3?2:1]||0),c=(((i*24+o)*60+a)*60+l)*1e3,u=new Date(t.getTime()),p=u.toISOString().substring(0,10)+" "+u.toISOString().substring(11,19);try{u=new Date(t.getTime()-c),p=u.toISOString().substring(0,10)+" "+u.toISOString().substring(11,19)}catch{R.noop()}return p}function Vp(n,t){return R.isFunction(n)&&!t&&(t=n,n=""),new Promise(e=>{process.nextTick(()=>{if(typeof n!="string")return t&&t([]),e([]);if(n){let r="";try{r.__proto__.toLowerCase=R.stringToLower,r.__proto__.replace=R.stringReplace,r.__proto__.toString=R.stringToString,r.__proto__.substr=R.stringSubstr,r.__proto__.substring=R.stringSubstring,r.__proto__.trim=R.stringTrim,r.__proto__.startsWith=R.stringStartWith}catch{Object.setPrototypeOf(r,R.stringObj)}let i=R.sanitizeShellString(n),s=R.mathMin(i.length,2e3);for(let c=0;c<=s;c++)i[c]!==void 0&&(r=r+i[c]);r=r.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),r===""&&(r="*"),R.isPrototypePolluted()&&r!=="*"&&(r="------");let o=r.split("|"),a=[],l=[];if(et||yr||xr||Sr||yn){if((et||yr||xr||Sr)&&r==="*")try{let u=Qs("systemctl --all --type=service --no-legend 2> /dev/null",R.execOptsLinux).toString().split(`
|
|
304
|
+
`);o=[];for(let p of u){let d=p.split(".service")[0];d&&p.indexOf(" not-found ")===-1&&o.push(d.trim())}r=o.join("|")}catch{try{r="";let p=Qs("service --status-all 2> /dev/null",R.execOptsLinux).toString().split(`
|
|
305
|
+
`);for(let d of p){let f=d.split("]");f.length===2&&(r+=(r!==""?"|":"")+f[1].trim())}o=r.split("|")}catch{try{let d=Qs("ls /etc/init.d/ -m 2> /dev/null",R.execOptsLinux).toString().split(`
|
|
306
|
+
`).join("");if(r="",d){let f=d.split(",");for(let m of f){let g=m.trim();g&&(r+=(r!==""?"|":"")+g)}o=r.split("|")}}catch{r="",o=[]}}}yn&&r==="*"&&(t&&t(a),e(a));let c=yn?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];r!==""&&o.length>0?R.execSafe("ps",c).then(u=>{if(u){let p=u.replace(/ +/g," ").replace(/,+/g,".").split(`
|
|
307
|
+
`);if(o.forEach(function(d){let f;yn?f=p.filter(function(g){return g.toLowerCase().indexOf(d)!==-1}):f=p.filter(function(g){return g.toLowerCase().indexOf(" "+d.toLowerCase()+":")!==-1||g.toLowerCase().indexOf("/"+d.toLowerCase())!==-1});let m=[];for(let g of f){let x=g.trim().split(" ")[2];x&&m.push(parseInt(x,10))}a.push({name:d,running:f.length>0,startmode:"",pids:m,cpu:parseFloat(f.reduce(function(g,x){return g+parseFloat(x.trim().split(" ")[0])},0).toFixed(2)),mem:parseFloat(f.reduce(function(g,x){return g+parseFloat(x.trim().split(" ")[1])},0).toFixed(2))})}),et){let d='cat /proc/stat | grep "cpu "';for(let f in a)for(let m in a[f].pids)d+=";cat /proc/"+a[f].pids[m]+"/stat";gr(d,{maxBuffer:1024*2e4},function(f,m){let g=m.toString().split(`
|
|
308
|
+
`),x=ti(g.shift()),h={},y={};g.forEach(S=>{if(y=ni(S,x,Hn),y.pid){let _=-1;for(let C in a)for(let D in a[C].pids)parseInt(a[C].pids[D])===parseInt(y.pid)&&(_=C);_>=0&&(a[_].cpu+=y.cpuu+y.cpus),h[y.pid]={cpuu:y.cpuu,cpus:y.cpus,utime:y.utime,stime:y.stime,cutime:y.cutime,cstime:y.cstime}}}),Hn.all=x,Hn.list=Object.assign({},h),Hn.ms=Date.now()-Hn.ms,Hn.result=Object.assign({},a),t&&t(a),e(a)})}else t&&t(a),e(a)}else c=["-o","comm"],R.execSafe("ps",c).then(p=>{if(p){let d=p.replace(/ +/g," ").replace(/,+/g,".").split(`
|
|
309
|
+
`);o.forEach(function(f){let m=d.filter(function(g){return g.indexOf(f)!==-1});a.push({name:f,running:m.length>0,startmode:"",cpu:0,mem:0})}),t&&t(a),e(a)}else o.forEach(function(d){a.push({name:d,running:!1,startmode:"",cpu:0,mem:0})}),t&&t(a),e(a)})}):(t&&t(a),e(a))}if(ei)try{let c="Get-CimInstance Win32_Service";o[0]!=="*"&&(c+=' -Filter "',o.forEach(u=>{c+=`Name='${u}' or `}),c=`${c.slice(0,-4)}"`),c+=" | select Name,Caption,Started,StartMode,ProcessId | fl",R.powerShell(c).then((u,p)=>{p?(o.forEach(function(d){a.push({name:d,running:!1,startmode:"",cpu:0,mem:0})}),t&&t(a),e(a)):(u.split(/\n\s*\n/).forEach(f=>{if(f.trim()!==""){let m=f.trim().split(`\r
|
|
310
|
+
`),g=R.getValue(m,"Name",":",!0).toLowerCase(),x=R.getValue(m,"Caption",":",!0).toLowerCase(),h=R.getValue(m,"Started",":",!0),y=R.getValue(m,"StartMode",":",!0),S=R.getValue(m,"ProcessId",":",!0);(r==="*"||o.indexOf(g)>=0||o.indexOf(x)>=0)&&(a.push({name:g,running:h.toLowerCase()==="true",startmode:y,pids:[S],cpu:0,mem:0}),l.push(g),l.push(x))}}),r!=="*"&&o.filter(function(m){return l.indexOf(m)===-1}).forEach(function(m){a.push({name:m,running:!1,startmode:"",pids:[],cpu:0,mem:0})}),t&&t(a),e(a))})}catch{t&&t(a),e(a)}}else t&&t([]),e([])})})}ds.services=Vp;function ti(n){let t=n.replace(/ +/g," ").split(" "),e=t.length>=2?parseInt(t[1]):0,r=t.length>=3?parseInt(t[2]):0,i=t.length>=4?parseInt(t[3]):0,s=t.length>=5?parseInt(t[4]):0,o=t.length>=6?parseInt(t[5]):0,a=t.length>=7?parseInt(t[6]):0,l=t.length>=8?parseInt(t[7]):0,c=t.length>=9?parseInt(t[8]):0,u=t.length>=10?parseInt(t[9]):0,p=t.length>=11?parseInt(t[10]):0;return e+r+i+s+o+a+l+c+u+p}function ni(n,t,e){let r=n.replace(/ +/g," ").split(")");if(r.length>=2){let i=r[1].split(" ");if(i.length>=16){let s=parseInt(r[0].split(" ")[0]),o=parseInt(i[12]),a=parseInt(i[13]),l=parseInt(i[14]),c=parseInt(i[15]),u=0,p=0;return e.all>0&&e.list[s]?(u=(o+l-e.list[s].utime-e.list[s].cutime)/(t-e.all)*100,p=(a+c-e.list[s].stime-e.list[s].cstime)/(t-e.all)*100):(u=(o+l)/t*100,p=(a+c)/t*100),{pid:s,utime:o,stime:a,cutime:l,cstime:c,cpuu:u,cpus:p}}else return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}else return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}function Ko(n,t,e){let r=0,i=0;return e.all>0&&e.list[n.pid]?(r=(n.utime-e.list[n.pid].utime)/(t-e.all)*100,i=(n.stime-e.list[n.pid].stime)/(t-e.all)*100):(r=n.utime/t*100,i=n.stime/t*100),{pid:n.pid,utime:n.utime,stime:n.stime,cpuu:r>0?r:0,cpus:i>0?i:0}}function kp(n){let t=[];function e(o){o=o||"";let a=o.split(" ")[0];if(a.substr(-1)===":"&&(a=a.substr(0,a.length-1)),a.substr(0,1)!=="["){let l=a.split("/");isNaN(parseInt(l[l.length-1]))?a=l[l.length-1]:a=l[0]}return a}function r(o){let a=0,l=0;function c(J){a=l,t[J]?l=o.substring(t[J].to+a,1e4).indexOf(" "):l=1e4}c(0);let u=parseInt(o.substring(t[0].from+a,t[0].to+l));c(1);let p=parseInt(o.substring(t[1].from+a,t[1].to+l));c(2);let d=parseFloat(o.substring(t[2].from+a,t[2].to+l).replace(/,/g,"."));c(3);let f=parseFloat(o.substring(t[3].from+a,t[3].to+l).replace(/,/g,"."));c(4);let m=parseInt(o.substring(t[4].from+a,t[4].to+l));c(5);let g=parseInt(o.substring(t[5].from+a,t[5].to+l));c(6);let x=parseInt(o.substring(t[6].from+a,t[6].to+l));c(7);let h=parseInt(o.substring(t[7].from+a,t[7].to+l))||0;c(8);let y=us?Dp(o.substring(t[8].from+a,t[8].to+l).trim()):Np(o.substring(t[8].from+a,t[8].to+l).trim());c(9);let S=o.substring(t[9].from+a,t[9].to+l).trim();S=S[0]==="R"?"running":S[0]==="S"?"sleeping":S[0]==="T"?"stopped":S[0]==="W"?"paging":S[0]==="X"?"dead":S[0]==="Z"?"zombie":S[0]==="D"||S[0]==="U"?"blocked":"unknown",c(10);let _=o.substring(t[10].from+a,t[10].to+l).trim();(_==="?"||_==="??")&&(_=""),c(11);let C=o.substring(t[11].from+a,t[11].to+l).trim();c(12);let D="",T="",Q="",E=o.substring(t[12].from+a,t[12].to+l).trim();if(E.substr(E.length-1)==="]"&&(E=E.slice(0,-1)),E.substr(0,1)==="[")T=E.substring(1);else{let J=E.indexOf("("),U=E.indexOf(")"),ce=E.indexOf("/"),fe=E.indexOf(":");if(J<U&&J<ce&&ce<U)T=E.split(" ")[0],T=T.replace(/:/g,"");else if(fe>0&&(ce===-1||ce>3))T=E.split(" ")[0],T=T.replace(/:/g,"");else{let Se=E.indexOf(" -"),X=E.indexOf(" /");Se=Se>=0?Se:1e4,X=X>=0?X:1e4;let _e=Math.min(Se,X),me=E.substr(0,_e),be=E.substr(_e),Pe=me.lastIndexOf("/");if(Pe>=0&&(D=me.substr(0,Pe),me=me.substr(Pe+1)),_e===1e4&&me.indexOf(" ")>-1){let se=me.split(" ");Mp.existsSync(bp.join(D,se[0]))?(T=se.shift(),Q=(se.join(" ")+" "+be).trim()):(T=me.trim(),Q=be.trim())}else T=me.trim(),Q=be.trim()}}return{pid:u,parentPid:p,name:et?e(T):T,cpu:d,cpuu:0,cpus:0,mem:f,priority:m,memVsz:g,memRss:x,nice:h,started:y,state:S,tty:_,user:C,command:T,params:Q,path:D}}function i(o){let a=[];if(o.length>1){let l=o[0];t=R.parseHead(l,8),o.shift(),o.forEach(function(c){c.trim()!==""&&a.push(r(c))})}return a}function s(o){function a(u){let p=("0"+(u.getMonth()+1).toString()).slice(-2),d=u.getFullYear().toString(),f=("0"+u.getDate().toString()).slice(-2),m=("0"+u.getHours().toString()).slice(-2),g=("0"+u.getMinutes().toString()).slice(-2),x=("0"+u.getSeconds().toString()).slice(-2);return d+"-"+p+"-"+f+" "+m+":"+g+":"+x}function l(u){let p="";if(u.indexOf("d")>=0){let d=u.split("d");p=a(new Date(Date.now()-(d[0]*24+d[1]*1)*60*60*1e3))}else if(u.indexOf("h")>=0){let d=u.split("h");p=a(new Date(Date.now()-(d[0]*60+d[1]*1)*60*1e3))}else if(u.indexOf(":")>=0){let d=u.split(":");p=a(new Date(Date.now()-(d.length>1?(d[0]*60+d[1])*1e3:d[0]*1e3)))}return p}let c=[];return o.forEach(function(u){if(u.trim()!==""){u=u.trim().replace(/ +/g," ").replace(/,+/g,".");let p=u.split(" "),d=p.slice(9).join(" "),f=parseFloat((1*parseInt(p[3])*1024/ps.totalmem()).toFixed(1)),m=l(p[5]);c.push({pid:parseInt(p[0]),parentPid:parseInt(p[1]),name:e(d),cpu:0,cpuu:0,cpus:0,mem:f,priority:0,memVsz:parseInt(p[2]),memRss:parseInt(p[3]),nice:parseInt(p[4]),started:m,state:p[6]==="R"?"running":p[6]==="S"?"sleeping":p[6]==="T"?"stopped":p[6]==="W"?"paging":p[6]==="X"?"dead":p[6]==="Z"?"zombie":p[6]==="D"||p[6]==="U"?"blocked":"unknown",tty:p[7],user:p[8],command:d})}}),c}return new Promise(o=>{process.nextTick(()=>{let a={all:0,running:0,blocked:0,sleeping:0,unknown:0,list:[]},l="";if(ge.ms&&Date.now()-ge.ms>=500||ge.ms===0)if(et||yr||xr||Sr||yn||us)et&&(l="export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"),(yr||xr||Sr)&&(l="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"),yn&&(l="ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"),us&&(l="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),gr(l,{maxBuffer:1024*2e4},function(c,u){!c&&u.toString().trim()?(a.list=i(u.toString().split(`
|
|
311
|
+
`)).slice(),a.all=a.list.length,a.running=a.list.filter(function(p){return p.state==="running"}).length,a.blocked=a.list.filter(function(p){return p.state==="blocked"}).length,a.sleeping=a.list.filter(function(p){return p.state==="sleeping"}).length,et?(l='cat /proc/stat | grep "cpu "',a.list.forEach(p=>{l+=";cat /proc/"+p.pid+"/stat"}),gr(l,{maxBuffer:1024*2e4},function(p,d){let f=d.toString().split(`
|
|
312
|
+
`),m=ti(f.shift()),g={},x={};f.forEach(h=>{if(x=ni(h,m,ge),x.pid){let y=a.list.map(function(S){return S.pid}).indexOf(x.pid);y>=0&&(a.list[y].cpu=x.cpuu+x.cpus,a.list[y].cpuu=x.cpuu,a.list[y].cpus=x.cpus),g[x.pid]={cpuu:x.cpuu,cpus:x.cpus,utime:x.utime,stime:x.stime,cutime:x.cutime,cstime:x.cstime}}}),ge.all=m,ge.list=Object.assign({},g),ge.ms=Date.now()-ge.ms,ge.result=Object.assign({},a),n&&n(a),o(a)})):(n&&n(a),o(a))):(l="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",us&&(l="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),gr(l,{maxBuffer:1024*2e4},function(p,d){if(p)n&&n(a),o(a);else{let f=d.toString().split(`
|
|
313
|
+
`);f.shift(),a.list=s(f).slice(),a.all=a.list.length,a.running=a.list.filter(function(m){return m.state==="running"}).length,a.blocked=a.list.filter(function(m){return m.state==="blocked"}).length,a.sleeping=a.list.filter(function(m){return m.state==="sleeping"}).length,n&&n(a),o(a)}}))});else if(ei)try{R.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then((c,u)=>{if(!u){let p=c.split(/\n\s*\n/),d=[],f=[],m={},g=0,x=0;p.forEach(h=>{if(h.trim()!==""){let y=h.trim().split(`\r
|
|
314
|
+
`),S=parseInt(R.getValue(y,"ProcessId",":",!0),10),_=parseInt(R.getValue(y,"ParentProcessId",":",!0),10),C=R.getValue(y,"ExecutionState",":"),D=R.getValue(y,"Caption",":",!0),T=R.getValue(y,"CommandLine",":",!0),Q=!1;y.forEach(fe=>{Q&&fe.toLowerCase().startsWith(" ")?T+=" "+fe.trim():Q=!1,fe.toLowerCase().startsWith("commandline")&&(Q=!0)});let E=R.getValue(y,"ExecutablePath",":",!0),J=parseInt(R.getValue(y,"UserModeTime",":",!0),10),U=parseInt(R.getValue(y,"KernelModeTime",":",!0),10),ce=parseInt(R.getValue(y,"WorkingSetSize",":",!0),10);g=g+J,x=x+U,a.all++,C||a.unknown++,C==="3"&&a.running++,(C==="4"||C==="5")&&a.blocked++,f.push({pid:S,utime:J,stime:U,cpu:0,cpuu:0,cpus:0}),d.push({pid:S,parentPid:_,name:D,cpu:0,cpuu:0,cpus:0,mem:ce/ps.totalmem()*100,priority:parseInt(R.getValue(y,"Priority",":",!0),10),memVsz:parseInt(R.getValue(y,"PageFileUsage",":",!0),10),memRss:Math.floor(parseInt(R.getValue(y,"WorkingSetSize",":",!0),10)/1024),nice:0,started:R.getValue(y,"CreationDate",":",!0),state:C?qo[C]:qo[0],tty:"",user:"",command:T||D,path:E,params:""})}}),a.sleeping=a.all-a.running-a.blocked-a.unknown,a.list=d,f.forEach(h=>{let y=Ko(h,g+x,ge),S=a.list.map(function(_){return _.pid}).indexOf(y.pid);S>=0&&(a.list[S].cpu=y.cpuu+y.cpus,a.list[S].cpuu=y.cpuu,a.list[S].cpus=y.cpus),m[y.pid]={cpuu:y.cpuu,cpus:y.cpus,utime:y.utime,stime:y.stime}}),ge.all=g+x,ge.all_utime=g,ge.all_stime=x,ge.list=Object.assign({},m),ge.ms=Date.now()-ge.ms,ge.result=Object.assign({},a)}n&&n(a),o(a)})}catch{n&&n(a),o(a)}else n&&n(a),o(a);else n&&n(ge.result),o(ge.result)})})}ds.processes=kp;function Bp(n,t){return R.isFunction(n)&&!t&&(t=n,n=""),new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return t&&t([]),e([]);let r="";try{r.__proto__.toLowerCase=R.stringToLower,r.__proto__.replace=R.stringReplace,r.__proto__.toString=R.stringToString,r.__proto__.substr=R.stringSubstr,r.__proto__.substring=R.stringSubstring,r.__proto__.trim=R.stringTrim,r.__proto__.startsWith=R.stringStartWith}catch{Object.setPrototypeOf(r,R.stringObj)}let i=R.sanitizeShellString(n),s=R.mathMin(i.length,2e3);for(let c=0;c<=s;c++)i[c]!==void 0&&(r=r+i[c]);r=r.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),r===""&&(r="*"),R.isPrototypePolluted()&&r!=="*"&&(r="------");let o=r.split("|"),a=[];if((R.isPrototypePolluted()?"":R.sanitizeShellString(n)||"*")&&o.length&&o[0]!=="------"){if(ei)try{R.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then((c,u)=>{if(!u){let p=c.split(/\n\s*\n/),d=[],f={},m=0,g=0;p.forEach(x=>{if(x.trim()!==""){let h=x.trim().split(`\r
|
|
315
|
+
`),y=parseInt(R.getValue(h,"ProcessId",":",!0),10),S=R.getValue(h,"Caption",":",!0),_=parseInt(R.getValue(h,"UserModeTime",":",!0),10),C=parseInt(R.getValue(h,"KernelModeTime",":",!0),10),D=parseInt(R.getValue(h,"WorkingSetSize",":",!0),10);m=m+_,g=g+C,d.push({pid:y,name:S,utime:_,stime:C,cpu:0,cpuu:0,cpus:0,mem:D});let T="",Q=!1;if(o.forEach(function(E){S.toLowerCase().indexOf(E.toLowerCase())>=0&&!Q&&(Q=!0,T=E)}),r==="*"||Q){let E=!1;a.forEach(function(J){J.proc.toLowerCase()===T.toLowerCase()&&(J.pids.push(y),J.mem+=D/ps.totalmem()*100,E=!0)}),E||a.push({proc:T,pid:y,pids:[y],cpu:0,mem:D/ps.totalmem()*100})}}}),r!=="*"&&o.filter(function(h){return d.filter(function(y){return y.name.toLowerCase().indexOf(h)>=0}).length===0}).forEach(function(h){a.push({proc:h,pid:null,pids:[],cpu:0,mem:0})}),d.forEach(x=>{let h=Ko(x,m+g,Ee),y=-1;for(let S=0;S<a.length;S++)(a[S].pid===h.pid||a[S].pids.indexOf(h.pid)>=0)&&(y=S);y>=0&&(a[y].cpu+=h.cpuu+h.cpus),f[h.pid]={cpuu:h.cpuu,cpus:h.cpus,utime:h.utime,stime:h.stime}}),Ee.all=m+g,Ee.all_utime=m,Ee.all_stime=g,Ee.list=Object.assign({},f),Ee.ms=Date.now()-Ee.ms,Ee.result=JSON.parse(JSON.stringify(a)),t&&t(a),e(a)}})}catch{t&&t(a),e(a)}if(yn||et||yr||xr||Sr){let c=["-axo","pid,ppid,pcpu,pmem,comm"];R.execSafe("ps",c).then(u=>{if(u){let p=[],d=u.toString().split(`
|
|
316
|
+
`).filter(function(f){if(r==="*")return!0;if(f.toLowerCase().indexOf("grep")!==-1)return!1;let m=!1;return o.forEach(function(g){m=m||f.toLowerCase().indexOf(g.toLowerCase())>=0}),m});if(d.shift(),d.forEach(function(f){let m=f.trim().replace(/ +/g," ").split(" ");if(m.length>4){let g=m[4].indexOf("/")>=0?m[4].substring(0,m[4].indexOf("/")):m[4],x=et?g:m[4].substring(m[4].lastIndexOf("/")+1);p.push({name:x,pid:parseInt(m[0])||0,ppid:parseInt(m[1])||0,cpu:parseFloat(m[2].replace(",",".")),mem:parseFloat(m[3].replace(",","."))})}}),p.forEach(function(f){let m=-1,g=!1,x=f.name;for(let h=0;h<a.length;h++)f.name.toLowerCase().indexOf(a[h].proc.toLowerCase())>=0&&(m=h);o.forEach(function(h){f.name.toLowerCase().indexOf(h.toLowerCase())>=0&&!g&&(g=!0,x=h)}),(r==="*"||g)&&(m<0?x&&a.push({proc:x,pid:f.pid,pids:[f.pid],cpu:f.cpu,mem:f.mem}):(f.ppid<10&&(a[m].pid=f.pid),a[m].pids.push(f.pid),a[m].cpu+=f.cpu,a[m].mem+=f.mem))}),r!=="*"&&o.filter(function(m){return p.filter(function(g){return g.name.toLowerCase().indexOf(m)>=0}).length===0}).forEach(function(m){a.push({proc:m,pid:null,pids:[],cpu:0,mem:0})}),et){a.forEach(function(m){m.cpu=0});let f='cat /proc/stat | grep "cpu "';for(let m in a)for(let g in a[m].pids)f+=";cat /proc/"+a[m].pids[g]+"/stat";gr(f,{maxBuffer:1024*2e4},function(m,g){let x=g.toString().split(`
|
|
317
|
+
`),h=ti(x.shift()),y={},S={};x.forEach(_=>{if(S=ni(_,h,Ee),S.pid){let C=-1;for(let D in a)a[D].pids.indexOf(S.pid)>=0&&(C=D);C>=0&&(a[C].cpu+=S.cpuu+S.cpus),y[S.pid]={cpuu:S.cpuu,cpus:S.cpus,utime:S.utime,stime:S.stime,cutime:S.cutime,cstime:S.cstime}}}),a.forEach(function(_){_.cpu=Math.round(_.cpu*100)/100}),Ee.all=h,Ee.list=Object.assign({},y),Ee.ms=Date.now()-Ee.ms,Ee.result=Object.assign({},a),t&&t(a),e(a)})}else t&&t(a),e(a)}else t&&t(a),e(a)})}}})})}ds.processLoad=Bp});var Zo=oe(Xo=>{"use strict";var _r=require("child_process").exec,ct=ue(),Vt=process.platform,Rp=Vt==="linux"||Vt==="android",Fp=Vt==="darwin",Gp=Vt==="win32",Wp=Vt==="freebsd",Up=Vt==="openbsd",zp=Vt==="netbsd",Hp=Vt==="sunos";function Yo(n,t){let e=[],r=[],i={},s=!0,o=[],a=[],l={},c=!0;return n.forEach(function(u){if(u==="---")c=!1;else{let p=u.replace(/ +/g," ").split(" ");c?r.push({user:p[0],tty:p[1],date:p[2],time:p[3],ip:p&&p.length>4?p[4].replace(/\(/g,"").replace(/\)/g,""):""}):s?(o=p,o.forEach(function(d){a.push(u.indexOf(d))}),s=!1):(i.user=u.substring(a[0],a[1]-1).trim(),i.tty=u.substring(a[1],a[2]-1).trim(),i.ip=u.substring(a[2],a[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=u.substring(a[7],1e3).trim(),l=r.filter(function(d){return d.user.substring(0,8).trim()===i.user&&d.tty===i.tty}),l.length===1&&e.push({user:l[0].user,tty:l[0].tty,date:l[0].date,time:l[0].time,ip:l[0].ip,command:i.command}))}}),e.length===0&&t===2?r:e}function ri(n){let t=[],e=[],r={},i={},s=!0;return n.forEach(function(o){if(o==="---")s=!1;else{let a=o.replace(/ +/g," ").split(" ");if(s){let l=""+new Date().getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2);try{new Date(l)>new Date&&(l=""+(new Date().getFullYear()-1)+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2))}catch{ct.noop()}e.push({user:a[0],tty:a[1],date:l,time:a[4]})}else r.user=a[0],r.tty=a[1],r.ip=a[2]!=="-"?a[2]:"",r.command=a.slice(5,1e3).join(" "),i=e.filter(function(l){return l.user.substring(0,10)===r.user.substring(0,10)&&(l.tty.substring(3,1e3)===r.tty||l.tty===r.tty)}),i.length===1&&t.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:r.ip,command:r.command})}}),t}function jp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Rp&&_r('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2',function(r,i){if(r)n&&n(e),t(e);else{let s=i.toString().split(`
|
|
318
|
+
`);e=Yo(s,1),e.length===0?_r('who; echo "---"; w | tail -n +2',function(o,a){o||(s=a.toString().split(`
|
|
319
|
+
`),e=Yo(s,2)),n&&n(e),t(e)}):(n&&n(e),t(e))}}),(Wp||Up||zp)&&_r('who; echo "---"; w -ih',function(r,i){if(!r){let s=i.toString().split(`
|
|
320
|
+
`);e=ri(s)}n&&n(e),t(e)}),Hp&&_r('who; echo "---"; w -h',function(r,i){if(!r){let s=i.toString().split(`
|
|
321
|
+
`);e=ri(s)}n&&n(e),t(e)}),Fp&&_r('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL',function(r,i){if(!r){let s=i.toString().split(`
|
|
322
|
+
`);e=ri(s)}n&&n(e),t(e)}),Gp)try{let r=`Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo '#-#-#-#';`;r+="Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';",r+=`$process = (Get-CimInstance Win32_Process -Filter "name = 'explorer.exe'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';`,r+="query user",ct.powerShell(r).then(i=>{if(i){i=i.split("#-#-#-#");let s=qp((i[0]||"").split(/\n\s*\n/)),o=Yp((i[1]||"").split(/\n\s*\n/)),a=Xp((i[3]||"").split(`\r
|
|
323
|
+
`)),l=$p((i[2]||"").split(/\n\s*\n/),a);for(let c in o)({}).hasOwnProperty.call(o,c)&&(o[c].dateTime={}.hasOwnProperty.call(s,c)?s[c]:"");l.forEach(c=>{let u="";for(let p in o)({}).hasOwnProperty.call(o,p)&&o[p].user===c.user&&(!u||u<o[p].dateTime)&&(u=o[p].dateTime);e.push({user:c.user,tty:c.tty,date:`${u.substring(0,10)}`,time:`${u.substring(11,19)}`,ip:"",command:""})})}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}function qp(n){let t={};return n.forEach(e=>{let r=e.split(`\r
|
|
324
|
+
`),i=ct.getValue(r,"LogonId"),s=ct.getValue(r,"starttime");i&&(t[i]=s)}),t}function Kp(n,t){n=n.toLowerCase(),t=t.toLowerCase();let e=0,r=n.length;t.length>r&&(r=t.length);for(let i=0;i<r;i++){let s=n[i]||"",o=t[i]||"";s===o&&e++}return r>10?e/r>.9:r>0?e/r>.8:!1}function $p(n,t){let e=[];return n.forEach(r=>{let i=r.split(`\r
|
|
325
|
+
`),s=ct.getValue(i,"domain",":",!0),o=ct.getValue(i,"user",":",!0),a=ct.getValue(i,"sessionid",":",!0);if(o){let l=t.filter(c=>Kp(c.user,o));e.push({domain:s,user:o,tty:l&&l[0]&&l[0].tty?l[0].tty:a})}}),e}function Yp(n){let t={};return n.forEach(e=>{let r=e.split(`\r
|
|
326
|
+
`),s=ct.getValue(r,"antecedent",":",!0).split("="),o=s.length>2?s[1].split(",")[0].replace(/"/g,"").trim():"",a=s.length>2?s[2].replace(/"/g,"").replace(/\)/g,"").trim():"";s=ct.getValue(r,"dependent",":",!0).split("=");let c=s.length>1?s[1].replace(/"/g,"").replace(/\)/g,"").trim():"";c&&(t[c]={domain:a,user:o})}),t}function Xp(n){n=n.filter(i=>i);let t=[],e=n[0],r=[];if(e){let i=e[0]===" "?1:0;r.push(i-1);let s=0;for(let o=i+1;o<e.length;o++)e[o]===" "&&(e[o-1]===" "||e[o-1]===".")?s=o:s&&(r.push(s),s=0);for(let o=1;o<n.length;o++)if(n[o].trim()){let a=n[o].substring(r[0]+1,r[1]).trim()||"",l=n[o].substring(r[1]+1,r[2]-2).trim()||"";t.push({user:a,tty:l})}}return t}Xo.users=jp});var ra=oe(si=>{"use strict";var de=ue(),kt=process.platform,Jo=kt==="linux"||kt==="android",Qo=kt==="darwin",Zp=kt==="win32",ea=kt==="freebsd",ta=kt==="openbsd",na=kt==="netbsd",Jp=kt==="sunos";function Qp(n,t){return new Promise(e=>{process.nextTick(()=>{let r={url:n,ok:!1,status:404,ms:null};if(typeof n!="string")return t&&t(r),e(r);let i="",s=de.sanitizeShellString(n,!0),o=de.mathMin(s.length,2e3);for(let a=0;a<=o;a++)if(s[a]!==void 0){try{s[a].__proto__.toLowerCase=de.stringToLower}catch{Object.setPrototypeOf(s[a],de.stringObj)}let l=s[a].toLowerCase();l&&l[0]&&!l[1]&&l[0].length===1&&(i=i+l[0])}r.url=i;try{if(i&&!de.isPrototypePolluted()){try{i.__proto__.startsWith=de.stringStartWith}catch{Object.setPrototypeOf(i,de.stringObj)}if(i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return t&&t(r),e(r);de.checkWebsite(i).then(a=>{r.status=a.statusCode,r.ok=a.statusCode>=200&&a.statusCode<=399,r.ms=r.ok?a.time:null,t&&t(r),e(r)})}else t&&t(r),e(r)}catch{t&&t(r),e(r)}})})}si.inetChecksite=Qp;function e0(n,t){return de.isFunction(n)&&!t&&(t=n,n=""),n=n||"8.8.8.8",new Promise(e=>{process.nextTick(()=>{if(typeof n!="string")return t&&t(null),e(null);let r="",i=(de.isPrototypePolluted()?"8.8.8.8":de.sanitizeShellString(n,!0)).trim(),s=de.mathMin(i.length,2e3);for(let a=0;a<=s;a++)if(i[a]!==void 0){try{i[a].__proto__.toLowerCase=de.stringToLower}catch{Object.setPrototypeOf(i[a],de.stringObj)}let l=i[a].toLowerCase();l&&l[0]&&!l[1]&&(r=r+l[0])}try{r.__proto__.startsWith=de.stringStartWith}catch{Object.setPrototypeOf(r,de.stringObj)}if(r.startsWith("file:")||r.startsWith("gopher:")||r.startsWith("telnet:")||r.startsWith("mailto:")||r.startsWith("news:")||r.startsWith("nntp:"))return t&&t(null),e(null);let o;if((Jo||ea||ta||na||Qo)&&(Jo&&(o=["-c","2","-w","3",r]),(ea||ta||na)&&(o=["-c","2","-t","3",r]),Qo&&(o=["-c2","-t3",r]),de.execSafe("ping",o).then(a=>{let l=null;if(a){let u=a.split(`
|
|
331
327
|
`).filter(p=>p.indexOf("rtt")>=0||p.indexOf("round-trip")>=0||p.indexOf("avg")>=0).join(`
|
|
332
|
-
`).split("=");if(u.length>1){let p=u[1].split("/");p.length>1&&(l=parseFloat(p[1]))}}t&&t(l),e(l)})),
|
|
333
|
-
`).filter(
|
|
334
|
-
`).split("=");if(
|
|
335
|
-
`);u.shift(),u.forEach(function(p){if((p.toLowerCase().match(/ms/g)||[]).length===3){let
|
|
328
|
+
`).split("=");if(u.length>1){let p=u[1].split("/");p.length>1&&(l=parseFloat(p[1]))}}t&&t(l),e(l)})),Jp){let a=["-s","-a",r,"56","2"],l="avg";de.execSafe("ping",a,{timeout:3e3}).then(c=>{let u=null;if(c){let d=c.split(`
|
|
329
|
+
`).filter(f=>f.indexOf(l)>=0).join(`
|
|
330
|
+
`).split("=");if(d.length>1){let f=d[1].split("/");f.length>1&&(u=parseFloat(f[1].replace(",",".")))}}t&&t(u),e(u)})}if(Zp){let a=null;try{let l=[r,"-n","1"];de.execSafe("ping",l,de.execOptsWin).then(c=>{if(c){let u=c.split(`\r
|
|
331
|
+
`);u.shift(),u.forEach(function(p){if((p.toLowerCase().match(/ms/g)||[]).length===3){let d=p.replace(/ +/g," ").split(" ");d.length>6&&(a=parseFloat(d[d.length-1]))}})}t&&t(a),e(a)})}catch{t&&t(a),e(a)}}})})}si.inetLatency=e0});var ia=oe((If,sa)=>{"use strict";var Bt=require("net"),t0=require("os").type()==="Windows_NT",Rt=t0?"//./pipe/docker_engine":"/var/run/docker.sock",ii=class{getInfo(t){try{let e=Bt.createConnection({path:Rt}),r="",i;e.on("connect",()=>{e.write(`GET http:/info HTTP/1.0\r
|
|
336
332
|
\r
|
|
337
|
-
`)}),e.on("data",
|
|
333
|
+
`)}),e.on("data",s=>{r=r+s.toString()}),e.on("error",()=>{e=!1,t({})}),e.on("end",()=>{let s=r.indexOf(`\r
|
|
338
334
|
\r
|
|
339
|
-
`);r=r.substring(
|
|
335
|
+
`);r=r.substring(s+4),e=!1;try{i=JSON.parse(r),t(i)}catch{t({})}})}catch{t({})}}listImages(t,e){try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/images/json"+(t?"?all=1":"")+` HTTP/1.0\r
|
|
340
336
|
\r
|
|
341
337
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
342
338
|
\r
|
|
343
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
339
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}inspectImage(t,e){if(t=t||"",t)try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/images/"+t+`/json?stream=0 HTTP/1.0\r
|
|
344
340
|
\r
|
|
345
341
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
346
342
|
\r
|
|
347
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
343
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listContainers(t,e){try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/json"+(t?"?all=1":"")+` HTTP/1.0\r
|
|
348
344
|
\r
|
|
349
345
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
350
346
|
\r
|
|
351
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
347
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}getStats(t,e){if(t=t||"",t)try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/stats?stream=0 HTTP/1.0\r
|
|
352
348
|
\r
|
|
353
349
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
354
350
|
\r
|
|
355
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
351
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getInspect(t,e){if(t=t||"",t)try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/json?stream=0 HTTP/1.0\r
|
|
356
352
|
\r
|
|
357
353
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
358
354
|
\r
|
|
359
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
355
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getProcesses(t,e){if(t=t||"",t)try{let r=Bt.createConnection({path:Rt}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r
|
|
360
356
|
\r
|
|
361
357
|
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
362
358
|
\r
|
|
363
|
-
`);i=i.substring(o+4),r=!1;try{
|
|
359
|
+
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listVolumes(t){try{let e=Bt.createConnection({path:Rt}),r="",i;e.on("connect",()=>{e.write(`GET http:/volumes HTTP/1.0\r
|
|
364
360
|
\r
|
|
365
|
-
`)}),e.on("data",
|
|
361
|
+
`)}),e.on("data",s=>{r=r+s.toString()}),e.on("error",()=>{e=!1,t({})}),e.on("end",()=>{let s=r.indexOf(`\r
|
|
366
362
|
\r
|
|
367
|
-
`);r=r.substring(n+4),e=!1;try{i=JSON.parse(r),t(i)}catch{t({})}})}catch{t({})}}};sa.exports=ai});var ia=le(Bt=>{"use strict";var pe=ce(),Ft=ra(),Gp=process.platform,jp=Gp==="win32",Gs={},oe,li=0;function zp(s){return new Promise(t=>{process.nextTick(()=>{oe||(oe=new Ft);let e={};oe.getInfo(r=>{e.id=r.ID,e.containers=r.Containers,e.containersRunning=r.ContainersRunning,e.containersPaused=r.ContainersPaused,e.containersStopped=r.ContainersStopped,e.images=r.Images,e.driver=r.Driver,e.memoryLimit=r.MemoryLimit,e.swapLimit=r.SwapLimit,e.kernelMemory=r.KernelMemory,e.cpuCfsPeriod=r.CpuCfsPeriod,e.cpuCfsQuota=r.CpuCfsQuota,e.cpuShares=r.CPUShares,e.cpuSet=r.CPUSet,e.ipv4Forwarding=r.IPv4Forwarding,e.bridgeNfIptables=r.BridgeNfIptables,e.bridgeNfIp6tables=r.BridgeNfIp6tables,e.debug=r.Debug,e.nfd=r.NFd,e.oomKillDisable=r.OomKillDisable,e.ngoroutines=r.NGoroutines,e.systemTime=r.SystemTime,e.loggingDriver=r.LoggingDriver,e.cgroupDriver=r.CgroupDriver,e.nEventsListener=r.NEventsListener,e.kernelVersion=r.KernelVersion,e.operatingSystem=r.OperatingSystem,e.osType=r.OSType,e.architecture=r.Architecture,e.ncpu=r.NCPU,e.memTotal=r.MemTotal,e.dockerRootDir=r.DockerRootDir,e.httpProxy=r.HttpProxy,e.httpsProxy=r.HttpsProxy,e.noProxy=r.NoProxy,e.name=r.Name,e.labels=r.Labels,e.experimentalBuild=r.ExperimentalBuild,e.serverVersion=r.ServerVersion,e.clusterStore=r.ClusterStore,e.clusterAdvertise=r.ClusterAdvertise,e.defaultRuntime=r.DefaultRuntime,e.liveRestoreEnabled=r.LiveRestoreEnabled,e.isolation=r.Isolation,e.initBinary=r.InitBinary,e.productLicense=r.ProductLicense,s&&s(e),t(e)})})})}Bt.dockerInfo=zp;function qp(s,t){pe.isFunction(s)&&!t&&(t=s,s=!1),typeof s=="string"&&s==="true"&&(s=!0),typeof s!="boolean"&&s!==void 0&&(s=!1),s=s||!1;let e=[];return new Promise(r=>{process.nextTick(()=>{oe||(oe=new Ft);let i=[];oe.listImages(s,n=>{let o={};try{o=n,o&&Object.prototype.toString.call(o)==="[object Array]"&&o.length>0?(o.forEach(function(a){a.Names&&Object.prototype.toString.call(a.Names)==="[object Array]"&&a.Names.length>0&&(a.Name=a.Names[0].replace(/^\/|\/$/g,"")),i.push(Hp(a.Id.trim(),a))}),i.length?Promise.all(i).then(a=>{t&&t(a),r(a)}):(t&&t(e),r(e))):(t&&t(e),r(e))}catch{t&&t(e),r(e)}})})})}function Hp(s,t){return new Promise(e=>{process.nextTick(()=>{if(s=s||"",typeof s!="string")return e();let r=(pe.isPrototypePolluted()?"":pe.sanitizeShellString(s,!0)).trim();r?(oe||(oe=new Ft),oe.inspectImage(r.trim(),i=>{try{e({id:t.Id,container:i.Container,comment:i.Comment,os:i.Os,architecture:i.Architecture,parent:i.Parent,dockerVersion:i.DockerVersion,size:i.Size,sharedSize:t.SharedSize,virtualSize:i.VirtualSize,author:i.Author,created:i.Created?Math.round(new Date(i.Created).getTime()/1e3):0,containerConfig:i.ContainerConfig?i.ContainerConfig:{},graphDriver:i.GraphDriver?i.GraphDriver:{},repoDigests:i.RepoDigests?i.RepoDigests:{},repoTags:i.RepoTags?i.RepoTags:{},config:i.Config?i.Config:{},rootFS:i.RootFS?i.RootFS:{}})}catch{e()}})):e()})})}Bt.dockerImages=qp;function ci(s,t){function e(i,n){return i.filter(a=>a.Id&&a.Id===n).length>0}pe.isFunction(s)&&!t&&(t=s,s=!1),typeof s=="string"&&s==="true"&&(s=!0),typeof s!="boolean"&&s!==void 0&&(s=!1),s=s||!1;let r=[];return new Promise(i=>{process.nextTick(()=>{oe||(oe=new Ft);let n=[];oe.listContainers(s,o=>{let a={};try{if(a=o,a&&Object.prototype.toString.call(a)==="[object Array]"&&a.length>0){for(let l in Gs)({}).hasOwnProperty.call(Gs,l)&&(e(a,l)||delete Gs[l]);a.forEach(function(l){l.Names&&Object.prototype.toString.call(l.Names)==="[object Array]"&&l.Names.length>0&&(l.Name=l.Names[0].replace(/^\/|\/$/g,"")),n.push($p(l.Id.trim(),l))}),n.length?Promise.all(n).then(l=>{t&&t(l),i(l)}):(t&&t(r),i(r))}else t&&t(r),i(r)}catch{for(let c in Gs)({}).hasOwnProperty.call(Gs,c)&&(e(a,c)||delete Gs[c]);t&&t(r),i(r)}})})})}function $p(s,t){return new Promise(e=>{process.nextTick(()=>{if(s=s||"",typeof s!="string")return e();let r=(pe.isPrototypePolluted()?"":pe.sanitizeShellString(s,!0)).trim();r?(oe||(oe=new Ft),oe.getInspect(r.trim(),i=>{try{e({id:t.Id,name:t.Name,image:t.Image,imageID:t.ImageID,command:t.Command,created:t.Created,started:i.State&&i.State.StartedAt?Math.round(new Date(i.State.StartedAt).getTime()/1e3):0,finished:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(i.State.FinishedAt).getTime()/1e3):0,createdAt:i.Created?i.Created:"",startedAt:i.State&&i.State.StartedAt?i.State.StartedAt:"",finishedAt:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?i.State.FinishedAt:"",state:t.State,restartCount:i.RestartCount||0,platform:i.Platform||"",driver:i.Driver||"",ports:t.Ports,mounts:t.Mounts})}catch{e()}})):e()})})}Bt.dockerContainers=ci;function Yp(s,t){if(jp){let e=pe.nanoSeconds(),r=0;if(li>0){let i=e-li,n=s.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(r=100*n/i)}return li=e,r}else{let e=0,r=s.cpu_usage.total_usage-t.cpu_usage.total_usage,i=s.system_cpu_usage-t.system_cpu_usage;return i>0&&r>0&&(t.online_cpus?e=r/i*t.online_cpus*100:e=r/i*s.cpu_usage.percpu_usage.length*100),e}}function Xp(s){let t,e;for(let r in s){if(!{}.hasOwnProperty.call(s,r))continue;let i=s[r];t=+i.rx_bytes,e=+i.tx_bytes}return{rx:t,wx:e}}function Kp(s){let t={r:0,w:0};return s&&s.io_service_bytes_recursive&&Object.prototype.toString.call(s.io_service_bytes_recursive)==="[object Array]"&&s.io_service_bytes_recursive.length>0&&s.io_service_bytes_recursive.forEach(function(e){e.op&&e.op.toLowerCase()==="read"&&e.value&&(t.r+=e.value),e.op&&e.op.toLowerCase()==="write"&&e.value&&(t.w+=e.value)}),t}function ui(s,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(pe.isFunction(s)&&!t)t=s,e=["*"];else{if(s=s||"*",typeof s!="string")return t&&t([]),r([]);let o="";if(o.__proto__.toLowerCase=pe.stringToLower,o.__proto__.replace=pe.stringReplace,o.__proto__.trim=pe.stringTrim,o=s,o=o.trim(),o!=="*"){o="";let a=(pe.isPrototypePolluted()?"":pe.sanitizeShellString(s,!0)).trim(),l=pe.mathMin(a.length,2e3);for(let c=0;c<=l;c++)if(a[c]!==void 0){a[c].__proto__.toLowerCase=pe.stringToLower;let u=a[c].toLowerCase();u&&u[0]&&!u[1]&&(o=o+u[0])}}o=o.trim().toLowerCase().replace(/,+/g,"|"),e=o.split("|")}let i=[],n=[];if(e.length&&e[0].trim()==="*")e=[],ci().then(o=>{for(let a of o)e.push(a.id.substring(0,12));e.length?ui(e.join(",")).then(a=>{t&&t(a),r(a)}):(t&&t(i),r(i))});else{for(let o of e)n.push(Zp(o.trim()));n.length?Promise.all(n).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function Zp(s){s=s||"";let t={id:s,memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0},restartCount:0,cpuStats:{},precpuStats:{},memoryStats:{},networks:{}};return new Promise(e=>{process.nextTick(()=>{s?(oe||(oe=new Ft),oe.getInspect(s,r=>{try{oe.getStats(s,i=>{try{let n=i;n.message||(i.id&&(t.id=i.id),t.memUsage=n.memory_stats&&n.memory_stats.usage?n.memory_stats.usage:0,t.memLimit=n.memory_stats&&n.memory_stats.limit?n.memory_stats.limit:0,t.memPercent=n.memory_stats&&n.memory_stats.usage&&n.memory_stats.limit?n.memory_stats.usage/n.memory_stats.limit*100:0,t.cpuPercent=n.cpu_stats&&n.precpu_stats?Yp(n.cpu_stats,n.precpu_stats):0,t.pids=n.pids_stats&&n.pids_stats.current?n.pids_stats.current:0,t.restartCount=r.RestartCount?r.RestartCount:0,n.networks&&(t.netIO=Xp(n.networks)),n.blkio_stats&&(t.blockIO=Kp(n.blkio_stats)),t.cpuStats=n.cpu_stats?n.cpu_stats:{},t.precpuStats=n.precpu_stats?n.precpu_stats:{},t.memoryStats=n.memory_stats?n.memory_stats:{},t.networks=n.networks?n.networks:{})}catch{pe.noop()}e(t)})}catch{pe.noop()}})):e(t)})})}Bt.dockerContainerStats=ui;function na(s,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(s=s||"",typeof s!="string")return r(e);let i=(pe.isPrototypePolluted()?"":pe.sanitizeShellString(s,!0)).trim();i?(oe||(oe=new Ft),oe.getProcesses(i,n=>{try{if(n&&n.Titles&&n.Processes){let o=n.Titles.map(function(x){return x.toUpperCase()}),a=o.indexOf("PID"),l=o.indexOf("PPID"),c=o.indexOf("PGID"),u=o.indexOf("VSZ"),p=o.indexOf("TIME"),f=o.indexOf("ELAPSED"),d=o.indexOf("NI"),m=o.indexOf("RUSER"),g=o.indexOf("USER"),_=o.indexOf("RGROUP"),h=o.indexOf("GROUP"),y=o.indexOf("STAT"),S=o.indexOf("RSS"),v=o.indexOf("COMMAND");n.Processes.forEach(x=>{e.push({pidHost:a>=0?x[a]:"",ppid:l>=0?x[l]:"",pgid:c>=0?x[c]:"",user:g>=0?x[g]:"",ruser:m>=0?x[m]:"",group:h>=0?x[h]:"",rgroup:_>=0?x[_]:"",stat:y>=0?x[y]:"",time:p>=0?x[p]:"",elapsed:f>=0?x[f]:"",nice:d>=0?x[d]:"",rss:S>=0?x[S]:"",vsz:u>=0?x[u]:"",command:v>=0?x[v]:""})})}}catch{pe.noop()}t&&t(e),r(e)})):(t&&t(e),r(e))})})}Bt.dockerContainerProcesses=na;function Jp(s){let t=[];return new Promise(e=>{process.nextTick(()=>{oe||(oe=new Ft),oe.listVolumes(r=>{let i={};try{i=r,i&&i.Volumes&&Object.prototype.toString.call(i.Volumes)==="[object Array]"&&i.Volumes.length>0?(i.Volumes.forEach(function(n){t.push({name:n.Name,driver:n.Driver,labels:n.Labels,mountpoint:n.Mountpoint,options:n.Options,scope:n.Scope,created:n.CreatedAt?Math.round(new Date(n.CreatedAt).getTime()/1e3):0})}),s&&s(t),e(t)):(s&&s(t),e(t))}catch{s&&s(t),e(t)}})})})}Bt.dockerVolumes=Jp;function Qp(s){return new Promise(t=>{process.nextTick(()=>{ci(!0).then(e=>{if(e&&Object.prototype.toString.call(e)==="[object Array]"&&e.length>0){let r=e.length;e.forEach(function(i){ui(i.id).then(n=>{i.memUsage=n[0].memUsage,i.memLimit=n[0].memLimit,i.memPercent=n[0].memPercent,i.cpuPercent=n[0].cpuPercent,i.pids=n[0].pids,i.netIO=n[0].netIO,i.blockIO=n[0].blockIO,i.cpuStats=n[0].cpuStats,i.precpuStats=n[0].precpuStats,i.memoryStats=n[0].memoryStats,i.networks=n[0].networks,na(i.id).then(o=>{i.processes=o,r-=1,r===0&&(s&&s(e),t(e))})})})}else s&&s(e),t(e)})})})}Bt.dockerAll=Qp});var aa=le(oa=>{"use strict";var pi=require("os"),ef=require("child_process").exec,ee=ce();function tf(s){let t=[];return new Promise(e=>{process.nextTick(()=>{try{ef(ee.getVboxmanage()+" list vms --long",function(r,i){let n=(pi.EOL+i.toString()).split(pi.EOL+"Name:");n.shift(),n.forEach(o=>{let a=("Name:"+o).split(pi.EOL),l=ee.getValue(a,"State"),c=l.startsWith("running"),u=c?l.replace("running (since ","").replace(")","").trim():"",p=0;try{if(c){let m=new Date(u),g=m.getTimezoneOffset();p=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{ee.noop()}let f=c?"":l.replace("powered off (since","").replace(")","").trim(),d=0;try{if(!c){let m=new Date(f),g=m.getTimezoneOffset();d=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{ee.noop()}t.push({id:ee.getValue(a,"UUID"),name:ee.getValue(a,"Name"),running:c,started:u,runningSince:p,stopped:f,stoppedSince:d,guestOS:ee.getValue(a,"Guest OS"),hardwareUUID:ee.getValue(a,"Hardware UUID"),memory:parseInt(ee.getValue(a,"Memory size"," "),10),vram:parseInt(ee.getValue(a,"VRAM size"),10),cpus:parseInt(ee.getValue(a,"Number of CPUs"),10),cpuExepCap:ee.getValue(a,"CPU exec cap"),cpuProfile:ee.getValue(a,"CPUProfile"),chipset:ee.getValue(a,"Chipset"),firmware:ee.getValue(a,"Firmware"),pageFusion:ee.getValue(a,"Page Fusion")==="enabled",configFile:ee.getValue(a,"Config file"),snapshotFolder:ee.getValue(a,"Snapshot folder"),logFolder:ee.getValue(a,"Log folder"),hpet:ee.getValue(a,"HPET")==="enabled",pae:ee.getValue(a,"PAE")==="enabled",longMode:ee.getValue(a,"Long Mode")==="enabled",tripleFaultReset:ee.getValue(a,"Triple Fault Reset")==="enabled",apic:ee.getValue(a,"APIC")==="enabled",x2Apic:ee.getValue(a,"X2APIC")==="enabled",acpi:ee.getValue(a,"ACPI")==="enabled",ioApic:ee.getValue(a,"IOAPIC")==="enabled",biosApicMode:ee.getValue(a,"BIOS APIC mode"),bootMenuMode:ee.getValue(a,"Boot menu mode"),bootDevice1:ee.getValue(a,"Boot Device 1"),bootDevice2:ee.getValue(a,"Boot Device 2"),bootDevice3:ee.getValue(a,"Boot Device 3"),bootDevice4:ee.getValue(a,"Boot Device 4"),timeOffset:ee.getValue(a,"Time offset"),rtc:ee.getValue(a,"RTC")})}),s&&s(t),e(t)})}catch{s&&s(t),e(t)}})})}oa.vboxInfo=tf});var pa=le(ua=>{"use strict";var fi=require("child_process").exec,ye=ce(),Wt=process.platform,la=Wt==="linux"||Wt==="android",sf=Wt==="darwin",rf=Wt==="win32",nf=Wt==="freebsd",of=Wt==="openbsd",af=Wt==="netbsd",lf=Wt==="sunos",ca={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function cf(s){let t={};if(s&&s.length&&s[0].indexOf(" CUPS v")>0){let e=s[0].split(" CUPS v");t.cupsVersion=e[1]}return t}function uf(s){let t={},e=ye.getValue(s,"PrinterId"," ");return t.id=e?parseInt(e,10):null,t.name=ye.getValue(s,"Info"," "),t.model=s.length>0&&s[0]?s[0].split(" ")[0]:"",t.uri=ye.getValue(s,"DeviceURI"," "),t.uuid=ye.getValue(s,"UUID"," "),t.status=ye.getValue(s,"State"," "),t.local=ye.getValue(s,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=ye.getValue(s,"Shared"," ").toLowerCase().startsWith("yes"),t}function pf(s,t){let e={};return e.id=t,e.name=ye.getValue(s,"Description",":",!0),e.model=s.length>0&&s[0]?s[0].split(" ")[0]:"",e.uri=null,e.uuid=null,e.status=s.length>0&&s[0]?s[0].indexOf(" idle")>0?"idle":s[0].indexOf(" printing")>0?"printing":"unknown":null,e.local=ye.getValue(s,"Location",":",!0).toLowerCase().startsWith("local"),e.default=null,e.shared=ye.getValue(s,"Shared"," ").toLowerCase().startsWith("yes"),e}function ff(s,t){let e={},r=s.uri.split("/");return e.id=t,e.name=s._name,e.model=r.length?r[r.length-1]:"",e.uri=s.uri,e.uuid=null,e.status=s.status,e.local=s.printserver==="local",e.default=s.default==="yes",e.shared=s.shared==="yes",e}function df(s,t){let e={},r=parseInt(ye.getValue(s,"PrinterStatus",":"),10);return e.id=t,e.name=ye.getValue(s,"name",":"),e.model=ye.getValue(s,"DriverName",":"),e.uri=null,e.uuid=null,e.status=ca[r]?ca[r]:null,e.local=ye.getValue(s,"Local",":").toUpperCase()==="TRUE",e.default=ye.getValue(s,"Default",":").toUpperCase()==="TRUE",e.shared=ye.getValue(s,"Shared",":").toUpperCase()==="TRUE",e}function mf(s){return new Promise(t=>{process.nextTick(()=>{let e=[];if(la||nf||of||af){let r="cat /etc/cups/printers.conf 2>/dev/null";fi(r,function(i,n){if(!i){let o=n.toString().split("<Printer "),a=cf(o[0]);for(let l=1;l<o.length;l++){let c=uf(o[l].split(`
|
|
368
|
-
`));c.name&&(c.engine="CUPS",c.engineVersion=a.cupsVersion,e.push(c))}}e.length===0&&
|
|
363
|
+
`);r=r.substring(s+4),e=!1;try{i=JSON.parse(r),t(i)}catch{t({})}})}catch{t({})}}};sa.exports=ii});var aa=oe(Gt=>{"use strict";var ae=ue(),Ft=ia(),n0=process.platform,r0=n0==="win32",jn={},le,oi=0;function s0(n){return new Promise(t=>{process.nextTick(()=>{le||(le=new Ft);let e={};le.getInfo(r=>{e.id=r.ID,e.containers=r.Containers,e.containersRunning=r.ContainersRunning,e.containersPaused=r.ContainersPaused,e.containersStopped=r.ContainersStopped,e.images=r.Images,e.driver=r.Driver,e.memoryLimit=r.MemoryLimit,e.swapLimit=r.SwapLimit,e.kernelMemory=r.KernelMemory,e.cpuCfsPeriod=r.CpuCfsPeriod,e.cpuCfsQuota=r.CpuCfsQuota,e.cpuShares=r.CPUShares,e.cpuSet=r.CPUSet,e.ipv4Forwarding=r.IPv4Forwarding,e.bridgeNfIptables=r.BridgeNfIptables,e.bridgeNfIp6tables=r.BridgeNfIp6tables,e.debug=r.Debug,e.nfd=r.NFd,e.oomKillDisable=r.OomKillDisable,e.ngoroutines=r.NGoroutines,e.systemTime=r.SystemTime,e.loggingDriver=r.LoggingDriver,e.cgroupDriver=r.CgroupDriver,e.nEventsListener=r.NEventsListener,e.kernelVersion=r.KernelVersion,e.operatingSystem=r.OperatingSystem,e.osType=r.OSType,e.architecture=r.Architecture,e.ncpu=r.NCPU,e.memTotal=r.MemTotal,e.dockerRootDir=r.DockerRootDir,e.httpProxy=r.HttpProxy,e.httpsProxy=r.HttpsProxy,e.noProxy=r.NoProxy,e.name=r.Name,e.labels=r.Labels,e.experimentalBuild=r.ExperimentalBuild,e.serverVersion=r.ServerVersion,e.clusterStore=r.ClusterStore,e.clusterAdvertise=r.ClusterAdvertise,e.defaultRuntime=r.DefaultRuntime,e.liveRestoreEnabled=r.LiveRestoreEnabled,e.isolation=r.Isolation,e.initBinary=r.InitBinary,e.productLicense=r.ProductLicense,n&&n(e),t(e)})})})}Gt.dockerInfo=s0;function i0(n,t){ae.isFunction(n)&&!t&&(t=n,n=!1),typeof n=="string"&&n==="true"&&(n=!0),typeof n!="boolean"&&n!==void 0&&(n=!1),n=n||!1;let e=[];return new Promise(r=>{process.nextTick(()=>{le||(le=new Ft);let i=[];le.listImages(n,s=>{let o={};try{o=s,o&&Object.prototype.toString.call(o)==="[object Array]"&&o.length>0?(o.forEach(function(a){a.Names&&Object.prototype.toString.call(a.Names)==="[object Array]"&&a.Names.length>0&&(a.Name=a.Names[0].replace(/^\/|\/$/g,"")),i.push(o0(a.Id.trim(),a))}),i.length?Promise.all(i).then(a=>{t&&t(a),r(a)}):(t&&t(e),r(e))):(t&&t(e),r(e))}catch{t&&t(e),r(e)}})})})}function o0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(ae.isPrototypePolluted()?"":ae.sanitizeShellString(n,!0)).trim();r?(le||(le=new Ft),le.inspectImage(r.trim(),i=>{try{e({id:t.Id,container:i.Container,comment:i.Comment,os:i.Os,architecture:i.Architecture,parent:i.Parent,dockerVersion:i.DockerVersion,size:i.Size,sharedSize:t.SharedSize,virtualSize:i.VirtualSize,author:i.Author,created:i.Created?Math.round(new Date(i.Created).getTime()/1e3):0,containerConfig:i.ContainerConfig?i.ContainerConfig:{},graphDriver:i.GraphDriver?i.GraphDriver:{},repoDigests:i.RepoDigests?i.RepoDigests:{},repoTags:i.RepoTags?i.RepoTags:{},config:i.Config?i.Config:{},rootFS:i.RootFS?i.RootFS:{}})}catch{e()}})):e()})})}Gt.dockerImages=i0;function ai(n,t){function e(i,s){return i.filter(a=>a.Id&&a.Id===s).length>0}ae.isFunction(n)&&!t&&(t=n,n=!1),typeof n=="string"&&n==="true"&&(n=!0),typeof n!="boolean"&&n!==void 0&&(n=!1),n=n||!1;let r=[];return new Promise(i=>{process.nextTick(()=>{le||(le=new Ft);let s=[];le.listContainers(n,o=>{let a={};try{if(a=o,a&&Object.prototype.toString.call(a)==="[object Array]"&&a.length>0){for(let l in jn)({}).hasOwnProperty.call(jn,l)&&(e(a,l)||delete jn[l]);a.forEach(function(l){l.Names&&Object.prototype.toString.call(l.Names)==="[object Array]"&&l.Names.length>0&&(l.Name=l.Names[0].replace(/^\/|\/$/g,"")),s.push(a0(l.Id.trim(),l))}),s.length?Promise.all(s).then(l=>{t&&t(l),i(l)}):(t&&t(r),i(r))}else t&&t(r),i(r)}catch{for(let c in jn)({}).hasOwnProperty.call(jn,c)&&(e(a,c)||delete jn[c]);t&&t(r),i(r)}})})})}function a0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(ae.isPrototypePolluted()?"":ae.sanitizeShellString(n,!0)).trim();r?(le||(le=new Ft),le.getInspect(r.trim(),i=>{try{e({id:t.Id,name:t.Name,image:t.Image,imageID:t.ImageID,command:t.Command,created:t.Created,started:i.State&&i.State.StartedAt?Math.round(new Date(i.State.StartedAt).getTime()/1e3):0,finished:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(i.State.FinishedAt).getTime()/1e3):0,createdAt:i.Created?i.Created:"",startedAt:i.State&&i.State.StartedAt?i.State.StartedAt:"",finishedAt:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?i.State.FinishedAt:"",state:t.State,restartCount:i.RestartCount||0,platform:i.Platform||"",driver:i.Driver||"",ports:t.Ports,mounts:t.Mounts})}catch{e()}})):e()})})}Gt.dockerContainers=ai;function l0(n,t){if(r0){let e=ae.nanoSeconds(),r=0;if(oi>0){let i=e-oi,s=n.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(r=100*s/i)}return oi=e,r}else{let e=0,r=n.cpu_usage.total_usage-t.cpu_usage.total_usage,i=n.system_cpu_usage-t.system_cpu_usage;return i>0&&r>0&&(t.online_cpus?e=r/i*t.online_cpus*100:e=r/i*n.cpu_usage.percpu_usage.length*100),e}}function c0(n){let t,e;for(let r in n){if(!{}.hasOwnProperty.call(n,r))continue;let i=n[r];t=+i.rx_bytes,e=+i.tx_bytes}return{rx:t,wx:e}}function u0(n){let t={r:0,w:0};return n&&n.io_service_bytes_recursive&&Object.prototype.toString.call(n.io_service_bytes_recursive)==="[object Array]"&&n.io_service_bytes_recursive.length>0&&n.io_service_bytes_recursive.forEach(function(e){e.op&&e.op.toLowerCase()==="read"&&e.value&&(t.r+=e.value),e.op&&e.op.toLowerCase()==="write"&&e.value&&(t.w+=e.value)}),t}function li(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(ae.isFunction(n)&&!t)t=n,e=["*"];else{if(n=n||"*",typeof n!="string")return t&&t([]),r([]);let o="";try{o.__proto__.toLowerCase=ae.stringToLower,o.__proto__.replace=ae.stringReplace,o.__proto__.toString=ae.stringToString,o.__proto__.substr=ae.stringSubstr,o.__proto__.substring=ae.stringSubstring,o.__proto__.trim=ae.stringTrim,o.__proto__.startsWith=ae.stringStartWith}catch{Object.setPrototypeOf(o,ae.stringObj)}if(o=n,o=o.trim(),o!=="*"){o="";let a=(ae.isPrototypePolluted()?"":ae.sanitizeShellString(n,!0)).trim(),l=ae.mathMin(a.length,2e3);for(let c=0;c<=l;c++)if(a[c]!==void 0){a[c].__proto__.toLowerCase=ae.stringToLower;let u=a[c].toLowerCase();u&&u[0]&&!u[1]&&(o=o+u[0])}}o=o.trim().toLowerCase().replace(/,+/g,"|"),e=o.split("|")}let i=[],s=[];if(e.length&&e[0].trim()==="*")e=[],ai().then(o=>{for(let a of o)e.push(a.id.substring(0,12));e.length?li(e.join(",")).then(a=>{t&&t(a),r(a)}):(t&&t(i),r(i))});else{for(let o of e)s.push(p0(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function p0(n){n=n||"";let t={id:n,memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0},restartCount:0,cpuStats:{},precpuStats:{},memoryStats:{},networks:{}};return new Promise(e=>{process.nextTick(()=>{n?(le||(le=new Ft),le.getInspect(n,r=>{try{le.getStats(n,i=>{try{let s=i;s.message||(i.id&&(t.id=i.id),t.memUsage=s.memory_stats&&s.memory_stats.usage?s.memory_stats.usage:0,t.memLimit=s.memory_stats&&s.memory_stats.limit?s.memory_stats.limit:0,t.memPercent=s.memory_stats&&s.memory_stats.usage&&s.memory_stats.limit?s.memory_stats.usage/s.memory_stats.limit*100:0,t.cpuPercent=s.cpu_stats&&s.precpu_stats?l0(s.cpu_stats,s.precpu_stats):0,t.pids=s.pids_stats&&s.pids_stats.current?s.pids_stats.current:0,t.restartCount=r.RestartCount?r.RestartCount:0,s.networks&&(t.netIO=c0(s.networks)),s.blkio_stats&&(t.blockIO=u0(s.blkio_stats)),t.cpuStats=s.cpu_stats?s.cpu_stats:{},t.precpuStats=s.precpu_stats?s.precpu_stats:{},t.memoryStats=s.memory_stats?s.memory_stats:{},t.networks=s.networks?s.networks:{})}catch{ae.noop()}e(t)})}catch{ae.noop()}})):e(t)})})}Gt.dockerContainerStats=li;function oa(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return r(e);let i=(ae.isPrototypePolluted()?"":ae.sanitizeShellString(n,!0)).trim();i?(le||(le=new Ft),le.getProcesses(i,s=>{try{if(s&&s.Titles&&s.Processes){let o=s.Titles.map(function(C){return C.toUpperCase()}),a=o.indexOf("PID"),l=o.indexOf("PPID"),c=o.indexOf("PGID"),u=o.indexOf("VSZ"),p=o.indexOf("TIME"),d=o.indexOf("ELAPSED"),f=o.indexOf("NI"),m=o.indexOf("RUSER"),g=o.indexOf("USER"),x=o.indexOf("RGROUP"),h=o.indexOf("GROUP"),y=o.indexOf("STAT"),S=o.indexOf("RSS"),_=o.indexOf("COMMAND");s.Processes.forEach(C=>{e.push({pidHost:a>=0?C[a]:"",ppid:l>=0?C[l]:"",pgid:c>=0?C[c]:"",user:g>=0?C[g]:"",ruser:m>=0?C[m]:"",group:h>=0?C[h]:"",rgroup:x>=0?C[x]:"",stat:y>=0?C[y]:"",time:p>=0?C[p]:"",elapsed:d>=0?C[d]:"",nice:f>=0?C[f]:"",rss:S>=0?C[S]:"",vsz:u>=0?C[u]:"",command:_>=0?C[_]:""})})}}catch{ae.noop()}t&&t(e),r(e)})):(t&&t(e),r(e))})})}Gt.dockerContainerProcesses=oa;function d0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{le||(le=new Ft),le.listVolumes(r=>{let i={};try{i=r,i&&i.Volumes&&Object.prototype.toString.call(i.Volumes)==="[object Array]"&&i.Volumes.length>0?(i.Volumes.forEach(function(s){t.push({name:s.Name,driver:s.Driver,labels:s.Labels,mountpoint:s.Mountpoint,options:s.Options,scope:s.Scope,created:s.CreatedAt?Math.round(new Date(s.CreatedAt).getTime()/1e3):0})}),n&&n(t),e(t)):(n&&n(t),e(t))}catch{n&&n(t),e(t)}})})})}Gt.dockerVolumes=d0;function f0(n){return new Promise(t=>{process.nextTick(()=>{ai(!0).then(e=>{if(e&&Object.prototype.toString.call(e)==="[object Array]"&&e.length>0){let r=e.length;e.forEach(function(i){li(i.id).then(s=>{i.memUsage=s[0].memUsage,i.memLimit=s[0].memLimit,i.memPercent=s[0].memPercent,i.cpuPercent=s[0].cpuPercent,i.pids=s[0].pids,i.netIO=s[0].netIO,i.blockIO=s[0].blockIO,i.cpuStats=s[0].cpuStats,i.precpuStats=s[0].precpuStats,i.memoryStats=s[0].memoryStats,i.networks=s[0].networks,oa(i.id).then(o=>{i.processes=o,r-=1,r===0&&(n&&n(e),t(e))})})})}else n&&n(e),t(e)})})})}Gt.dockerAll=f0});var ca=oe(la=>{"use strict";var ci=require("os"),m0=require("child_process").exec,te=ue();function h0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{try{m0(te.getVboxmanage()+" list vms --long",function(r,i){let s=(ci.EOL+i.toString()).split(ci.EOL+"Name:");s.shift(),s.forEach(o=>{let a=("Name:"+o).split(ci.EOL),l=te.getValue(a,"State"),c=l.startsWith("running"),u=c?l.replace("running (since ","").replace(")","").trim():"",p=0;try{if(c){let m=new Date(u),g=m.getTimezoneOffset();p=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{te.noop()}let d=c?"":l.replace("powered off (since","").replace(")","").trim(),f=0;try{if(!c){let m=new Date(d),g=m.getTimezoneOffset();f=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{te.noop()}t.push({id:te.getValue(a,"UUID"),name:te.getValue(a,"Name"),running:c,started:u,runningSince:p,stopped:d,stoppedSince:f,guestOS:te.getValue(a,"Guest OS"),hardwareUUID:te.getValue(a,"Hardware UUID"),memory:parseInt(te.getValue(a,"Memory size"," "),10),vram:parseInt(te.getValue(a,"VRAM size"),10),cpus:parseInt(te.getValue(a,"Number of CPUs"),10),cpuExepCap:te.getValue(a,"CPU exec cap"),cpuProfile:te.getValue(a,"CPUProfile"),chipset:te.getValue(a,"Chipset"),firmware:te.getValue(a,"Firmware"),pageFusion:te.getValue(a,"Page Fusion")==="enabled",configFile:te.getValue(a,"Config file"),snapshotFolder:te.getValue(a,"Snapshot folder"),logFolder:te.getValue(a,"Log folder"),hpet:te.getValue(a,"HPET")==="enabled",pae:te.getValue(a,"PAE")==="enabled",longMode:te.getValue(a,"Long Mode")==="enabled",tripleFaultReset:te.getValue(a,"Triple Fault Reset")==="enabled",apic:te.getValue(a,"APIC")==="enabled",x2Apic:te.getValue(a,"X2APIC")==="enabled",acpi:te.getValue(a,"ACPI")==="enabled",ioApic:te.getValue(a,"IOAPIC")==="enabled",biosApicMode:te.getValue(a,"BIOS APIC mode"),bootMenuMode:te.getValue(a,"Boot menu mode"),bootDevice1:te.getValue(a,"Boot Device 1"),bootDevice2:te.getValue(a,"Boot Device 2"),bootDevice3:te.getValue(a,"Boot Device 3"),bootDevice4:te.getValue(a,"Boot Device 4"),timeOffset:te.getValue(a,"Time offset"),rtc:te.getValue(a,"RTC")})}),n&&n(t),e(t)})}catch{n&&n(t),e(t)}})})}la.vboxInfo=h0});var fa=oe(da=>{"use strict";var ui=require("child_process").exec,xe=ue(),Wt=process.platform,ua=Wt==="linux"||Wt==="android",g0=Wt==="darwin",y0=Wt==="win32",x0=Wt==="freebsd",S0=Wt==="openbsd",_0=Wt==="netbsd",C0=Wt==="sunos",pa={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function v0(n){let t={};if(n&&n.length&&n[0].indexOf(" CUPS v")>0){let e=n[0].split(" CUPS v");t.cupsVersion=e[1]}return t}function w0(n){let t={},e=xe.getValue(n,"PrinterId"," ");return t.id=e?parseInt(e,10):null,t.name=xe.getValue(n,"Info"," "),t.model=n.length>0&&n[0]?n[0].split(" ")[0]:"",t.uri=xe.getValue(n,"DeviceURI"," "),t.uuid=xe.getValue(n,"UUID"," "),t.status=xe.getValue(n,"State"," "),t.local=xe.getValue(n,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=xe.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),t}function I0(n,t){let e={};return e.id=t,e.name=xe.getValue(n,"Description",":",!0),e.model=n.length>0&&n[0]?n[0].split(" ")[0]:"",e.uri=null,e.uuid=null,e.status=n.length>0&&n[0]?n[0].indexOf(" idle")>0?"idle":n[0].indexOf(" printing")>0?"printing":"unknown":null,e.local=xe.getValue(n,"Location",":",!0).toLowerCase().startsWith("local"),e.default=null,e.shared=xe.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),e}function L0(n,t){let e={},r=n.uri.split("/");return e.id=t,e.name=n._name,e.model=r.length?r[r.length-1]:"",e.uri=n.uri,e.uuid=null,e.status=n.status,e.local=n.printserver==="local",e.default=n.default==="yes",e.shared=n.shared==="yes",e}function O0(n,t){let e={},r=parseInt(xe.getValue(n,"PrinterStatus",":"),10);return e.id=t,e.name=xe.getValue(n,"name",":"),e.model=xe.getValue(n,"DriverName",":"),e.uri=null,e.uuid=null,e.status=pa[r]?pa[r]:null,e.local=xe.getValue(n,"Local",":").toUpperCase()==="TRUE",e.default=xe.getValue(n,"Default",":").toUpperCase()==="TRUE",e.shared=xe.getValue(n,"Shared",":").toUpperCase()==="TRUE",e}function E0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(ua||x0||S0||_0){let r="cat /etc/cups/printers.conf 2>/dev/null";ui(r,function(i,s){if(!i){let o=s.toString().split("<Printer "),a=v0(o[0]);for(let l=1;l<o.length;l++){let c=w0(o[l].split(`
|
|
364
|
+
`));c.name&&(c.engine="CUPS",c.engineVersion=a.cupsVersion,e.push(c))}}e.length===0&&ua?(r="export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL",ui(r,function(o,a){let l=(`
|
|
369
365
|
`+a.toString()).split(`
|
|
370
|
-
printer `);for(let c=1;c<l.length;c++){let u=
|
|
371
|
-
`),c);e.push(u)}}),
|
|
372
|
-
`),o);(a.name||a.model)&&e.push(a)}}
|
|
373
|
-
`);if(e&&e.length&&e[0].indexOf("Device")>=0){let y=e[0].split(" ");t.bus=parseInt(y[0],10),y[2]?t.deviceId=parseInt(y[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;let r=
|
|
366
|
+
printer `);for(let c=1;c<l.length;c++){let u=I0(l[c].split(`
|
|
367
|
+
`),c);e.push(u)}}),n&&n(e),t(e)):(n&&n(e),t(e))})}g0&&ui("system_profiler SPPrintersDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPPrintersDataType&&o.SPPrintersDataType.length)for(let a=0;a<o.SPPrintersDataType.length;a++){let l=L0(o.SPPrintersDataType[a],a);e.push(l)}}catch{xe.noop()}n&&n(e),t(e)}),y0&&xe.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then((r,i)=>{if(!i){let s=r.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){let a=O0(s[o].split(`
|
|
368
|
+
`),o);(a.name||a.model)&&e.push(a)}}n&&n(e),t(e)}),C0&&t(null)})})}da.printer=E0});var ga=oe(ha=>{"use strict";var ma=require("child_process").exec,ze=ue(),Ut=process.platform,P0=Ut==="linux"||Ut==="android",A0=Ut==="darwin",T0=Ut==="win32",M0=Ut==="freebsd",b0=Ut==="openbsd",D0=Ut==="netbsd",N0=Ut==="sunos";function V0(n,t){let e=n,r=(t+" "+n).toLowerCase();return r.indexOf("camera")>=0?e="Camera":r.indexOf("hub")>=0?e="Hub":r.indexOf("keybrd")>=0||r.indexOf("keyboard")>=0?e="Keyboard":r.indexOf("mouse")>=0?e="Mouse":r.indexOf("stora")>=0?e="Storage":r.indexOf("microp")>=0?e="Microphone":(r.indexOf("headset")>=0||r.indexOf("audio")>=0)&&(e="Audio"),e}function k0(n){let t={},e=n.split(`
|
|
369
|
+
`);if(e&&e.length&&e[0].indexOf("Device")>=0){let y=e[0].split(" ");t.bus=parseInt(y[0],10),y[2]?t.deviceId=parseInt(y[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;let r=ze.getValue(e,"idVendor"," ",!0).trim(),i=r.split(" ");i.shift();let s=i.join(" "),o=ze.getValue(e,"idProduct"," ",!0).trim(),a=o.split(" ");a.shift();let l=a.join(" "),u=ze.getValue(e,"bInterfaceClass"," ",!0).trim().split(" ");u.shift();let p=u.join(" "),f=ze.getValue(e,"iManufacturer"," ",!0).trim().split(" ");f.shift();let m=f.join(" "),x=ze.getValue(e,"iSerial"," ",!0).trim().split(" ");x.shift();let h=x.join(" ");return t.id=(r.startsWith("0x")?r.split(" ")[0].substr(2,10):"")+":"+(o.startsWith("0x")?o.split(" ")[0].substr(2,10):""),t.name=l,t.type=V0(p,l),t.removable=null,t.vendor=s,t.manufacturer=m,t.maxPower=ze.getValue(e,"MaxPower"," ",!0),t.serialNumber=h,t}function B0(n){let t="";return n.indexOf("camera")>=0?t="Camera":n.indexOf("touch bar")>=0?t="Touch Bar":n.indexOf("controller")>=0?t="Controller":n.indexOf("headset")>=0?t="Audio":n.indexOf("keyboard")>=0?t="Keyboard":n.indexOf("trackpad")>=0?t="Trackpad":n.indexOf("sensor")>=0?t="Sensor":n.indexOf("bthusb")>=0||n.indexOf("bth")>=0||n.indexOf("rfcomm")>=0?t="Bluetooth":n.indexOf("usbhub")>=0||n.indexOf(" hub")>=0?t="Hub":n.indexOf("mouse")>=0?t="Mouse":n.indexOf("microp")>=0?t="Microphone":n.indexOf("removable")>=0&&(t="Storage"),t}function R0(n,t){let e={};e.id=t,n=n.replace(/ \|/g,""),n=n.trim();let r=n.split(`
|
|
374
370
|
`);r.shift();try{for(let o=0;o<r.length;o++){r[o]=r[o].trim(),r[o]=r[o].replace(/=/g,":"),r[o]!=="{"&&r[o]!=="}"&&r[o+1]&&r[o+1].trim()!=="}"&&(r[o]=r[o]+","),r[o]=r[o].replace(":Yes,",':"Yes",'),r[o]=r[o].replace(": Yes,",': "Yes",'),r[o]=r[o].replace(": Yes",': "Yes"'),r[o]=r[o].replace(":No,",':"No",'),r[o]=r[o].replace(": No,",': "No",'),r[o]=r[o].replace(": No",': "No"'),r[o]=r[o].replace("((","").replace("))","");let a=/<(\w+)>/.exec(r[o]);if(a){let l=a[0];r[o]=r[o].replace(l,`"${l}"`)}}let i=JSON.parse(r.join(`
|
|
375
|
-
`)),
|
|
371
|
+
`)),s=(i["Built-In"]?i["Built-In"].toLowerCase()!=="yes":!0)&&(i["non-removable"]?i["non-removable"].toLowerCase()==="no":!0);return e.bus=null,e.deviceId=null,e.id=i["USB Address"]||null,e.name=i.kUSBProductString||i["USB Product Name"]||null,e.type=B0((i.kUSBProductString||i["USB Product Name"]||"").toLowerCase()+(s?" removable":"")),e.removable=i["non-removable"]?i["non-removable"].toLowerCase()||!1:!0,e.vendor=i.kUSBVendorString||i["USB Vendor Name"]||null,e.manufacturer=i.kUSBVendorString||i["USB Vendor Name"]||null,e.maxPower=null,e.serialNumber=i.kUSBSerialNumberString||null,e.name?e:null}catch{return null}}function F0(n,t){let e="";return t.indexOf("storage")>=0||t.indexOf("speicher")>=0?e="Storage":n.indexOf("usbhub")>=0?e="Hub":n.indexOf("storage")>=0?e="Storage":n.indexOf("usbcontroller")>=0?e="Controller":n.indexOf("keyboard")>=0?e="Keyboard":n.indexOf("pointing")>=0?e="Mouse":n.indexOf("microp")>=0?e="Microphone":n.indexOf("disk")>=0&&(e="Storage"),e}function G0(n,t){let e=F0(ze.getValue(n,"CreationClassName",":").toLowerCase(),ze.getValue(n,"name",":").toLowerCase());if(e){let r={};return r.bus=null,r.deviceId=ze.getValue(n,"deviceid",":"),r.id=t,r.name=ze.getValue(n,"name",":"),r.type=e,r.removable=null,r.vendor=null,r.manufacturer=ze.getValue(n,"Manufacturer",":"),r.maxPower=null,r.serialNumber=null,r}else return null}function W0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];P0&&ma("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:1024*1024*128},function(i,s){if(!i){let o=(`
|
|
376
372
|
|
|
377
|
-
`+
|
|
373
|
+
`+s.toString()).split(`
|
|
378
374
|
|
|
379
|
-
Bus `);for(let a=1;a<o.length;a++){let l=
|
|
380
|
-
`),o);a&&e.filter(l=>l.deviceId===a.deviceId).length===0&&e.push(a)}}
|
|
375
|
+
Bus `);for(let a=1;a<o.length;a++){let l=k0(o[a]);e.push(l)}}n&&n(e),t(e)}),A0&&ma("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l",{maxBuffer:1024*1024*128},function(i,s){if(!i){let o=s.toString().split(" +-o ");for(let a=1;a<o.length;a++){let l=R0(o[a]);l&&e.push(l)}n&&n(e),t(e)}n&&n(e),t(e)}),T0&&ze.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((r,i)=>{if(!i){let s=r.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){let a=G0(s[o].split(`
|
|
376
|
+
`),o);a&&e.filter(l=>l.deviceId===a.deviceId).length===0&&e.push(a)}}n&&n(e),t(e)}),(N0||M0||b0||D0)&&t(null)})})}ha.usb=W0});var Sa=oe(xa=>{"use strict";var ya=require("child_process").exec,U0=require("child_process").execSync,Le=ue(),zt=process.platform,z0=zt==="linux"||zt==="android",H0=zt==="darwin",j0=zt==="win32",q0=zt==="freebsd",K0=zt==="openbsd",$0=zt==="netbsd",Y0=zt==="sunos";function pi(n,t,e){n=n.toLowerCase();let r="";return n.indexOf("input")>=0&&(r="Microphone"),n.indexOf("display audio")>=0&&(r="Speaker"),n.indexOf("speak")>=0&&(r="Speaker"),n.indexOf("laut")>=0&&(r="Speaker"),n.indexOf("loud")>=0&&(r="Speaker"),n.indexOf("head")>=0&&(r="Headset"),n.indexOf("mic")>=0&&(r="Microphone"),n.indexOf("mikr")>=0&&(r="Microphone"),n.indexOf("phone")>=0&&(r="Phone"),n.indexOf("controll")>=0&&(r="Controller"),n.indexOf("line o")>=0&&(r="Line Out"),n.indexOf("digital o")>=0&&(r="Digital Out"),n.indexOf("smart sound technology")>=0&&(r="Digital Signal Processor"),n.indexOf("high definition audio")>=0&&(r="Sound Driver"),!r&&e?r="Speaker":!r&&t&&(r="Microphone"),r}function X0(){let n="lspci -v 2>/dev/null",t=[];try{return U0(n,Le.execOptsLinux).toString().split(`
|
|
381
377
|
|
|
382
378
|
`).forEach(r=>{let i=r.split(`
|
|
383
|
-
`);if(i&&i.length&&i[0].toLowerCase().indexOf("audio")>=0){let
|
|
379
|
+
`);if(i&&i.length&&i[0].toLowerCase().indexOf("audio")>=0){let s={};s.slotId=i[0].split(" ")[0],s.driver=Le.getValue(i,"Kernel driver in use",":",!0)||Le.getValue(i,"Kernel modules",":",!0),t.push(s)}}),t}catch{return t}}function Z0(n,t){let e={},r=Le.getValue(n,"Slot"),i=t.filter(function(s){return s.slotId===r});return e.id=r,e.name=Le.getValue(n,"SDevice"),e.manufacturer=Le.getValue(n,"SVendor"),e.revision=Le.getValue(n,"Rev"),e.driver=i&&i.length===1&&i[0].driver?i[0].driver:"",e.default=null,e.channel="PCIe",e.type=pi(e.name,null,null),e.in=null,e.out=null,e.status="online",e}function J0(n){let t="";return n.indexOf("builtin")>=0&&(t="Built-In"),n.indexOf("extern")>=0&&(t="Audio-Jack"),n.indexOf("hdmi")>=0&&(t="HDMI"),n.indexOf("displayport")>=0&&(t="Display-Port"),n.indexOf("usb")>=0&&(t="USB"),n.indexOf("pci")>=0&&(t="PCIe"),t}function Q0(n,t){let e={},r=((n.coreaudio_device_transport||"")+" "+(n._name||"")).toLowerCase();return e.id=t,e.name=n._name,e.manufacturer=n.coreaudio_device_manufacturer,e.revision=null,e.driver=null,e.default=!!n.coreaudio_default_audio_input_device||!!n.coreaudio_default_audio_output_device,e.channel=J0(r),e.type=pi(e.name,!!n.coreaudio_device_input,!!n.coreaudio_device_output),e.in=!!n.coreaudio_device_input,e.out=!!n.coreaudio_device_output,e.status="online",e}function ed(n){let t={},e=Le.getValue(n,"StatusInfo",":");return t.id=Le.getValue(n,"DeviceID",":"),t.name=Le.getValue(n,"name",":"),t.manufacturer=Le.getValue(n,"manufacturer",":"),t.revision=null,t.driver=null,t.default=null,t.channel=null,t.type=pi(t.name,null,null),t.in=null,t.out=null,t.status=e,t}function td(n){return new Promise(t=>{process.nextTick(()=>{let e=[];(z0||q0||K0||$0)&&ya("lspci -vmm 2>/dev/null",function(i,s){if(!i){let o=X0();s.toString().split(`
|
|
384
380
|
|
|
385
381
|
`).forEach(l=>{let c=l.split(`
|
|
386
|
-
`);if(
|
|
387
|
-
`);Ie.getValue(a,"name",":")&&e.push(Uf(a))}),s&&s(e),t(e)}),Rf&&t(null)})})}ga.audio=Gf});var Sa=le(_a=>{"use strict";var jf=require("child_process").exec,zf=require("child_process").execSync,qf=require("path"),at=ce(),Hf=require("fs"),jt=process.platform,$f=jt==="linux"||jt==="android",Yf=jt==="darwin",Xf=jt==="win32",Kf=jt==="freebsd",Zf=jt==="openbsd",Jf=jt==="netbsd",Qf=jt==="sunos";function hi(s){let t="";return s.indexOf("keyboard")>=0&&(t="Keyboard"),s.indexOf("mouse")>=0&&(t="Mouse"),s.indexOf("trackpad")>=0&&(t="Trackpad"),s.indexOf("speaker")>=0&&(t="Speaker"),s.indexOf("headset")>=0&&(t="Headset"),s.indexOf("phone")>=0&&(t="Phone"),s.indexOf("macbook")>=0&&(t="Computer"),s.indexOf("imac")>=0&&(t="Computer"),s.indexOf("ipad")>=0&&(t="Tablet"),s.indexOf("watch")>=0&&(t="Watch"),s.indexOf("headphone")>=0&&(t="Headset"),t}function ed(s){let t=s.split(" ")[0];return s=s.toLowerCase(),s.indexOf("apple")>=0&&(t="Apple"),s.indexOf("ipad")>=0&&(t="Apple"),s.indexOf("imac")>=0&&(t="Apple"),s.indexOf("iphone")>=0&&(t="Apple"),s.indexOf("magic mouse")>=0&&(t="Apple"),s.indexOf("magic track")>=0&&(t="Apple"),s.indexOf("macbook")>=0&&(t="Apple"),t}function td(s,t,e){let r={};return r.device=null,r.name=at.getValue(s,"name","="),r.manufacturer=null,r.macDevice=t,r.macHost=e,r.batteryPercent=null,r.type=hi(r.name.toLowerCase()),r.connected=!1,r}function mi(s,t){let e={},r=((s.device_minorClassOfDevice_string||s.device_majorClassOfDevice_string||s.device_minorType||"")+(s.device_name||"")).toLowerCase();return e.device=s.device_services||"",e.name=s.device_name||"",e.manufacturer=s.device_manufacturer||ed(s.device_name||"")||"",e.macDevice=(s.device_addr||s.device_address||"").toLowerCase().replace(/-/g,":"),e.macHost=t,e.batteryPercent=s.device_batteryPercent||null,e.type=hi(r),e.connected=s.device_isconnected==="attrib_Yes"||!1,e}function sd(s){let t={};return t.device=null,t.name=at.getValue(s,"name",":"),t.manufacturer=at.getValue(s,"manufacturer",":"),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=hi(t.name.toLowerCase()),t.connected=null,t}function rd(s){return new Promise(t=>{process.nextTick(()=>{let e=[];if($f){at.getFilesInPath("/var/lib/bluetooth/").forEach(i=>{let n=qf.basename(i),o=i.split("/"),a=o.length>=6?o[o.length-2]:null,l=o.length>=7?o[o.length-3]:null;if(n==="info"){let c=Hf.readFileSync(i,{encoding:"utf8"}).split(`
|
|
388
|
-
`);e.push(
|
|
389
|
-
`),"PNPClass",":")==="Bluetooth"&&e.push(
|
|
390
|
-
`)))}),
|
|
391
|
-
`);let r;for(;(r=
|
|
392
|
-
`),n=n.replace(/\\r/g,"\r")),t[i]=n}return t}function _d(s){let t=Da(s),e=ge.configDotenv({path:t});if(!e.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Na(s).split(","),i=r.length,n;for(let o=0;o<i;o++)try{let a=r[o].trim(),l=xd(e,a);n=ge.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=i)throw a}return ge.parse(n)}function Sd(s){console.log(`[dotenv@${Si}][INFO] ${s}`)}function vd(s){console.log(`[dotenv@${Si}][WARN] ${s}`)}function dn(s){console.log(`[dotenv@${Si}][DEBUG] ${s}`)}function Na(s){return s&&s.DOTENV_KEY&&s.DOTENV_KEY.length>0?s.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function xd(s,t){let e;try{e=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let r=e.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=e.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let n=`DOTENV_VAULT_${i.toUpperCase()}`,o=s.parsed[n];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function Da(s){let t=null;if(s&&s.path&&s.path.length>0)if(Array.isArray(s.path))for(let e of s.path)yi.existsSync(e)&&(t=e.endsWith(".vault")?e:`${e}.vault`);else t=s.path.endsWith(".vault")?s.path:`${s.path}.vault`;else t=_i.resolve(process.cwd(),".env.vault");return yi.existsSync(t)?t:null}function Va(s){return s[0]==="~"?_i.join(dd.homedir(),s.slice(1)):s}function wd(s){Sd("Loading env from encrypted .env.vault");let t=ge._parseVault(s),e=process.env;return s&&s.processEnv!=null&&(e=s.processEnv),ge.populate(e,t,s),{parsed:t}}function Cd(s){let t=_i.resolve(process.cwd(),".env"),e="utf8",r=!!(s&&s.debug);s&&s.encoding?e=s.encoding:r&&dn("No encoding is specified. UTF-8 is used by default");let i=[t];if(s&&s.path)if(!Array.isArray(s.path))i=[Va(s.path)];else{i=[];for(let l of s.path)i.push(Va(l))}let n,o={};for(let l of i)try{let c=ge.parse(yi.readFileSync(l,{encoding:e}));ge.populate(o,c,s)}catch(c){r&&dn(`Failed to load ${l} ${c.message}`),n=c}let a=process.env;return s&&s.processEnv!=null&&(a=s.processEnv),ge.populate(a,o,s),n?{parsed:o,error:n}:{parsed:o}}function Od(s){if(Na(s).length===0)return ge.configDotenv(s);let t=Da(s);return t?ge._configVault(s):(vd(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ge.configDotenv(s))}function Id(s,t){let e=Buffer.from(t.slice(-64),"hex"),r=Buffer.from(s,"base64"),i=r.subarray(0,12),n=r.subarray(-16);r=r.subarray(12,-16);try{let o=md.createDecipheriv("aes-256-gcm",e,i);return o.setAuthTag(n),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,l=o.message==="Invalid key length",c=o.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw o}}function Ld(s,t,e={}){let r=!!(e&&e.debug),i=!!(e&&e.override);if(typeof t!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(s,n)?(i===!0&&(s[n]=t[n]),r&&dn(i===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):s[n]=t[n]}var ge={configDotenv:Cd,_configVault:wd,_parseVault:_d,config:Od,decrypt:Id,parse:yd,populate:Ld};ut.exports.configDotenv=ge.configDotenv;ut.exports._configVault=ge._configVault;ut.exports._parseVault=ge._parseVault;ut.exports.config=ge.config;ut.exports.decrypt=ge.decrypt;ut.exports.parse=ge.parse;ut.exports.populate=ge.populate;ut.exports=ge});var Dd={};ja(Dd,{generatePreviewUrl:()=>Nd});module.exports=za(Dd);var te;(function(s){s.assertEqual=i=>i;function t(i){}s.assertIs=t;function e(i){throw new Error}s.assertNever=e,s.arrayToEnum=i=>{let n={};for(let o of i)n[o]=o;return n},s.getValidEnumValues=i=>{let n=s.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of n)o[a]=i[a];return s.objectValues(o)},s.objectValues=i=>s.objectKeys(i).map(function(n){return i[n]}),s.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},s.find=(i,n)=>{for(let o of i)if(n(o))return o},s.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(te||(te={}));var gn;(function(s){s.mergeShapes=(t,e)=>({...t,...e})})(gn||(gn={}));var M=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pt=s=>{switch(typeof s){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(s)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(s)?M.array:s===null?M.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?M.promise:typeof Map<"u"&&s instanceof Map?M.map:typeof Set<"u"&&s instanceof Set?M.set:typeof Date<"u"&&s instanceof Date?M.date:M.object;default:return M.unknown}},L=te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qa=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:"),Te=class s extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let e=t||function(n){return n.message},r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(e(o));else{let a=r,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(t){if(!(t instanceof s))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},r=[];for(let i of this.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}};Te.create=s=>new Te(s);var vs=(s,t)=>{let e;switch(s.code){case L.invalid_type:s.received===M.undefined?e="Required":e=`Expected ${s.expected}, received ${s.received}`;break;case L.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(s.expected,te.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:e=`Unrecognized key(s) in object: ${te.joinValues(s.keys,", ")}`;break;case L.invalid_union:e="Invalid input";break;case L.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${te.joinValues(s.options)}`;break;case L.invalid_enum_value:e=`Invalid enum value. Expected ${te.joinValues(s.options)}, received '${s.received}'`;break;case L.invalid_arguments:e="Invalid function arguments";break;case L.invalid_return_type:e="Invalid function return type";break;case L.invalid_date:e="Invalid date";break;case L.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(e=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?e=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?e=`Invalid input: must end with "${s.validation.endsWith}"`:te.assertNever(s.validation):s.validation!=="regex"?e=`Invalid ${s.validation}`:e="Invalid";break;case L.too_small:s.type==="array"?e=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?e=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?e=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?e=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:e="Invalid input";break;case L.too_big:s.type==="array"?e=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?e=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?e=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?e=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?e=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:e="Invalid input";break;case L.custom:e="Invalid input";break;case L.invalid_intersection_types:e="Intersection results could not be merged";break;case L.not_multiple_of:e=`Number must be a multiple of ${s.multipleOf}`;break;case L.not_finite:e="Number must be finite";break;default:e=t.defaultError,te.assertNever(s)}return{message:e}},Oi=vs;function Ha(s){Oi=s}function Lr(){return Oi}var Er=s=>{let{data:t,path:e,errorMaps:r,issueData:i}=s,n=[...e,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let a="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:n,message:a}},$a=[];function A(s,t){let e=Lr(),r=Er({issueData:t,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,e,e===vs?void 0:vs].filter(i=>!!i)});s.common.issues.push(r)}var ve=class s{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let r=[];for(let i of e){if(i.status==="aborted")return q;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let n=await i.key,o=await i.value;r.push({key:n,value:o})}return s.mergeObjectSync(t,r)}static mergeObjectSync(t,e){let r={};for(let i of e){let{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return q;n.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[n.value]=o.value)}return{status:t.value,value:r}}},q=Object.freeze({status:"aborted"}),Ss=s=>({status:"dirty",value:s}),Ce=s=>({status:"valid",value:s}),yn=s=>s.status==="aborted",_n=s=>s.status==="dirty",Hs=s=>s.status==="valid",$s=s=>typeof Promise<"u"&&s instanceof Promise;function Pr(s,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(s):r?r.value:t.get(s)}function Ii(s,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!i:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(s,e):i?i.value=e:t.set(s,e),e}var k;(function(s){s.errToObj=t=>typeof t=="string"?{message:t}:t||{},s.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var zs,qs,be=class{constructor(t,e,r,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wi=(s,t)=>{if(Hs(t))return{success:!0,data:t.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new Te(s.common.issues);return this._error=e,this._error}}};function $(s){if(!s)return{};let{errorMap:t,invalid_type_error:e,required_error:r,description:i}=s;if(t&&(e||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var l,c;let{message:u}=s;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??e)!==null&&c!==void 0?c:a.defaultError}},description:i}}var Y=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return pt(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:pt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ve,ctx:{common:t.parent.common,data:t.data,parsedType:pt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if($s(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let i={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pt(t)},n=this._parseSync({data:t,path:i.path,parent:i});return wi(i,n)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pt(t)},i=this._parse({data:t,path:r.path,parent:r}),n=await($s(i)?i:Promise.resolve(i));return wi(r,n)}refine(t,e){let r=i=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(i):e;return this._refinement((i,n)=>{let o=t(i),a=()=>n.addIssue({code:L.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof e=="function"?e(r,i):e),!1))}_refinement(t){return new Ve({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ae.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nt.create(this,this._def)}promise(){return mt.create(this,this._def)}or(t){return Zt.create([this,t],this._def)}and(t){return Jt.create(this,t,this._def)}transform(t){return new Ve({...$(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new rs({...$(this._def),innerType:this,defaultValue:e,typeName:z.ZodDefault})}brand(){return new Ys({typeName:z.ZodBranded,type:this,...$(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new ns({...$(this._def),innerType:this,catchValue:e,typeName:z.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Xs.create(this,t)}readonly(){return is.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ya=/^c[^\s-]{8,}$/i,Xa=/^[0-9a-z]+$/,Ka=/^[0-9A-HJKMNP-TV-Z]{26}$/,Za=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ja=/^[a-z0-9_-]{21}$/i,Qa=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,el=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hn,sl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rl=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,nl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Li="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",il=new RegExp(`^${Li}$`);function Ei(s){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?t=`${t}\\.\\d{${s.precision}}`:s.precision==null&&(t=`${t}(\\.\\d+)?`),t}function ol(s){return new RegExp(`^${Ei(s)}$`)}function Pi(s){let t=`${Li}T${Ei(s)}`,e=[];return e.push(s.local?"Z?":"Z"),s.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function al(s,t){return!!((t==="v4"||!t)&&sl.test(s)||(t==="v6"||!t)&&rl.test(s))}var ft=class s extends Y{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.string){let n=this._getOrReturnCtx(t);return A(n,{code:L.invalid_type,expected:M.string,received:n.parsedType}),q}let r=new ve,i;for(let n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:L.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")t.data.length>n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:L.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){let o=t.data.length>n.value,a=t.data.length<n.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?A(i,{code:L.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&A(i,{code:L.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")el.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"email",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")hn||(hn=new RegExp(tl,"u")),hn.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"emoji",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")Za.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"uuid",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")Ja.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"nanoid",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")Ya.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"cuid",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")Xa.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"cuid2",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")Ka.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"ulid",code:L.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),A(i,{validation:"url",code:L.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"regex",code:L.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?Pi(n).test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?il.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?ol(n).test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:L.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?Qa.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"duration",code:L.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?al(t.data,n.version)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"ip",code:L.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?nl.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"base64",code:L.invalid_string,message:n.message}),r.dirty()):te.assertNever(n);return{status:r.value,value:t.data}}_regex(t,e,r){return this.refinement(i=>t.test(i),{validation:e,code:L.invalid_string,...k.errToObj(r)})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}datetime(t){var e,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(e=t?.offset)!==null&&e!==void 0?e:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...k.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...k.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...k.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...k.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...k.errToObj(e)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new s({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new s({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new s({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};ft.create=s=>{var t;return new ft({checks:[],typeName:z.ZodString,coerce:(t=s?.coerce)!==null&&t!==void 0?t:!1,...$(s)})};function ll(s,t){let e=(s.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=e>r?e:r,n=parseInt(s.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return n%o/Math.pow(10,i)}var qt=class s extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M.number){let n=this._getOrReturnCtx(t);return A(n,{code:L.invalid_type,expected:M.number,received:n.parsedType}),q}let r,i=new ve;for(let n of this._def.checks)n.kind==="int"?te.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:L.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?ll(t.data,n.value)!==0&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:L.not_finite,message:n.message}),i.dirty()):te.assertNever(n);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,k.toString(e))}gt(t,e){return this.setLimit("min",t,!1,k.toString(e))}lte(t,e){return this.setLimit("max",t,!0,k.toString(e))}lt(t,e){return this.setLimit("max",t,!1,k.toString(e))}setLimit(t,e,r,i){return new s({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:k.toString(i)}]})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&te.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(e===null||r.value>e)&&(e=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(e)&&Number.isFinite(t)}};qt.create=s=>new qt({checks:[],typeName:z.ZodNumber,coerce:s?.coerce||!1,...$(s)});var Ht=class s extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==M.bigint){let n=this._getOrReturnCtx(t);return A(n,{code:L.invalid_type,expected:M.bigint,received:n.parsedType}),q}let r,i=new ve;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),A(r,{code:L.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):te.assertNever(n);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,k.toString(e))}gt(t,e){return this.setLimit("min",t,!1,k.toString(e))}lte(t,e){return this.setLimit("max",t,!0,k.toString(e))}lt(t,e){return this.setLimit("max",t,!1,k.toString(e))}setLimit(t,e,r,i){return new s({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:k.toString(i)}]})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};Ht.create=s=>{var t;return new Ht({checks:[],typeName:z.ZodBigInt,coerce:(t=s?.coerce)!==null&&t!==void 0?t:!1,...$(s)})};var $t=class extends Y{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.boolean){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.boolean,received:r.parsedType}),q}return Ce(t.data)}};$t.create=s=>new $t({typeName:z.ZodBoolean,coerce:s?.coerce||!1,...$(s)});var Yt=class s extends Y{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.date){let n=this._getOrReturnCtx(t);return A(n,{code:L.invalid_type,expected:M.date,received:n.parsedType}),q}if(isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return A(n,{code:L.invalid_date}),q}let r=new ve,i;for(let n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:L.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:L.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):te.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};Yt.create=s=>new Yt({checks:[],coerce:s?.coerce||!1,typeName:z.ZodDate,...$(s)});var xs=class extends Y{_parse(t){if(this._getType(t)!==M.symbol){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.symbol,received:r.parsedType}),q}return Ce(t.data)}};xs.create=s=>new xs({typeName:z.ZodSymbol,...$(s)});var Xt=class extends Y{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.undefined,received:r.parsedType}),q}return Ce(t.data)}};Xt.create=s=>new Xt({typeName:z.ZodUndefined,...$(s)});var Kt=class extends Y{_parse(t){if(this._getType(t)!==M.null){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.null,received:r.parsedType}),q}return Ce(t.data)}};Kt.create=s=>new Kt({typeName:z.ZodNull,...$(s)});var dt=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return Ce(t.data)}};dt.create=s=>new dt({typeName:z.ZodAny,...$(s)});var rt=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ce(t.data)}};rt.create=s=>new rt({typeName:z.ZodUnknown,...$(s)});var je=class extends Y{_parse(t){let e=this._getOrReturnCtx(t);return A(e,{code:L.invalid_type,expected:M.never,received:e.parsedType}),q}};je.create=s=>new je({typeName:z.ZodNever,...$(s)});var ws=class extends Y{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.void,received:r.parsedType}),q}return Ce(t.data)}};ws.create=s=>new ws({typeName:z.ZodVoid,...$(s)});var nt=class s extends Y{_parse(t){let{ctx:e,status:r}=this._processInputParams(t),i=this._def;if(e.parsedType!==M.array)return A(e,{code:L.invalid_type,expected:M.array,received:e.parsedType}),q;if(i.exactLength!==null){let o=e.data.length>i.exactLength.value,a=e.data.length<i.exactLength.value;(o||a)&&(A(e,{code:o?L.too_big:L.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&e.data.length<i.minLength.value&&(A(e,{code:L.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&e.data.length>i.maxLength.value&&(A(e,{code:L.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>i.type._parseAsync(new be(e,o,e.path,a)))).then(o=>ve.mergeArray(r,o));let n=[...e.data].map((o,a)=>i.type._parseSync(new be(e,o,e.path,a)));return ve.mergeArray(r,n)}get element(){return this._def.type}min(t,e){return new s({...this._def,minLength:{value:t,message:k.toString(e)}})}max(t,e){return new s({...this._def,maxLength:{value:t,message:k.toString(e)}})}length(t,e){return new s({...this._def,exactLength:{value:t,message:k.toString(e)}})}nonempty(t){return this.min(1,t)}};nt.create=(s,t)=>new nt({type:s,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...$(t)});function _s(s){if(s instanceof Le){let t={};for(let e in s.shape){let r=s.shape[e];t[e]=Ae.create(_s(r))}return new Le({...s._def,shape:()=>t})}else return s instanceof nt?new nt({...s._def,type:_s(s.element)}):s instanceof Ae?Ae.create(_s(s.unwrap())):s instanceof Xe?Xe.create(_s(s.unwrap())):s instanceof Ye?Ye.create(s.items.map(t=>_s(t))):s}var Le=class s extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=te.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==M.object){let c=this._getOrReturnCtx(t);return A(c,{code:L.invalid_type,expected:M.object,received:c.parsedType}),q}let{status:r,ctx:i}=this._processInputParams(t),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof je&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let l=[];for(let c of o){let u=n[c],p=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new be(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof je){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(A(i,{code:L.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let p=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new be(i,p,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let p=await u.key,f=await u.value;c.push({key:p,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>ve.mergeObjectSync(r,c)):ve.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new s({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,r)=>{var i,n,o,a;let l=(o=(n=(i=this._def).errorMap)===null||n===void 0?void 0:n.call(i,e,r).message)!==null&&o!==void 0?o:r.defaultError;return e.code==="unrecognized_keys"?{message:(a=k.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new s({...this._def,unknownKeys:"strip"})}passthrough(){return new s({...this._def,unknownKeys:"passthrough"})}extend(t){return new s({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new s({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new s({...this._def,catchall:t})}pick(t){let e={};return te.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(e[r]=this.shape[r])}),new s({...this._def,shape:()=>e})}omit(t){let e={};return te.objectKeys(this.shape).forEach(r=>{t[r]||(e[r]=this.shape[r])}),new s({...this._def,shape:()=>e})}deepPartial(){return _s(this)}partial(t){let e={};return te.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?e[r]=i:e[r]=i.optional()}),new s({...this._def,shape:()=>e})}required(t){let e={};return te.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])e[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof Ae;)n=n._def.innerType;e[r]=n}}),new s({...this._def,shape:()=>e})}keyof(){return Ti(te.objectKeys(this.shape))}};Le.create=(s,t)=>new Le({shape:()=>s,unknownKeys:"strip",catchall:je.create(),typeName:z.ZodObject,...$(t)});Le.strictCreate=(s,t)=>new Le({shape:()=>s,unknownKeys:"strict",catchall:je.create(),typeName:z.ZodObject,...$(t)});Le.lazycreate=(s,t)=>new Le({shape:s,unknownKeys:"strip",catchall:je.create(),typeName:z.ZodObject,...$(t)});var Zt=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function i(n){for(let a of n)if(a.result.status==="valid")return a.result;for(let a of n)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;let o=n.map(a=>new Te(a.ctx.common.issues));return A(e,{code:L.invalid_union,unionErrors:o}),q}if(e.common.async)return Promise.all(r.map(async n=>{let o={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(i);{let n,o=[];for(let l of r){let c={...e,common:{...e.common,issues:[]},parent:null},u=l._parseSync({data:e.data,path:e.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let a=o.map(l=>new Te(l));return A(e,{code:L.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}};Zt.create=(s,t)=>new Zt({options:s,typeName:z.ZodUnion,...$(t)});var st=s=>s instanceof Qt?st(s.schema):s instanceof Ve?st(s.innerType()):s instanceof es?[s.value]:s instanceof ts?s.options:s instanceof ss?te.objectValues(s.enum):s instanceof rs?st(s._def.innerType):s instanceof Xt?[void 0]:s instanceof Kt?[null]:s instanceof Ae?[void 0,...st(s.unwrap())]:s instanceof Xe?[null,...st(s.unwrap())]:s instanceof Ys||s instanceof is?st(s.unwrap()):s instanceof ns?st(s._def.innerType):[],Tr=class s extends Y{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==M.object)return A(e,{code:L.invalid_type,expected:M.object,received:e.parsedType}),q;let r=this.discriminator,i=e.data[r],n=this.optionsMap.get(i);return n?e.common.async?n._parseAsync({data:e.data,path:e.path,parent:e}):n._parseSync({data:e.data,path:e.path,parent:e}):(A(e,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let n of e){let o=st(n.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,n)}}return new s({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...$(r)})}};function Sn(s,t){let e=pt(s),r=pt(t);if(s===t)return{valid:!0,data:s};if(e===M.object&&r===M.object){let i=te.objectKeys(t),n=te.objectKeys(s).filter(a=>i.indexOf(a)!==-1),o={...s,...t};for(let a of n){let l=Sn(s[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===M.array&&r===M.array){if(s.length!==t.length)return{valid:!1};let i=[];for(let n=0;n<s.length;n++){let o=s[n],a=t[n],l=Sn(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return e===M.date&&r===M.date&&+s==+t?{valid:!0,data:s}:{valid:!1}}var Jt=class extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(n,o)=>{if(yn(n)||yn(o))return q;let a=Sn(n.value,o.value);return a.valid?((_n(n)||_n(o))&&e.dirty(),{status:e.value,value:a.data}):(A(r,{code:L.invalid_intersection_types}),q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Jt.create=(s,t,e)=>new Jt({left:s,right:t,typeName:z.ZodIntersection,...$(e)});var Ye=class s extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.array)return A(r,{code:L.invalid_type,expected:M.array,received:r.parsedType}),q;if(r.data.length<this._def.items.length)return A(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&r.data.length>this._def.items.length&&(A(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let n=[...r.data].map((o,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new be(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(n).then(o=>ve.mergeArray(e,o)):ve.mergeArray(e,n)}get items(){return this._def.items}rest(t){return new s({...this._def,rest:t})}};Ye.create=(s,t)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ye({items:s,typeName:z.ZodTuple,rest:null,...$(t)})};var Vr=class s extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.object)return A(r,{code:L.invalid_type,expected:M.object,received:r.parsedType}),q;let i=[],n=this._def.keyType,o=this._def.valueType;for(let a in r.data)i.push({key:n._parse(new be(r,a,r.path,a)),value:o._parse(new be(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ve.mergeObjectAsync(e,i):ve.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){return e instanceof Y?new s({keyType:t,valueType:e,typeName:z.ZodRecord,...$(r)}):new s({keyType:ft.create(),valueType:t,typeName:z.ZodRecord,...$(e)})}},Cs=class extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.map)return A(r,{code:L.invalid_type,expected:M.map,received:r.parsedType}),q;let i=this._def.keyType,n=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new be(r,a,r.path,[c,"key"])),value:n._parse(new be(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}})}else{let a=new Map;for(let l of o){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}}}};Cs.create=(s,t,e)=>new Cs({valueType:t,keyType:s,typeName:z.ZodMap,...$(e)});var Os=class s extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.set)return A(r,{code:L.invalid_type,expected:M.set,received:r.parsedType}),q;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(A(r,{code:L.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(A(r,{code:L.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty());let n=this._def.valueType;function o(l){let c=new Set;for(let u of l){if(u.status==="aborted")return q;u.status==="dirty"&&e.dirty(),c.add(u.value)}return{status:e.value,value:c}}let a=[...r.data.values()].map((l,c)=>n._parse(new be(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new s({...this._def,minSize:{value:t,message:k.toString(e)}})}max(t,e){return new s({...this._def,maxSize:{value:t,message:k.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};Os.create=(s,t)=>new Os({valueType:s,minSize:null,maxSize:null,typeName:z.ZodSet,...$(t)});var Nr=class s extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==M.function)return A(e,{code:L.invalid_type,expected:M.function,received:e.parsedType}),q;function r(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Lr(),vs].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function i(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Lr(),vs].filter(c=>!!c),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let n={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof mt){let a=this;return Ce(async function(...l){let c=new Te([]),u=await a._def.args.parseAsync(l,n).catch(d=>{throw c.addIssue(r(l,d)),c}),p=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(p,n).catch(d=>{throw c.addIssue(i(p,d)),c})})}else{let a=this;return Ce(function(...l){let c=a._def.args.safeParse(l,n);if(!c.success)throw new Te([r(l,c.error)]);let u=Reflect.apply(o,this,c.data),p=a._def.returns.safeParse(u,n);if(!p.success)throw new Te([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new s({...this._def,args:Ye.create(t).rest(rt.create())})}returns(t){return new s({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,r){return new s({args:t||Ye.create([]).rest(rt.create()),returns:e||rt.create(),typeName:z.ZodFunction,...$(r)})}},Qt=class extends Y{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Qt.create=(s,t)=>new Qt({getter:s,typeName:z.ZodLazy,...$(t)});var es=class extends Y{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return A(e,{received:e.data,code:L.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};es.create=(s,t)=>new es({value:s,typeName:z.ZodLiteral,...$(t)});function Ti(s,t){return new ts({values:s,typeName:z.ZodEnum,...$(t)})}var ts=class s extends Y{constructor(){super(...arguments),zs.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),r=this._def.values;return A(e,{expected:te.joinValues(r),received:e.parsedType,code:L.invalid_type}),q}if(Pr(this,zs,"f")||Ii(this,zs,new Set(this._def.values),"f"),!Pr(this,zs,"f").has(t.data)){let e=this._getOrReturnCtx(t),r=this._def.values;return A(e,{received:e.data,code:L.invalid_enum_value,options:r}),q}return Ce(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return s.create(t,{...this._def,...e})}exclude(t,e=this._def){return s.create(this.options.filter(r=>!t.includes(r)),{...this._def,...e})}};zs=new WeakMap;ts.create=Ti;var ss=class extends Y{constructor(){super(...arguments),qs.set(this,void 0)}_parse(t){let e=te.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=te.objectValues(e);return A(r,{expected:te.joinValues(i),received:r.parsedType,code:L.invalid_type}),q}if(Pr(this,qs,"f")||Ii(this,qs,new Set(te.getValidEnumValues(this._def.values)),"f"),!Pr(this,qs,"f").has(t.data)){let i=te.objectValues(e);return A(r,{received:r.data,code:L.invalid_enum_value,options:i}),q}return Ce(t.data)}get enum(){return this._def.values}};qs=new WeakMap;ss.create=(s,t)=>new ss({values:s,typeName:z.ZodNativeEnum,...$(t)});var mt=class extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==M.promise&&e.common.async===!1)return A(e,{code:L.invalid_type,expected:M.promise,received:e.parsedType}),q;let r=e.parsedType===M.promise?e.data:Promise.resolve(e.data);return Ce(r.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};mt.create=(s,t)=>new mt({type:s,typeName:z.ZodPromise,...$(t)});var Ve=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=this._def.effect||null,n={addIssue:o=>{A(r,o),o.fatal?e.abort():e.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(r.data,n);if(r.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return q;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?q:l.status==="dirty"||e.value==="dirty"?Ss(l.value):l});{if(e.value==="aborted")return q;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?q:a.status==="dirty"||e.value==="dirty"?Ss(a.value):a}}if(i.type==="refinement"){let o=a=>{let l=i.refinement(a,n);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?q:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Hs(o))return o;let a=i.transform(o.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Hs(o)?Promise.resolve(i.transform(o.value,n)).then(a=>({status:e.value,value:a})):o);te.assertNever(i)}};Ve.create=(s,t,e)=>new Ve({schema:s,typeName:z.ZodEffects,effect:t,...$(e)});Ve.createWithPreprocess=(s,t,e)=>new Ve({schema:t,effect:{type:"preprocess",transform:s},typeName:z.ZodEffects,...$(e)});var Ae=class extends Y{_parse(t){return this._getType(t)===M.undefined?Ce(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ae.create=(s,t)=>new Ae({innerType:s,typeName:z.ZodOptional,...$(t)});var Xe=class extends Y{_parse(t){return this._getType(t)===M.null?Ce(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Xe.create=(s,t)=>new Xe({innerType:s,typeName:z.ZodNullable,...$(t)});var rs=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};rs.create=(s,t)=>new rs({innerType:s,typeName:z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var ns=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $s(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ns.create=(s,t)=>new ns({innerType:s,typeName:z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var Is=class extends Y{_parse(t){if(this._getType(t)!==M.nan){let r=this._getOrReturnCtx(t);return A(r,{code:L.invalid_type,expected:M.nan,received:r.parsedType}),q}return{status:"valid",value:t.data}}};Is.create=s=>new Is({typeName:z.ZodNaN,...$(s)});var cl=Symbol("zod_brand"),Ys=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},Xs=class s extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?q:n.status==="dirty"?(e.dirty(),Ss(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?q:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new s({in:t,out:e,typeName:z.ZodPipeline})}},is=class extends Y{_parse(t){let e=this._def.innerType._parse(t),r=i=>(Hs(i)&&(i.value=Object.freeze(i.value)),i);return $s(e)?e.then(i=>r(i)):r(e)}unwrap(){return this._def.innerType}};is.create=(s,t)=>new is({innerType:s,typeName:z.ZodReadonly,...$(t)});function Vi(s,t={},e){return s?dt.create().superRefine((r,i)=>{var n,o;if(!s(r)){let a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(n=a.fatal)!==null&&n!==void 0?n:e)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):dt.create()}var ul={object:Le.lazycreate},z;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(z||(z={}));var pl=(s,t={message:`Input not instance of ${s.name}`})=>Vi(e=>e instanceof s,t),Ni=ft.create,Di=qt.create,fl=Is.create,dl=Ht.create,Ai=$t.create,ml=Yt.create,hl=xs.create,gl=Xt.create,yl=Kt.create,_l=dt.create,Sl=rt.create,vl=je.create,xl=ws.create,wl=nt.create,Ks=Le.create,Cl=Le.strictCreate,Ol=Zt.create,Il=Tr.create,Ll=Jt.create,El=Ye.create,Pl=Vr.create,Tl=Cs.create,Vl=Os.create,Nl=Nr.create,Dl=Qt.create,Al=es.create,bl=ts.create,Ml=ss.create,Rl=mt.create,Ci=Ve.create,kl=Ae.create,Fl=Xe.create,Bl=Ve.createWithPreprocess,Wl=Xs.create,Ul=()=>Ni().optional(),Gl=()=>Di().optional(),jl=()=>Ai().optional(),zl={string:s=>ft.create({...s,coerce:!0}),number:s=>qt.create({...s,coerce:!0}),boolean:s=>$t.create({...s,coerce:!0}),bigint:s=>Ht.create({...s,coerce:!0}),date:s=>Yt.create({...s,coerce:!0})},ql=q,Zs=Object.freeze({__proto__:null,defaultErrorMap:vs,setErrorMap:Ha,getErrorMap:Lr,makeIssue:Er,EMPTY_PATH:$a,addIssueToContext:A,ParseStatus:ve,INVALID:q,DIRTY:Ss,OK:Ce,isAborted:yn,isDirty:_n,isValid:Hs,isAsync:$s,get util(){return te},get objectUtil(){return gn},ZodParsedType:M,getParsedType:pt,ZodType:Y,datetimeRegex:Pi,ZodString:ft,ZodNumber:qt,ZodBigInt:Ht,ZodBoolean:$t,ZodDate:Yt,ZodSymbol:xs,ZodUndefined:Xt,ZodNull:Kt,ZodAny:dt,ZodUnknown:rt,ZodNever:je,ZodVoid:ws,ZodArray:nt,ZodObject:Le,ZodUnion:Zt,ZodDiscriminatedUnion:Tr,ZodIntersection:Jt,ZodTuple:Ye,ZodRecord:Vr,ZodMap:Cs,ZodSet:Os,ZodFunction:Nr,ZodLazy:Qt,ZodLiteral:es,ZodEnum:ts,ZodNativeEnum:ss,ZodPromise:mt,ZodEffects:Ve,ZodTransformer:Ve,ZodOptional:Ae,ZodNullable:Xe,ZodDefault:rs,ZodCatch:ns,ZodNaN:Is,BRAND:cl,ZodBranded:Ys,ZodPipeline:Xs,ZodReadonly:is,custom:Vi,Schema:Y,ZodSchema:Y,late:ul,get ZodFirstPartyTypeKind(){return z},coerce:zl,any:_l,array:wl,bigint:dl,boolean:Ai,date:ml,discriminatedUnion:Il,effect:Ci,enum:bl,function:Nl,instanceof:pl,intersection:Ll,lazy:Dl,literal:Al,map:Tl,nan:fl,nativeEnum:Ml,never:vl,null:yl,nullable:Fl,number:Di,object:Ks,oboolean:jl,onumber:Gl,optional:kl,ostring:Ul,pipeline:Wl,preprocess:Bl,promise:Rl,record:Pl,set:Vl,strictObject:Cl,string:Ni,symbol:hl,transformer:Ci,tuple:El,undefined:gl,union:Ol,unknown:Sl,void:xl,NEVER:ql,ZodIssueCode:L,quotelessJson:qa,ZodError:Te});function bi(s){let t=s.runtimeEnvStrict??s.runtimeEnv??process.env;if(s.emptyStringAsUndefined??!1)for(let[N,T]of Object.entries(t))T===""&&delete t[N];if(!!s.skipValidation)return t;let i=typeof s.client=="object"?s.client:{},n=typeof s.server=="object"?s.server:{},o=typeof s.shared=="object"?s.shared:{},a=Ks(i),l=Ks(n),c=Ks(o),u=s.isServer??(typeof window>"u"||"Deno"in window),p=a.merge(c),f=l.merge(c).merge(a),d=u?f.safeParse(t):p.safeParse(t),m=s.onValidationError??(N=>{throw console.error("\u274C Invalid environment variables:",N.flatten().fieldErrors),new Error("Invalid environment variables")}),g=s.onInvalidAccess??(N=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(d.success===!1)return m(d.error);let _=N=>s.clientPrefix?!N.startsWith(s.clientPrefix)&&!(N in c.shape):!0,h=N=>u||!_(N),y=N=>N==="__esModule"||N==="$$typeof",S=(s.extends??[]).reduce((N,T)=>Object.assign(N,T),{}),v=Object.assign(d.data,S);return new Proxy(v,{get(N,T){if(typeof T=="string"&&!y(T))return h(T)?Reflect.get(N,T):g(T)}})}var Ls=(o=>(o.PROD_CN="prod-cn",o.PROD="prod",o.STAGING="staging",o.STAGING_CN="staging-cn",o.DEV="dev",o.LOCAL="local",o))(Ls||{}),Mi=({fallback:s="prod"})=>{let t=process.env.ENV;if(!t)return s;let e=t.toLowerCase().trim();return Object.values(Ls).includes(e)?e:s};var Hl=s=>{switch(s){case"local":return{CONNECT_API_BASE_URL:"http://localhost:3000/rest",CANVA_ENV_URL:"http://localhost:3000",CANVA_CLI_CLIENT_ID:"FAKE_CLIENT_ID",FLAVOR:"local"};case"dev":return{CONNECT_API_BASE_URL:"https://api.canva-dev.com/rest",CANVA_ENV_URL:"https://www.canva-dev.com",CANVA_CLI_CLIENT_ID:"OC-AZFEJKOjQYw3",FLAVOR:"dev"};case"staging-cn":return{CONNECT_API_BASE_URL:"https://api.canva-staging.cn/rest",CANVA_ENV_URL:"https://www.canva-staging.cn",CANVA_CLI_CLIENT_ID:"OC-AZNlOhtxI_Zb",FLAVOR:"staging-cn"};case"staging":return{CONNECT_API_BASE_URL:"https://api.canva-staging.com/rest",CANVA_ENV_URL:"https://www.canva-staging.com",CANVA_CLI_CLIENT_ID:"OC-AZH-EOTpT8Ib",FLAVOR:"staging"};case"prod-cn":return{CONNECT_API_BASE_URL:"https://api.canva.cn/rest",CANVA_ENV_URL:"https://www.canva.cn",CANVA_CLI_CLIENT_ID:"OC-AZN2AS1hKtVM",FLAVOR:"prod-cn"};case"prod":default:return{CONNECT_API_BASE_URL:"https://api.canva.com/rest",CANVA_ENV_URL:"https://www.canva.com",CANVA_CLI_CLIENT_ID:"OC-AZICxlGo2biD",FLAVOR:"prod"}}},Ri=({fallback:s="prod"})=>bi({server:{FLAVOR:Zs.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(s),CONNECT_API_BASE_URL:Zs.string().url(),CANVA_ENV_URL:Zs.string().url(),CANVA_CLI_CLIENT_ID:Zs.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD")},runtimeEnv:Hl(Mi({fallback:s})),emptyStringAsUndefined:!0});var Dr=class{constructor(t,e,r=!1){this.storageService=t;this.env=e;this.debug=r}generatePreviewResult=async t=>{let e=t;if(!e){let i=await this.getAppId();if(!i.success)return i;e=i.data}return{success:!0,data:this.constructPreviewUrl(e)}};async getAppId(){try{let t=await this.storageService.getAppIdFromEnvFile();if(!t.success)return t;let e=t.data;if(e==="YOUR_APP_ID_HERE"){let r="CANVA_APP_ID is set to the default placeholder value. Please update it in the .env file.";return this.debug&&console.error(r),{success:!1,code:"MISSING_FIELD",message:r}}return{success:!0,data:e}}catch(t){let e=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(e),{success:!1,code:"ENV_READ_ERROR",message:e}}}constructPreviewUrl(t){let e=this.encodeUiState({appId:t}),r=this.env.CANVA_ENV_URL,i=new URL("/login/",r),n=new URL("/design",r);return n.searchParams.append("create",""),n.searchParams.append("width","800"),n.searchParams.append("height","600"),n.searchParams.append("units","px"),n.searchParams.append("ui",e),i.searchParams.append("redirect",n.pathname+n.search),i.toString()}encodeUiState(t){let e={E:{"A?":"N",S:t.appId,g:!0}},r=JSON.stringify(e);return btoa(r).replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")}};var js=ys(require("crypto"),1),Pa=ys(Ea(),1);var fn=class{KEY_DERIVATION_ITERATIONS=1e5;KEY_LENGTH=32;async generateMachineId(){let t=await Pa.default.uuid();return`${t.os}::${t.hardware}`}deriveKeyFromMachineId(t,e){return js.default.pbkdf2Sync(t,e,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let e=await this.generateMachineId(),r=js.default.randomBytes(16),i=this.deriveKeyFromMachineId(e,r),n=js.default.randomBytes(12),o=js.default.createCipheriv("aes-256-gcm",i,n),a=o.update(t,"utf8","hex");a+=o.final("hex");let l={iv:n.toString("hex"),authTag:o.getAuthTag().toString("hex"),cipherText:a,salt:r.toString("hex")};return{success:!0,data:[l.iv,l.authTag,l.cipherText,l.salt].join(":")}}catch(e){return{success:!1,code:"ENCRYPTION_ERROR",message:`Encryption failed: ${e instanceof Error?e.message:String(e)}`}}}async decrypt(t){try{let e=await this.generateMachineId(),r=t.split(":");if(r.length!==4)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Invalid encrypted data format."};let[i,n,o,a]=r;if(!i||!n||!o||!a)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Missing required components for decryption."};let l=Buffer.from(i,"hex"),c=Buffer.from(n,"hex"),u=Buffer.from(a,"hex"),p=this.deriveKeyFromMachineId(e,u),f=js.default.createDecipheriv("aes-256-gcm",p,l);f.setAuthTag(c);let d=f.update(o,"hex","utf8");return d+=f.final("utf8"),{success:!0,data:d}}catch(e){return{success:!1,code:"DECRYPTION_ERROR",message:`Decryption failed: ${e instanceof Error?e.message:String(e)}`}}}};var ba=ys(require("fs/promises"),1),Ma=ys(require("os"),1),Ra=ys(require("path"),1),ka=ys(Aa(),1);var mn=class{constructor(t,e=ba.default,r=Ra.default,i=Ma.default.homedir(),n=!1){this.encryptionService=t;this.fileSystem=e;this.pathModule=r;this.debug=n;this.filePath=this.pathModule.join(i,".canva-cli","credentials")}tokenKey="tokenData";flavorKey="flavor";filePath;isNodeError(t){return t instanceof Error&&typeof t.code=="string"}async ensureDirectoryExists(t){try{await this.fileSystem.mkdir(t,{recursive:!0})}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to create directory ${t}: ${r}`)}}async readJsonFromFile(){try{let t=await this.fileSystem.readFile(this.filePath,"utf-8");return JSON.parse(t)}catch(t){let e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read the file at ${this.filePath}: ${e}`)}}async writeJsonToFile(t){try{await this.fileSystem.writeFile(this.filePath,JSON.stringify(t,null,2),"utf-8")}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to write the file at ${this.filePath}: ${r}`)}try{await this.fileSystem.chmod(this.filePath,384)}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to set permissions on the file at ${this.filePath}: ${r}`)}}async saveTokenData({tokenData:t,flavor:e}){let r=await this.encryptionService.encrypt(JSON.stringify(t));if(!r.success)return{success:!1,code:"ENCRYPTION_ERROR",message:`Failed to encrypt token data: ${r.message}`};let i={tokenData:r.data,flavor:e};try{let n=this.pathModule.dirname(this.filePath);return await this.ensureDirectoryExists(n),await this.writeJsonToFile(i),{success:!0,data:void 0}}catch(n){let o=n instanceof Error?n.message:String(n);return{success:!1,code:"API_FAILURE",message:`Failed to save token data to file: ${o}`}}}async getTokenData(){try{let t=await this.readJsonFromFile();if(t[this.tokenKey]){let e=await this.encryptionService.decrypt(t[this.tokenKey]);return e.success?{success:!0,data:JSON.parse(e.data)}:e}else return{success:!1,code:"NO_TOKEN",message:"Token data not found in credentials file."}}catch(t){let e=t instanceof Error?t.message:String(t);return{success:!1,code:"NO_TOKEN",message:`Failed to read the token file: ${e}`}}}async getFlavor(){try{let e=(await this.readJsonFromFile())[this.flavorKey];if(e&&typeof e=="string"&&Object.values(Ls).includes(e))return e}catch{return"prod"}return"prod"}async deleteToken(){try{if((await this.readJsonFromFile())[this.tokenKey])try{await this.fileSystem.access(this.filePath),await this.fileSystem.unlink(this.filePath)}catch(e){if(this.isNodeError(e)&&e.code==="ENOENT")return;let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to delete the token data file: ${r}`)}else throw new Error("Token file does not exist or token data not found.")}catch(t){let e=t instanceof Error?t.message:String(t);throw new Error(`Failed to delete the token data file: ${e}`)}}async getAppIdFromEnvFile(){try{let t=this.pathModule.resolve(process.cwd(),".env");try{await this.fileSystem.access(t)}catch{let n="No .env file found, ensure you are in your intended app's directory.";return this.debug&&console.error(n),{success:!1,code:"FILE_NOT_FOUND",message:n}}let e=await this.fileSystem.readFile(t,"utf-8"),i=ka.parse(e).CANVA_APP_ID;if(!i){let n="CANVA_APP_ID not found in .env file";return this.debug&&console.error(n),{success:!1,code:"MISSING_FIELD",message:n}}return{success:!0,data:i}}catch(t){let e=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(e),{success:!1,code:"ENV_READ_ERROR",message:e}}}};var Ed=Ri({fallback:"prod"}),Pd=new fn,Td=new mn(Pd),Vd=new Dr(Td,Ed),Nd=()=>Vd.generatePreviewResult();0&&(module.exports={generatePreviewUrl});
|
|
382
|
+
`);if(Le.getValue(c,"class",":",!0).toLowerCase().indexOf("audio")>=0){let u=Z0(c,o);e.push(u)}})}n&&n(e),t(e)}),H0&&ya("system_profiler SPAudioDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPAudioDataType&&o.SPAudioDataType.length&&o.SPAudioDataType[0]&&o.SPAudioDataType[0]._items&&o.SPAudioDataType[0]._items.length)for(let a=0;a<o.SPAudioDataType[0]._items.length;a++){let l=Q0(o.SPAudioDataType[0]._items[a],a);e.push(l)}}catch{Le.noop()}n&&n(e),t(e)}),j0&&Le.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then((r,i)=>{i||r.toString().split(/\n\s*\n/).forEach(o=>{let a=o.split(`
|
|
383
|
+
`);Le.getValue(a,"name",":")&&e.push(ed(a))}),n&&n(e),t(e)}),Y0&&t(null)})})}xa.audio=td});var Ca=oe((Tf,_a)=>{"use strict";_a.exports={0:"Ericsson Technology Licensing",1:"Nokia Mobile Phones",2:"Intel Corp.",3:"IBM Corp.",4:"Toshiba Corp.",5:"3Com",6:"Microsoft",7:"Lucent",8:"Motorola",9:"Infineon Technologies AG",10:"Cambridge Silicon Radio",11:"Silicon Wave",12:"Digianswer A/S",13:"Texas Instruments Inc.",14:"Ceva, Inc. (formerly Parthus Technologies, Inc.)",15:"Broadcom Corporation",16:"Mitel Semiconductor",17:"Widcomm, Inc",18:"Zeevo, Inc.",19:"Atmel Corporation",20:"Mitsubishi Electric Corporation",21:"RTX Telecom A/S",22:"KC Technology Inc.",23:"NewLogic",24:"Transilica, Inc.",25:"Rohde & Schwarz GmbH & Co. KG",26:"TTPCom Limited",27:"Signia Technologies, Inc.",28:"Conexant Systems Inc.",29:"Qualcomm",30:"Inventel",31:"AVM Berlin",32:"BandSpeed, Inc.",33:"Mansella Ltd",34:"NEC Corporation",35:"WavePlus Technology Co., Ltd.",36:"Alcatel",37:"NXP Semiconductors (formerly Philips Semiconductors)",38:"C Technologies",39:"Open Interface",40:"R F Micro Devices",41:"Hitachi Ltd",42:"Symbol Technologies, Inc.",43:"Tenovis",44:"Macronix International Co. Ltd.",45:"GCT Semiconductor",46:"Norwood Systems",47:"MewTel Technology Inc.",48:"ST Microelectronics",49:"Synopsis",50:"Red-M (Communications) Ltd",51:"Commil Ltd",52:"Computer Access Technology Corporation (CATC)",53:"Eclipse (HQ Espana) S.L.",54:"Renesas Electronics Corporation",55:"Mobilian Corporation",56:"Terax",57:"Integrated System Solution Corp.",58:"Matsushita Electric Industrial Co., Ltd.",59:"Gennum Corporation",60:"BlackBerry Limited (formerly Research In Motion)",61:"IPextreme, Inc.",62:"Systems and Chips, Inc.",63:"Bluetooth SIG, Inc.",64:"Seiko Epson Corporation",65:"Integrated Silicon Solution Taiwan, Inc.",66:"CONWISE Technology Corporation Ltd",67:"PARROT SA",68:"Socket Mobile",69:"Atheros Communications, Inc.",70:"MediaTek, Inc.",71:"Bluegiga",72:"Marvell Technology Group Ltd.",73:"3DSP Corporation",74:"Accel Semiconductor Ltd.",75:"Continental Automotive Systems",76:"Apple, Inc.",77:"Staccato Communications, Inc.",78:"Avago Technologies",79:"APT Licensing Ltd.",80:"SiRF Technology",81:"Tzero Technologies, Inc.",82:"J&M Corporation",83:"Free2move AB",84:"3DiJoy Corporation",85:"Plantronics, Inc.",86:"Sony Ericsson Mobile Communications",87:"Harman International Industries, Inc.",88:"Vizio, Inc.",89:"Nordic Semiconductor ASA",90:"EM Microelectronic-Marin SA",91:"Ralink Technology Corporation",92:"Belkin International, Inc.",93:"Realtek Semiconductor Corporation",94:"Stonestreet One, LLC",95:"Wicentric, Inc.",96:"RivieraWaves S.A.S",97:"RDA Microelectronics",98:"Gibson Guitars",99:"MiCommand Inc.",100:"Band XI International, LLC",101:"Hewlett-Packard Company",102:"9Solutions Oy",103:"GN Netcom A/S",104:"General Motors",105:"A&D Engineering, Inc.",106:"MindTree Ltd.",107:"Polar Electro OY",108:"Beautiful Enterprise Co., Ltd.",109:"BriarTek, Inc.",110:"Summit Data Communications, Inc.",111:"Sound ID",112:"Monster, LLC",113:"connectBlue AB",114:"ShangHai Super Smart Electronics Co. Ltd.",115:"Group Sense Ltd.",116:"Zomm, LLC",117:"Samsung Electronics Co. Ltd.",118:"Creative Technology Ltd.",119:"Laird Technologies",120:"Nike, Inc.",121:"lesswire AG",122:"MStar Semiconductor, Inc.",123:"Hanlynn Technologies",124:"A & R Cambridge",125:"Seers Technology Co. Ltd",126:"Sports Tracking Technologies Ltd.",127:"Autonet Mobile",128:"DeLorme Publishing Company, Inc.",129:"WuXi Vimicro",130:"Sennheiser Communications A/S",131:"TimeKeeping Systems, Inc.",132:"Ludus Helsinki Ltd.",133:"BlueRadios, Inc.",134:"equinox AG",135:"Garmin International, Inc.",136:"Ecotest",137:"GN ReSound A/S",138:"Jawbone",139:"Topcorn Positioning Systems, LLC",140:"Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)",141:"Zscan Software",142:"Quintic Corp.",143:"Stollman E+V GmbH",144:"Funai Electric Co., Ltd.",145:"Advanced PANMOBIL Systems GmbH & Co. KG",146:"ThinkOptics, Inc.",147:"Universal Electronics, Inc.",148:"Airoha Technology Corp.",149:"NEC Lighting, Ltd.",150:"ODM Technology, Inc.",151:"ConnecteDevice Ltd.",152:"zer01.tv GmbH",153:"i.Tech Dynamic Global Distribution Ltd.",154:"Alpwise",155:"Jiangsu Toppower Automotive Electronics Co., Ltd.",156:"Colorfy, Inc.",157:"Geoforce Inc.",158:"Bose Corporation",159:"Suunto Oy",160:"Kensington Computer Products Group",161:"SR-Medizinelektronik",162:"Vertu Corporation Limited",163:"Meta Watch Ltd.",164:"LINAK A/S",165:"OTL Dynamics LLC",166:"Panda Ocean Inc.",167:"Visteon Corporation",168:"ARP Devices Limited",169:"Magneti Marelli S.p.A",170:"CAEN RFID srl",171:"Ingenieur-Systemgruppe Zahn GmbH",172:"Green Throttle Games",173:"Peter Systemtechnik GmbH",174:"Omegawave Oy",175:"Cinetix",176:"Passif Semiconductor Corp",177:"Saris Cycling Group, Inc",178:"Bekey A/S",179:"Clarinox Technologies Pty. Ltd.",180:"BDE Technology Co., Ltd.",181:"Swirl Networks",182:"Meso international",183:"TreLab Ltd",184:"Qualcomm Innovation Center, Inc. (QuIC)",185:"Johnson Controls, Inc.",186:"Starkey Laboratories Inc.",187:"S-Power Electronics Limited",188:"Ace Sensor Inc",189:"Aplix Corporation",190:"AAMP of America",191:"Stalmart Technology Limited",192:"AMICCOM Electronics Corporation",193:"Shenzhen Excelsecu Data Technology Co.,Ltd",194:"Geneq Inc.",195:"adidas AG",196:"LG Electronics",197:"Onset Computer Corporation",198:"Selfly BV",199:"Quuppa Oy.",200:"GeLo Inc",201:"Evluma",202:"MC10",203:"Binauric SE",204:"Beats Electronics",205:"Microchip Technology Inc.",206:"Elgato Systems GmbH",207:"ARCHOS SA",208:"Dexcom, Inc.",209:"Polar Electro Europe B.V.",210:"Dialog Semiconductor B.V.",211:"Taixingbang\xA0Technology (HK) Co,. LTD.",212:"Kawantech",213:"Austco Communication Systems",214:"Timex Group USA, Inc.",215:"Qualcomm Technologies, Inc.",216:"Qualcomm Connected Experiences, Inc.",217:"Voyetra Turtle Beach",218:"txtr GmbH",219:"Biosentronics",220:"Procter & Gamble",221:"Hosiden Corporation",222:"Muzik LLC",223:"Misfit Wearables Corp",224:"Google",225:"Danlers Ltd",226:"Semilink Inc",227:"inMusic Brands, Inc",228:"L.S. Research Inc.",229:"Eden Software Consultants Ltd.",230:"Freshtemp",231:"KS Technologies",232:"ACTS Technologies",233:"Vtrack Systems",234:"Nielsen-Kellerman Company",235:"Server Technology, Inc.",236:"BioResearch Associates",237:"Jolly Logic, LLC",238:"Above Average Outcomes, Inc.",239:"Bitsplitters GmbH",240:"PayPal, Inc.",241:"Witron Technology Limited",242:"Aether Things\xA0Inc. (formerly Morse Project Inc.)",243:"Kent Displays Inc.",244:"Nautilus Inc.",245:"Smartifier Oy",246:"Elcometer Limited",247:"VSN Technologies Inc.",248:"AceUni Corp., Ltd.",249:"StickNFind",250:"Crystal Code AB",251:"KOUKAAM a.s.",252:"Delphi Corporation",253:"ValenceTech Limited",254:"Reserved",255:"Typo Products, LLC",256:"TomTom International BV",257:"Fugoo, Inc",258:"Keiser Corporation",259:"Bang & Olufsen A/S",260:"PLUS Locations Systems Pty Ltd",261:"Ubiquitous Computing Technology Corporation",262:"Innovative Yachtter Solutions",263:"William Demant Holding A/S",264:"Chicony Electronics Co., Ltd.",265:"Atus BV",266:"Codegate Ltd.",267:"ERi, Inc.",268:"Transducers Direct, LLC",269:"Fujitsu Ten Limited",270:"Audi AG",271:"HiSilicon Technologies Co., Ltd.",272:"Nippon Seiki Co., Ltd.",273:"Steelseries ApS",274:"vyzybl Inc.",275:"Openbrain Technologies, Co., Ltd.",276:"Xensr",277:"e.solutions",278:"1OAK Technologies",279:"Wimoto Technologies Inc",280:"Radius Networks, Inc.",281:"Wize Technology Co., Ltd.",282:"Qualcomm Labs, Inc.",283:"Aruba Networks",284:"Baidu",285:"Arendi AG",286:"Skoda Auto a.s.",287:"Volkswagon AG",288:"Porsche AG",289:"Sino Wealth Electronic Ltd.",290:"AirTurn, Inc.",291:"Kinsa, Inc.",292:"HID Global",293:"SEAT es",294:"Promethean Ltd.",295:"Salutica Allied Solutions",296:"GPSI Group Pty Ltd",297:"Nimble Devices Oy",298:"Changzhou Yongse Infotech Co., Ltd",299:"SportIQ",300:"TEMEC Instruments B.V.",301:"Sony Corporation",302:"ASSA ABLOY",303:"Clarion Co., Ltd.",304:"Warehouse Innovations",305:"Cypress Semiconductor Corporation",306:"MADS Inc",307:"Blue Maestro Limited",308:"Resolution Products, Inc.",309:"Airewear LLC",310:"Seed Labs, Inc. (formerly ETC sp. z.o.o.)",311:"Prestigio Plaza Ltd.",312:"NTEO Inc.",313:"Focus Systems Corporation",314:"Tencent Holdings Limited",315:"Allegion",316:"Murata Manufacuring Co., Ltd.",318:"Nod, Inc.",319:"B&B Manufacturing Company",320:"Alpine\xA0Electronics\xA0(China)\xA0Co.,\xA0Ltd",321:"FedEx Services",322:"Grape Systems Inc.",323:"Bkon Connect",324:"Lintech GmbH",325:"Novatel Wireless",326:"Ciright",327:"Mighty Cast, Inc.",328:"Ambimat Electronics",329:"Perytons Ltd.",330:"Tivoli Audio, LLC",331:"Master Lock",332:"Mesh-Net Ltd",333:"Huizhou Desay SV Automotive CO., LTD.",334:"Tangerine, Inc.",335:"B&W Group Ltd.",336:"Pioneer Corporation",337:"OnBeep",338:"Vernier Software & Technology",339:"ROL Ergo",340:"Pebble Technology",341:"NETATMO",342:"Accumulate AB",343:"Anhui Huami Information Technology Co., Ltd.",344:"Inmite s.r.o.",345:"ChefSteps, Inc.",346:"micas AG",347:"Biomedical Research Ltd.",348:"Pitius Tec S.L.",349:"Estimote, Inc.",350:"Unikey Technologies, Inc.",351:"Timer Cap Co.",352:"AwoX",353:"yikes",354:"MADSGlobal NZ Ltd.",355:"PCH International",356:"Qingdao Yeelink Information Technology Co., Ltd.",357:"Milwaukee Tool (formerly Milwaukee Electric Tools)",358:"MISHIK Pte Ltd",359:"Bayer HealthCare",360:"Spicebox LLC",361:"emberlight",362:"Cooper-Atkins Corporation",363:"Qblinks",364:"MYSPHERA",365:"LifeScan Inc",366:"Volantic AB",367:"Podo Labs, Inc",368:"Roche Diabetes Care AG",369:"Amazon Fulfillment Service",370:"Connovate Technology Private Limited",371:"Kocomojo, LLC",372:"Everykey LLC",373:"Dynamic Controls",374:"SentriLock",375:"I-SYST inc.",376:"CASIO COMPUTER CO., LTD.",377:"LAPIS Semiconductor Co., Ltd.",378:"Telemonitor, Inc.",379:"taskit GmbH",380:"Daimler AG",381:"BatAndCat",382:"BluDotz Ltd",383:"XTel ApS",384:"Gigaset Communications GmbH",385:"Gecko Health Innovations, Inc.",386:"HOP Ubiquitous",387:"To Be Assigned",388:"Nectar",389:"bel\u2019apps LLC",390:"CORE Lighting Ltd",391:"Seraphim Sense Ltd",392:"Unico RBC",393:"Physical Enterprises Inc.",394:"Able Trend Technology Limited",395:"Konica Minolta, Inc.",396:"Wilo SE",397:"Extron Design Services",398:"Fitbit, Inc.",399:"Fireflies Systems",400:"Intelletto Technologies Inc.",401:"FDK CORPORATION",402:"Cloudleaf, Inc",403:"Maveric Automation LLC",404:"Acoustic Stream Corporation",405:"Zuli",406:"Paxton Access Ltd",407:"WiSilica Inc",408:"Vengit Limited",409:"SALTO SYSTEMS S.L.",410:"TRON Forum (formerly T-Engine Forum)",411:"CUBETECH s.r.o.",412:"Cokiya Incorporated",413:"CVS Health",414:"Ceruus",415:"Strainstall Ltd",416:"Channel Enterprises (HK) Ltd.",417:"FIAMM",418:"GIGALANE.CO.,LTD",419:"EROAD",420:"Mine Safety Appliances",421:"Icon Health and Fitness",422:"Asandoo GmbH",423:"ENERGOUS CORPORATION",424:"Taobao",425:"Canon Inc.",426:"Geophysical Technology Inc.",427:"Facebook, Inc.",428:"Nipro Diagnostics, Inc.",429:"FlightSafety International",430:"Earlens Corporation",431:"Sunrise Micro Devices, Inc.",432:"Star Micronics Co., Ltd.",433:"Netizens Sp. z o.o.",434:"Nymi Inc.",435:"Nytec, Inc.",436:"Trineo Sp. z o.o.",437:"Nest Labs Inc.",438:"LM Technologies Ltd",439:"General Electric Company",440:"i+D3 S.L.",441:"HANA Micron",442:"Stages Cycling LLC",443:"Cochlear Bone Anchored Solutions AB",444:"SenionLab AB",445:"Syszone Co., Ltd",446:"Pulsate Mobile Ltd.",447:"Hong Kong HunterSun Electronic Limited",448:"pironex GmbH",449:"BRADATECH Corp.",450:"Transenergooil AG",451:"Bunch",452:"DME Microelectronics",453:"Bitcraze AB",454:"HASWARE Inc.",455:"Abiogenix Inc.",456:"Poly-Control ApS",457:"Avi-on",458:"Laerdal Medical AS",459:"Fetch My Pet",460:"Sam Labs Ltd.",461:"Chengdu Synwing Technology Ltd",462:"HOUWA SYSTEM DESIGN, k.k.",463:"BSH",464:"Primus Inter Pares Ltd",465:"August",466:"Gill Electronics",467:"Sky Wave Design",468:"Newlab S.r.l.",469:"ELAD srl",470:"G-wearables inc.",471:"Squadrone Systems Inc.",472:"Code Corporation",473:"Savant Systems LLC",474:"Logitech International SA",475:"Innblue Consulting",476:"iParking Ltd.",477:"Koninklijke Philips Electronics N.V.",478:"Minelab Electronics Pty Limited",479:"Bison Group Ltd.",480:"Widex A/S",481:"Jolla Ltd",482:"Lectronix, Inc.",483:"Caterpillar Inc",484:"Freedom Innovations",485:"Dynamic Devices Ltd",486:"Technology Solutions (UK) Ltd",487:"IPS Group Inc.",488:"STIR",489:"Sano, Inc",490:"Advanced Application Design, Inc.",491:"AutoMap LLC",492:"Spreadtrum Communications Shanghai Ltd",493:"CuteCircuit LTD",494:"Valeo Service",495:"Fullpower Technologies, Inc.",496:"KloudNation",497:"Zebra Technologies Corporation",498:"Itron, Inc.",499:"The University of Tokyo",500:"UTC Fire and Security",501:"Cool Webthings Limited",502:"DJO Global",503:"Gelliner Limited",504:"Anyka (Guangzhou) Microelectronics Technology Co, LTD",505:"Medtronic, Inc.",506:"Gozio, Inc.",507:"Form Lifting, LLC",508:"Wahoo Fitness, LLC",509:"Kontakt Micro-Location Sp. z o.o.",510:"Radio System Corporation",511:"Freescale Semiconductor, Inc.",512:"Verifone Systems PTe Ltd. Taiwan Branch",513:"AR Timing",514:"Rigado LLC",515:"Kemppi Oy",516:"Tapcentive Inc.",517:"Smartbotics Inc.",518:"Otter Products, LLC",519:"STEMP Inc.",520:"LumiGeek LLC",521:"InvisionHeart Inc.",522:"Macnica Inc. ",523:"Jaguar Land Rover Limited",524:"CoroWare Technologies, Inc",525:"Simplo Technology Co., LTD",526:"Omron Healthcare Co., LTD",527:"Comodule GMBH",528:"ikeGPS",529:"Telink Semiconductor Co. Ltd",530:"Interplan Co., Ltd",531:"Wyler AG",532:"IK Multimedia Production srl",533:"Lukoton Experience Oy",534:"MTI Ltd",535:"Tech4home, Lda",536:"Hiotech AB",537:"DOTT Limited",538:"Blue Speck Labs, LLC",539:"Cisco Systems, Inc",540:"Mobicomm Inc",541:"Edamic",542:"Goodnet, Ltd",543:"Luster Leaf Products Inc",544:"Manus Machina BV",545:"Mobiquity Networks Inc",546:"Praxis Dynamics",547:"Philip Morris Products S.A.",548:"Comarch SA",549:"Nestl Nespresso S.A.",550:"Merlinia A/S",551:"LifeBEAM Technologies",552:"Twocanoes Labs, LLC",553:"Muoverti Limited",554:"Stamer Musikanlagen GMBH",555:"Tesla Motors",556:"Pharynks Corporation",557:"Lupine",558:"Siemens AG",559:"Huami (Shanghai) Culture Communication CO., LTD",560:"Foster Electric Company, Ltd",561:"ETA SA",562:"x-Senso Solutions Kft",563:"Shenzhen SuLong Communication Ltd",564:"FengFan (BeiJing) Technology Co, Ltd",565:"Qrio Inc",566:"Pitpatpet Ltd",567:"MSHeli s.r.l.",568:"Trakm8 Ltd",569:"JIN CO, Ltd",570:"Alatech Tehnology",571:"Beijing CarePulse Electronic Technology Co, Ltd",572:"Awarepoint",573:"ViCentra B.V.",574:"Raven Industries",575:"WaveWare Technologies Inc.",576:"Argenox Technologies",577:"Bragi GmbH",578:"16Lab Inc",579:"Masimo Corp",580:"Iotera Inc",581:"Endress+Hauser",582:"ACKme Networks, Inc.",583:"FiftyThree Inc.",584:"Parker Hannifin Corp",585:"Transcranial Ltd",586:"Uwatec AG",587:"Orlan LLC",588:"Blue Clover Devices",589:"M-Way Solutions GmbH",590:"Microtronics Engineering GmbH",591:"Schneider Schreibgerte GmbH",592:"Sapphire Circuits LLC",593:"Lumo Bodytech Inc.",594:"UKC Technosolution",595:"Xicato Inc.",596:"Playbrush",597:"Dai Nippon Printing Co., Ltd.",598:"G24 Power Limited",599:"AdBabble Local Commerce Inc.",600:"Devialet SA",601:"ALTYOR",602:"University of Applied Sciences Valais/Haute Ecole Valaisanne",603:"Five Interactive, LLC dba Zendo",604:"NetEaseHangzhouNetwork co.Ltd.",605:"Lexmark International Inc.",606:"Fluke Corporation",607:"Yardarm Technologies",608:"SensaRx",609:"SECVRE GmbH",610:"Glacial Ridge Technologies",611:"Identiv, Inc.",612:"DDS, Inc.",613:"SMK Corporation",614:"Schawbel Technologies LLC",615:"XMI Systems SA",616:"Cerevo",617:"Torrox GmbH & Co KG",618:"Gemalto",619:"DEKA Research & Development Corp.",620:"Domster Tadeusz Szydlowski",621:"Technogym SPA",622:"FLEURBAEY BVBA",623:"Aptcode Solutions",624:"LSI ADL Technology",625:"Animas Corp",626:"Alps Electric Co., Ltd.",627:"OCEASOFT",628:"Motsai Research",629:"Geotab",630:"E.G.O. Elektro-Gertebau GmbH",631:"bewhere inc",632:"Johnson Outdoors Inc",633:"steute Schaltgerate GmbH & Co. KG",634:"Ekomini inc.",635:"DEFA AS",636:"Aseptika Ltd",637:"HUAWEI Technologies Co., Ltd. ( )",638:"HabitAware, LLC",639:"ruwido austria gmbh",640:"ITEC corporation",641:"StoneL",642:"Sonova AG",643:"Maven Machines, Inc.",644:"Synapse Electronics",645:"Standard Innovation Inc.",646:"RF Code, Inc.",647:"Wally Ventures S.L.",648:"Willowbank Electronics Ltd",649:"SK Telecom",650:"Jetro AS",651:"Code Gears LTD",652:"NANOLINK APS",653:"IF, LLC",654:"RF Digital Corp",655:"Church & Dwight Co., Inc",656:"Multibit Oy",657:"CliniCloud Inc",658:"SwiftSensors",659:"Blue Bite",660:"ELIAS GmbH",661:"Sivantos GmbH",662:"Petzl",663:"storm power ltd",664:"EISST Ltd",665:"Inexess Technology Simma KG",666:"Currant, Inc.",667:"C2 Development, Inc.",668:"Blue Sky Scientific, LLC",669:"ALOTTAZS LABS, LLC",670:"Kupson spol. s r.o.",671:"Areus Engineering GmbH",672:"Impossible Camera GmbH",673:"InventureTrack Systems",674:"LockedUp",675:"Itude",676:"Pacific Lock Company",677:"Tendyron Corporation ( )",678:"Robert Bosch GmbH",679:"Illuxtron international B.V.",680:"miSport Ltd.",681:"Chargelib",682:"Doppler Lab",683:"BBPOS Limited",684:"RTB Elektronik GmbH & Co. KG",685:"Rx Networks, Inc.",686:"WeatherFlow, Inc.",687:"Technicolor USA Inc.",688:"Bestechnic(Shanghai),Ltd",689:"Raden Inc",690:"JouZen Oy",691:"CLABER S.P.A.",692:"Hyginex, Inc.",693:"HANSHIN ELECTRIC RAILWAY CO.,LTD.",694:"Schneider Electric",695:"Oort Technologies LLC",696:"Chrono Therapeutics",697:"Rinnai Corporation",698:"Swissprime Technologies AG",699:"Koha.,Co.Ltd",700:"Genevac Ltd",701:"Chemtronics",702:"Seguro Technology Sp. z o.o.",703:"Redbird Flight Simulations",704:"Dash Robotics",705:"LINE Corporation",706:"Guillemot Corporation",707:"Techtronic Power Tools Technology Limited",708:"Wilson Sporting Goods",709:"Lenovo (Singapore) Pte Ltd. ( )",710:"Ayatan Sensors",711:"Electronics Tomorrow Limited",712:"VASCO Data Security International, Inc.",713:"PayRange Inc.",714:"ABOV Semiconductor",715:"AINA-Wireless Inc.",716:"Eijkelkamp Soil & Water",717:"BMA ergonomics b.v.",718:"Teva Branded Pharmaceutical Products R&D, Inc.",719:"Anima",720:"3M",721:"Empatica Srl",722:"Afero, Inc.",723:"Powercast Corporation",724:"Secuyou ApS",725:"OMRON Corporation",726:"Send Solutions",727:"NIPPON SYSTEMWARE CO.,LTD.",728:"Neosfar",729:"Fliegl Agrartechnik GmbH",730:"Gilvader",731:"Digi International Inc (R)",732:"DeWalch Technologies, Inc.",733:"Flint Rehabilitation Devices, LLC",734:"Samsung SDS Co., Ltd.",735:"Blur Product Development",736:"University of Michigan",737:"Victron Energy BV",738:"NTT docomo",739:"Carmanah Technologies Corp.",740:"Bytestorm Ltd.",741:"Espressif Incorporated ( () )",742:"Unwire",743:"Connected Yard, Inc.",744:"American Music Environments",745:"Sensogram Technologies, Inc.",746:"Fujitsu Limited",747:"Ardic Technology",748:"Delta Systems, Inc",749:"HTC Corporation",750:"Citizen Holdings Co., Ltd.",751:"SMART-INNOVATION.inc",752:"Blackrat Software",753:"The Idea Cave, LLC",754:"GoPro, Inc.",755:"AuthAir, Inc",756:"Vensi, Inc.",757:"Indagem Tech LLC",758:"Intemo Technologies",759:"DreamVisions co., Ltd.",760:"Runteq Oy Ltd",761:"IMAGINATION TECHNOLOGIES LTD",762:"CoSTAR TEchnologies",763:"Clarius Mobile Health Corp.",764:"Shanghai Frequen Microelectronics Co., Ltd.",765:"Uwanna, Inc.",766:"Lierda Science & Technology Group Co., Ltd.",767:"Silicon Laboratories",768:"World Moto Inc.",769:"Giatec Scientific Inc.",770:"Loop Devices, Inc",771:"IACA electronique",772:"Martians Inc",773:"Swipp ApS",774:"Life Laboratory Inc.",775:"FUJI INDUSTRIAL CO.,LTD.",776:"Surefire, LLC",777:"Dolby Labs",778:"Ellisys",779:"Magnitude Lighting Converters",780:"Hilti AG",781:"Devdata S.r.l.",782:"Deviceworx",783:"Shortcut Labs",784:"SGL Italia S.r.l.",785:"PEEQ DATA",786:"Ducere Technologies Pvt Ltd",787:"DiveNav, Inc.",788:"RIIG AI Sp. z o.o.",789:"Thermo Fisher Scientific",790:"AG Measurematics Pvt. Ltd.",791:"CHUO Electronics CO., LTD.",792:"Aspenta International",793:"Eugster Frismag AG",794:"Amber wireless GmbH",795:"HQ Inc",796:"Lab Sensor Solutions",797:"Enterlab ApS",798:"Eyefi, Inc.",799:"MetaSystem S.p.A.",800:"SONO ELECTRONICS. CO., LTD",801:"Jewelbots",802:"Compumedics Limited",803:"Rotor Bike Components",804:"Astro, Inc.",805:"Amotus Solutions",806:"Healthwear Technologies (Changzhou)Ltd",807:"Essex Electronics",808:"Grundfos A/S",809:"Eargo, Inc.",810:"Electronic Design Lab",811:"ESYLUX",812:"NIPPON SMT.CO.,Ltd",813:"BM innovations GmbH",814:"indoormap",815:"OttoQ Inc",816:"North Pole Engineering",817:"3flares Technologies Inc.",818:"Electrocompaniet A.S.",819:"Mul-T-Lock",820:"Corentium AS",821:"Enlighted Inc",822:"GISTIC",823:"AJP2 Holdings, LLC",824:"COBI GmbH",825:"Blue Sky Scientific, LLC",826:"Appception, Inc.",827:"Courtney Thorne Limited",828:"Virtuosys",829:"TPV Technology Limited",830:"Monitra SA",831:"Automation Components, Inc.",832:"Letsense s.r.l.",833:"Etesian Technologies LLC",834:"GERTEC BRASIL LTDA.",835:"Drekker Development Pty. Ltd.",836:"Whirl Inc",837:"Locus Positioning",838:"Acuity Brands Lighting, Inc",839:"Prevent Biometrics",840:"Arioneo",841:"VersaMe",842:"Vaddio",843:"Libratone A/S",844:"HM Electronics, Inc.",845:"TASER International, Inc.",846:"SafeTrust Inc.",847:"Heartland Payment Systems",848:"Bitstrata Systems Inc.",849:"Pieps GmbH",850:"iRiding(Xiamen)Technology Co.,Ltd.",851:"Alpha Audiotronics, Inc.",852:"TOPPAN FORMS CO.,LTD.",853:"Sigma Designs, Inc.",854:"Spectrum Brands, Inc.",855:"Polymap Wireless",856:"MagniWare Ltd.",857:"Novotec Medical GmbH",858:"Medicom Innovation Partner a/s",859:"Matrix Inc.",860:"Eaton Corporation",861:"KYS",862:"Naya Health, Inc.",863:"Acromag",864:"Insulet Corporation",865:"Wellinks Inc.",866:"ON Semiconductor",867:"FREELAP SA",868:"Favero Electronics Srl",869:"BioMech Sensor LLC",870:"BOLTT Sports technologies Private limited",871:"Saphe International",872:"Metormote AB",873:"littleBits",874:"SetPoint Medical",875:"BRControls Products BV",876:"Zipcar",877:"AirBolt Pty Ltd",878:"KeepTruckin Inc",879:"Motiv, Inc.",880:"Wazombi Labs O",881:"ORBCOMM",882:"Nixie Labs, Inc.",883:"AppNearMe Ltd",884:"Holman Industries",885:"Expain AS",886:"Electronic Temperature Instruments Ltd",887:"Plejd AB",888:"Propeller Health",889:"Shenzhen iMCO Electronic Technology Co.,Ltd",890:"Algoria",891:"Apption Labs Inc.",892:"Cronologics Corporation",893:"MICRODIA Ltd.",894:"lulabytes S.L.",895:"Nestec S.A.",896:"LLC MEGA - F service",897:"Sharp Corporation",898:"Precision Outcomes Ltd",899:"Kronos Incorporated",900:"OCOSMOS Co., Ltd.",901:"Embedded Electronic Solutions Ltd. dba e2Solutions",902:"Aterica Inc.",903:"BluStor PMC, Inc.",904:"Kapsch TrafficCom AB",905:"ActiveBlu Corporation",906:"Kohler Mira Limited",907:"Noke",908:"Appion Inc.",909:"Resmed Ltd",910:"Crownstone B.V.",911:"Xiaomi Inc.",912:"INFOTECH s.r.o.",913:"Thingsquare AB",914:"T&D",915:"LAVAZZA S.p.A.",916:"Netclearance Systems, Inc.",917:"SDATAWAY",918:"BLOKS GmbH",919:"LEGO System A/S",920:"Thetatronics Ltd",921:"Nikon Corporation",922:"NeST",923:"South Silicon Valley Microelectronics",924:"ALE International",925:"CareView Communications, Inc.",926:"SchoolBoard Limited",927:"Molex Corporation",928:"IVT Wireless Limited",929:"Alpine Labs LLC",930:"Candura Instruments",931:"SmartMovt Technology Co., Ltd",932:"Token Zero Ltd",933:"ACE CAD Enterprise Co., Ltd. (ACECAD)",934:"Medela, Inc",935:"AeroScout",936:"Esrille Inc.",937:"THINKERLY SRL",938:"Exon Sp. z o.o.",939:"Meizu Technology Co., Ltd.",940:"Smablo LTD",941:"XiQ",942:"Allswell Inc.",943:"Comm-N-Sense Corp DBA Verigo",944:"VIBRADORM GmbH",945:"Otodata Wireless Network Inc.",946:"Propagation Systems Limited",947:"Midwest Instruments & Controls",948:"Alpha Nodus, inc.",949:"petPOMM, Inc",950:"Mattel",951:"Airbly Inc.",952:"A-Safe Limited",953:"FREDERIQUE CONSTANT SA",954:"Maxscend Microelectronics Company Limited",955:"Abbott Diabetes Care",956:"ASB Bank Ltd",957:"amadas",958:"Applied Science, Inc.",959:"iLumi Solutions Inc.",960:"Arch Systems Inc.",961:"Ember Technologies, Inc.",962:"Snapchat Inc",963:"Casambi Technologies Oy",964:"Pico Technology Inc.",965:"St. Jude Medical, Inc.",966:"Intricon",967:"Structural Health Systems, Inc.",968:"Avvel International",969:"Gallagher Group",970:"In2things Automation Pvt. Ltd.",971:"SYSDEV Srl",972:"Vonkil Technologies Ltd",973:"Wynd Technologies, Inc.",974:"CONTRINEX S.A.",975:"MIRA, Inc.",976:"Watteam Ltd",977:"Density Inc.",978:"IOT Pot India Private Limited",979:"Sigma Connectivity AB",980:"PEG PEREGO SPA",981:"Wyzelink Systems Inc.",982:"Yota Devices LTD",983:"FINSECUR",984:"Zen-Me Labs Ltd",985:"3IWare Co., Ltd.",986:"EnOcean GmbH",987:"Instabeat, Inc",988:"Nima Labs",989:"Andreas Stihl AG & Co. KG",990:"Nathan Rhoades LLC",991:"Grob Technologies, LLC",992:"Actions (Zhuhai) Technology Co., Limited",993:"SPD Development Company Ltd",994:"Sensoan Oy",995:"Qualcomm Life Inc",996:"Chip-ing AG",997:"ffly4u",998:"IoT Instruments Oy",999:"TRUE Fitness Technology",1e3:"Reiner Kartengeraete GmbH & Co. KG.",1001:"SHENZHEN LEMONJOY TECHNOLOGY CO., LTD.",1002:"Hello Inc.",1003:"Evollve Inc.",1004:"Jigowatts Inc.",1005:"BASIC MICRO.COM,INC.",1006:"CUBE TECHNOLOGIES",1007:"foolography GmbH",1008:"CLINK",1009:"Hestan Smart Cooking Inc.",1010:"WindowMaster A/S",1011:"Flowscape AB",1012:"PAL Technologies Ltd",1013:"WHERE, Inc.",1014:"Iton Technology Corp.",1015:"Owl Labs Inc.",1016:"Rockford Corp.",1017:"Becon Technologies Co.,Ltd.",1018:"Vyassoft Technologies Inc",1019:"Nox Medical",1020:"Kimberly-Clark",1021:"Trimble Navigation Ltd.",1022:"Littelfuse",1023:"Withings",1024:"i-developer IT Beratung UG",1026:"Sears Holdings Corporation",1027:"Gantner Electronic GmbH",1028:"Authomate Inc",1029:"Vertex International, Inc.",1030:"Airtago",1031:"Swiss Audio SA",1032:"ToGetHome Inc.",1033:"AXIS",1034:"Openmatics",1035:"Jana Care Inc.",1036:"Senix Corporation",1037:"NorthStar Battery Company, LLC",1038:"SKF (U.K.) Limited",1039:"CO-AX Technology, Inc.",1040:"Fender Musical Instruments",1041:"Luidia Inc",1042:"SEFAM",1043:"Wireless Cables Inc",1044:"Lightning Protection International Pty Ltd",1045:"Uber Technologies Inc",1046:"SODA GmbH",1047:"Fatigue Science",1048:"Alpine Electronics Inc.",1049:"Novalogy LTD",1050:"Friday Labs Limited",1051:"OrthoAccel Technologies",1052:"WaterGuru, Inc.",1053:"Benning Elektrotechnik und Elektronik GmbH & Co. KG",1054:"Dell Computer Corporation",1055:"Kopin Corporation",1056:"TecBakery GmbH",1057:"Backbone Labs, Inc.",1058:"DELSEY SA",1059:"Chargifi Limited",1060:"Trainesense Ltd.",1061:"Unify Software and Solutions GmbH & Co. KG",1062:"Husqvarna AB",1063:"Focus fleet and fuel management inc",1064:"SmallLoop, LLC",1065:"Prolon Inc.",1066:"BD Medical",1067:"iMicroMed Incorporated",1068:"Ticto N.V.",1069:"Meshtech AS",1070:"MemCachier Inc.",1071:"Danfoss A/S",1072:"SnapStyk Inc.",1073:"Amyway Corporation",1074:"Silk Labs, Inc.",1075:"Pillsy Inc.",1076:"Hatch Baby, Inc.",1077:"Blocks Wearables Ltd.",1078:"Drayson Technologies (Europe) Limited",1079:"eBest IOT Inc.",1080:"Helvar Ltd",1081:"Radiance Technologies",1082:"Nuheara Limited",1083:"Appside co., ltd.",1084:"DeLaval",1085:"Coiler Corporation",1086:"Thermomedics, Inc.",1087:"Tentacle Sync GmbH",1088:"Valencell, Inc.",1089:"iProtoXi Oy",1090:"SECOM CO., LTD.",1091:"Tucker International LLC",1092:"Metanate Limited",1093:"Kobian Canada Inc.",1094:"NETGEAR, Inc.",1095:"Fabtronics Australia Pty Ltd",1096:"Grand Centrix GmbH",1097:"1UP USA.com llc",1098:"SHIMANO INC.",1099:"Nain Inc.",1100:"LifeStyle Lock, LLC",1101:"VEGA Grieshaber KG",1102:"Xtrava Inc.",1103:"TTS Tooltechnic Systems AG & Co. KG",1104:"Teenage Engineering AB",1105:"Tunstall Nordic AB",1106:"Svep Design Center AB",1107:"GreenPeak Technologies BV",1108:"Sphinx Electronics GmbH & Co KG",1109:"Atomation",1110:"Nemik Consulting Inc",1111:"RF INNOVATION",1112:"Mini Solution Co., Ltd.",1113:"Lumenetix, Inc",1114:"2048450 Ontario Inc",1115:"SPACEEK LTD",1116:"Delta T Corporation",1117:"Boston Scientific Corporation",1118:"Nuviz, Inc.",1119:"Real Time Automation, Inc.",1120:"Kolibree",1121:"vhf elektronik GmbH",1122:"Bonsai Systems GmbH",1123:"Fathom Systems Inc.",1124:"Bellman & Symfon",1125:"International Forte Group LLC",1126:"CycleLabs Solutions inc.",1127:"Codenex Oy",1128:"Kynesim Ltd",1129:"Palago AB",1130:"INSIGMA INC.",1131:"PMD Solutions",1132:"Qingdao Realtime Technology Co., Ltd.",1133:"BEGA Gantenbrink-Leuchten KG",1134:"Pambor Ltd.",65535:"SPECIAL USE/DEFAULT"}});var wa=oe(va=>{"use strict";var nd=require("child_process").exec,rd=require("child_process").execSync,sd=require("path"),ut=ue(),id=Ca(),od=require("fs"),Ht=process.platform,ad=Ht==="linux"||Ht==="android",ld=Ht==="darwin",cd=Ht==="win32",ud=Ht==="freebsd",pd=Ht==="openbsd",dd=Ht==="netbsd",fd=Ht==="sunos";function fi(n){let t="";return n.indexOf("keyboard")>=0&&(t="Keyboard"),n.indexOf("mouse")>=0&&(t="Mouse"),n.indexOf("trackpad")>=0&&(t="Trackpad"),n.indexOf("speaker")>=0&&(t="Speaker"),n.indexOf("headset")>=0&&(t="Headset"),n.indexOf("phone")>=0&&(t="Phone"),n.indexOf("macbook")>=0&&(t="Computer"),n.indexOf("imac")>=0&&(t="Computer"),n.indexOf("ipad")>=0&&(t="Tablet"),n.indexOf("watch")>=0&&(t="Watch"),n.indexOf("headphone")>=0&&(t="Headset"),t}function md(n){let t=n.split(" ")[0];return n=n.toLowerCase(),n.indexOf("apple")>=0&&(t="Apple"),n.indexOf("ipad")>=0&&(t="Apple"),n.indexOf("imac")>=0&&(t="Apple"),n.indexOf("iphone")>=0&&(t="Apple"),n.indexOf("magic mouse")>=0&&(t="Apple"),n.indexOf("magic track")>=0&&(t="Apple"),n.indexOf("macbook")>=0&&(t="Apple"),t}function hd(n){let t=parseInt(n);if(!isNaN(t))return id[t]}function gd(n,t,e){let r={};return r.device=null,r.name=ut.getValue(n,"name","="),r.manufacturer=null,r.macDevice=t,r.macHost=e,r.batteryPercent=null,r.type=fi(r.name.toLowerCase()),r.connected=!1,r}function di(n,t){let e={},r=((n.device_minorClassOfDevice_string||n.device_majorClassOfDevice_string||n.device_minorType||"")+(n.device_name||"")).toLowerCase();return e.device=n.device_services||"",e.name=n.device_name||"",e.manufacturer=n.device_manufacturer||hd(n.device_vendorID)||md(n.device_name||"")||"",e.macDevice=(n.device_addr||n.device_address||"").toLowerCase().replace(/-/g,":"),e.macHost=t,e.batteryPercent=n.device_batteryPercent||null,e.type=fi(r),e.connected=n.device_isconnected==="attrib_Yes"||!1,e}function yd(n){let t={};return t.device=null,t.name=ut.getValue(n,"name",":"),t.manufacturer=ut.getValue(n,"manufacturer",":"),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=fi(t.name.toLowerCase()),t.connected=null,t}function xd(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(ad){ut.getFilesInPath("/var/lib/bluetooth/").forEach(i=>{let s=sd.basename(i),o=i.split("/"),a=o.length>=6?o[o.length-2]:null,l=o.length>=7?o[o.length-3]:null;if(s==="info"){let c=od.readFileSync(i,{encoding:"utf8"}).split(`
|
|
384
|
+
`);e.push(gd(c,a,l))}});try{let i=rd("hcitool con",ut.execOptsLinux).toString().toLowerCase();for(let s=0;s<e.length;s++)e[s].macDevice&&e[s].macDevice.length>10&&i.indexOf(e[s].macDevice.toLowerCase())>=0&&(e[s].connected=!0)}catch{ut.noop()}n&&n(e),t(e)}ld&&nd("system_profiler SPBluetoothDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_title&&o.SPBluetoothDataType[0].device_title.length){let a=null;o.SPBluetoothDataType[0].local_device_title&&o.SPBluetoothDataType[0].local_device_title.general_address&&(a=o.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":")),o.SPBluetoothDataType[0].device_title.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0];let d=di(p,a);e.push(d)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_connected&&o.SPBluetoothDataType[0].device_connected.length){let a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_connected.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0],p.device_isconnected="attrib_Yes";let d=di(p,a);e.push(d)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_not_connected&&o.SPBluetoothDataType[0].device_not_connected.length){let a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_not_connected.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0],p.device_isconnected="attrib_No";let d=di(p,a);e.push(d)}})}}catch{ut.noop()}n&&n(e),t(e)}),cd&&ut.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then((r,i)=>{i||r.toString().split(/\n\s*\n/).forEach(o=>{ut.getValue(o.split(`
|
|
385
|
+
`),"PNPClass",":")==="Bluetooth"&&e.push(yd(o.split(`
|
|
386
|
+
`)))}),n&&n(e),t(e)}),(ud||dd||pd||fd)&&t(null)})})}va.bluetoothDevices=xd});var Ma=oe(k=>{"use strict";var Sd=ki().version,qt=ue(),jt=eo(),pt=no(),He=lo(),ms=So(),Ia=vo(),La=Eo(),nt=bo(),dt=Go(),hs=jo(),Ir=$o(),Oa=Zo(),mi=ra(),xn=aa(),_d=ca(),Cd=fa(),vd=ga(),wd=Sa(),Id=wa(),Lr=process.platform,fs=Lr==="win32",Cr=Lr==="freebsd",vr=Lr==="openbsd",wr=Lr==="netbsd",tt=Lr==="sunos";fs&&(qt.getCodepage(),qt.getPowershell());function Ea(){return Sd}function Pa(n){return new Promise(t=>{process.nextTick(()=>{let e={};e.version=Ea(),Promise.all([jt.system(),jt.bios(),jt.baseboard(),jt.chassis(),pt.osInfo(),pt.uuid(),pt.versions(),He.cpu(),He.cpuFlags(),La.graphics(),dt.networkInterfaces(),ms.memLayout(),nt.diskLayout()]).then(r=>{e.system=r[0],e.bios=r[1],e.baseboard=r[2],e.chassis=r[3],e.os=r[4],e.uuid=r[5],e.versions=r[6],e.cpu=r[7],e.cpu.flags=r[8],e.graphics=r[9],e.net=r[10],e.memLayout=r[11],e.diskLayout=r[12],n&&n(e),t(e)})})})}function Aa(n,t,e){return qt.isFunction(t)&&(e=t,t=""),qt.isFunction(n)&&(e=n,n=""),new Promise(r=>{process.nextTick(()=>{t=t||dt.getDefaultNetworkInterface(),n=n||"";let i=function(){let o=15;return fs&&(o=13),(Cr||vr||wr)&&(o=11),tt&&(o=6),function(){--o===0&&(e&&e(s),r(s))}}(),s={};s.time=pt.time(),s.node=process.versions.node,s.v8=process.versions.v8,He.cpuCurrentSpeed().then(o=>{s.cpuCurrentSpeed=o,i()}),Oa.users().then(o=>{s.users=o,i()}),Ir.processes().then(o=>{s.processes=o,i()}),He.currentLoad().then(o=>{s.currentLoad=o,i()}),tt||He.cpuTemperature().then(o=>{s.temp=o,i()}),!vr&&!Cr&&!wr&&!tt&&dt.networkStats(t).then(o=>{s.networkStats=o,i()}),tt||dt.networkConnections().then(o=>{s.networkConnections=o,i()}),ms.mem().then(o=>{s.mem=o,i()}),tt||Ia().then(o=>{s.battery=o,i()}),tt||Ir.services(n).then(o=>{s.services=o,i()}),tt||nt.fsSize().then(o=>{s.fsSize=o,i()}),!fs&&!vr&&!Cr&&!wr&&!tt&&nt.fsStats().then(o=>{s.fsStats=o,i()}),!fs&&!vr&&!Cr&&!wr&&!tt&&nt.disksIO().then(o=>{s.disksIO=o,i()}),!vr&&!Cr&&!wr&&!tt&&hs.wifiNetworks().then(o=>{s.wifiNetworks=o,i()}),mi.inetLatency().then(o=>{s.inetLatency=o,i()})})})}function Ld(n,t,e){return new Promise(r=>{process.nextTick(()=>{let i={};t&&qt.isFunction(t)&&!e&&(e=t,t=""),n&&qt.isFunction(n)&&!t&&!e&&(e=n,n="",t=""),Pa().then(s=>{i=s,Aa(n,t).then(o=>{for(let a in o)({}).hasOwnProperty.call(o,a)&&(i[a]=o[a]);e&&e(i),r(i)})})})})}function Ta(n,t){return new Promise(e=>{process.nextTick(()=>{let r=Object.keys(n).filter(i=>({}).hasOwnProperty.call(k,i)).map(i=>{let s=n[i].substring(n[i].lastIndexOf("(")+1,n[i].lastIndexOf(")")),o=i.indexOf(")")>=0?i.split(")")[1].trim():i;return o=i.indexOf("|")>=0?i.split("|")[0].trim():o,s?k[o](s):k[o]("")});Promise.all(r).then(i=>{let s={},o=0;for(let a in n)if({}.hasOwnProperty.call(n,a)&&{}.hasOwnProperty.call(k,a)&&i.length>o){if(n[a]==="*"||n[a]==="all")s[a]=i[o];else{let l=n[a],c="",u=[];if(l.indexOf(")")>=0&&(l=l.split(")")[1].trim()),l.indexOf("|")>=0&&(c=l.split("|")[1].trim(),u=c.split(":"),l=l.split("|")[0].trim()),l=l.replace(/,/g," ").replace(/ +/g," ").split(" "),i[o])if(Array.isArray(i[o])){let p=[];i[o].forEach(d=>{let f={};if(l.length===1&&(l[0]==="*"||l[0]==="all")?f=d:l.forEach(m=>{({}).hasOwnProperty.call(d,m)&&(f[m]=d[m])}),c&&u.length===2){if({}.hasOwnProperty.call(f,u[0].trim())){let m=f[u[0].trim()];typeof m=="number"?m===parseFloat(u[1].trim())&&p.push(f):typeof m=="string"&&m.toLowerCase()===u[1].trim().toLowerCase()&&p.push(f)}}else p.push(f)}),s[a]=p}else{let p={};l.forEach(d=>{({}).hasOwnProperty.call(i[o],d)&&(p[d]=i[o][d])}),s[a]=p}else s[a]={}}o++}t&&t(s),e(s)})})})}function Od(n,t,e){let r=null;return setInterval(()=>{Ta(n).then(s=>{JSON.stringify(r)!==JSON.stringify(s)&&(r=Object.assign({},s),e(s))})},t)}k.version=Ea;k.system=jt.system;k.bios=jt.bios;k.baseboard=jt.baseboard;k.chassis=jt.chassis;k.time=pt.time;k.osInfo=pt.osInfo;k.versions=pt.versions;k.shell=pt.shell;k.uuid=pt.uuid;k.cpu=He.cpu;k.cpuFlags=He.cpuFlags;k.cpuCache=He.cpuCache;k.cpuCurrentSpeed=He.cpuCurrentSpeed;k.cpuTemperature=He.cpuTemperature;k.currentLoad=He.currentLoad;k.fullLoad=He.fullLoad;k.mem=ms.mem;k.memLayout=ms.memLayout;k.battery=Ia;k.graphics=La.graphics;k.fsSize=nt.fsSize;k.fsOpenFiles=nt.fsOpenFiles;k.blockDevices=nt.blockDevices;k.fsStats=nt.fsStats;k.disksIO=nt.disksIO;k.diskLayout=nt.diskLayout;k.networkInterfaceDefault=dt.networkInterfaceDefault;k.networkGatewayDefault=dt.networkGatewayDefault;k.networkInterfaces=dt.networkInterfaces;k.networkStats=dt.networkStats;k.networkConnections=dt.networkConnections;k.wifiNetworks=hs.wifiNetworks;k.wifiInterfaces=hs.wifiInterfaces;k.wifiConnections=hs.wifiConnections;k.services=Ir.services;k.processes=Ir.processes;k.processLoad=Ir.processLoad;k.users=Oa.users;k.inetChecksite=mi.inetChecksite;k.inetLatency=mi.inetLatency;k.dockerInfo=xn.dockerInfo;k.dockerImages=xn.dockerImages;k.dockerContainers=xn.dockerContainers;k.dockerContainerStats=xn.dockerContainerStats;k.dockerContainerProcesses=xn.dockerContainerProcesses;k.dockerVolumes=xn.dockerVolumes;k.dockerAll=xn.dockerAll;k.vboxInfo=_d.vboxInfo;k.printer=Cd.printer;k.usb=vd.usb;k.audio=wd.audio;k.bluetoothDevices=Id.bluetoothDevices;k.getStaticData=Pa;k.getDynamicData=Aa;k.getAllData=Ld;k.get=Ta;k.observe=Od;k.powerShellStart=qt.powerShellStart;k.powerShellRelease=qt.powerShellRelease});var Da=oe((Vf,Ed)=>{Ed.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Ba=oe((kf,ft)=>{var hi=require("fs"),gi=require("path"),Pd=require("os"),Ad=require("crypto"),Td=Da(),yi=Td.version,Md=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function bd(n){let t={},e=n.toString();e=e.replace(/\r\n?/mg,`
|
|
387
|
+
`);let r;for(;(r=Md.exec(e))!=null;){let i=r[1],s=r[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|
388
|
+
`),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}function Dd(n){let t=ka(n),e=ye.configDotenv({path:t});if(!e.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Va(n).split(","),i=r.length,s;for(let o=0;o<i;o++)try{let a=r[o].trim(),l=kd(e,a);s=ye.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=i)throw a}return ye.parse(s)}function Nd(n){console.log(`[dotenv@${yi}][INFO] ${n}`)}function Vd(n){console.log(`[dotenv@${yi}][WARN] ${n}`)}function ys(n){console.log(`[dotenv@${yi}][DEBUG] ${n}`)}function Va(n){return n&&n.DOTENV_KEY&&n.DOTENV_KEY.length>0?n.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function kd(n,t){let e;try{e=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let r=e.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=e.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${i.toUpperCase()}`,o=n.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function ka(n){let t=null;if(n&&n.path&&n.path.length>0)if(Array.isArray(n.path))for(let e of n.path)hi.existsSync(e)&&(t=e.endsWith(".vault")?e:`${e}.vault`);else t=n.path.endsWith(".vault")?n.path:`${n.path}.vault`;else t=gi.resolve(process.cwd(),".env.vault");return hi.existsSync(t)?t:null}function Na(n){return n[0]==="~"?gi.join(Pd.homedir(),n.slice(1)):n}function Bd(n){Nd("Loading env from encrypted .env.vault");let t=ye._parseVault(n),e=process.env;return n&&n.processEnv!=null&&(e=n.processEnv),ye.populate(e,t,n),{parsed:t}}function Rd(n){let t=gi.resolve(process.cwd(),".env"),e="utf8",r=!!(n&&n.debug);n&&n.encoding?e=n.encoding:r&&ys("No encoding is specified. UTF-8 is used by default");let i=[t];if(n&&n.path)if(!Array.isArray(n.path))i=[Na(n.path)];else{i=[];for(let l of n.path)i.push(Na(l))}let s,o={};for(let l of i)try{let c=ye.parse(hi.readFileSync(l,{encoding:e}));ye.populate(o,c,n)}catch(c){r&&ys(`Failed to load ${l} ${c.message}`),s=c}let a=process.env;return n&&n.processEnv!=null&&(a=n.processEnv),ye.populate(a,o,n),s?{parsed:o,error:s}:{parsed:o}}function Fd(n){if(Va(n).length===0)return ye.configDotenv(n);let t=ka(n);return t?ye._configVault(n):(Vd(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ye.configDotenv(n))}function Gd(n,t){let e=Buffer.from(t.slice(-64),"hex"),r=Buffer.from(n,"base64"),i=r.subarray(0,12),s=r.subarray(-16);r=r.subarray(12,-16);try{let o=Ad.createDecipheriv("aes-256-gcm",e,i);return o.setAuthTag(s),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,l=o.message==="Invalid key length",c=o.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw o}}function Wd(n,t,e={}){let r=!!(e&&e.debug),i=!!(e&&e.override);if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(n,s)?(i===!0&&(n[s]=t[s]),r&&ys(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):n[s]=t[s]}var ye={configDotenv:Rd,_configVault:Bd,_parseVault:Dd,config:Fd,decrypt:Gd,parse:bd,populate:Wd};ft.exports.configDotenv=ye.configDotenv;ft.exports._configVault=ye._configVault;ft.exports._parseVault=ye._parseVault;ft.exports.config=ye.config;ft.exports.decrypt=ye.decrypt;ft.exports.parse=ye.parse;ft.exports.populate=ye.populate;ft.exports=ye});var Kd={};Ka(Kd,{generatePreviewUrl:()=>qd});module.exports=$a(Kd);var ne;(function(n){n.assertEqual=i=>i;function t(i){}n.assertIs=t;function e(i){throw new Error}n.assertNever=e,n.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},n.getValidEnumValues=i=>{let s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return n.objectValues(o)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},n.find=(i,s)=>{for(let o of i)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ne||(ne={}));var _s;(function(n){n.mergeShapes=(t,e)=>({...t,...e})})(_s||(_s={}));var N=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),st=n=>{switch(typeof n){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(n)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(n)?N.array:n===null?N.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?N.promise:typeof Map<"u"&&n instanceof Map?N.map:typeof Set<"u"&&n instanceof Set?N.set:typeof Date<"u"&&n instanceof Date?N.date:N.object;default:return N.unknown}},L=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ya=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),Ae=class n extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){let e=t||function(s){return s.message},r={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(e(o));else{let a=r,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(t){if(!(t instanceof n))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},r=[];for(let i of this.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}};Ae.create=n=>new Ae(n);var vn=(n,t)=>{let e;switch(n.code){case L.invalid_type:n.received===N.undefined?e="Required":e=`Expected ${n.expected}, received ${n.received}`;break;case L.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(n.expected,ne.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:e=`Unrecognized key(s) in object: ${ne.joinValues(n.keys,", ")}`;break;case L.invalid_union:e="Invalid input";break;case L.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${ne.joinValues(n.options)}`;break;case L.invalid_enum_value:e=`Invalid enum value. Expected ${ne.joinValues(n.options)}, received '${n.received}'`;break;case L.invalid_arguments:e="Invalid function arguments";break;case L.invalid_return_type:e="Invalid function return type";break;case L.invalid_date:e="Invalid date";break;case L.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(e=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?e=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?e=`Invalid input: must end with "${n.validation.endsWith}"`:ne.assertNever(n.validation):n.validation!=="regex"?e=`Invalid ${n.validation}`:e="Invalid";break;case L.too_small:n.type==="array"?e=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?e=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?e=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?e=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:e="Invalid input";break;case L.too_big:n.type==="array"?e=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?e=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?e=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?e=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?e=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:e="Invalid input";break;case L.custom:e="Invalid input";break;case L.invalid_intersection_types:e="Intersection results could not be merged";break;case L.not_multiple_of:e=`Number must be a multiple of ${n.multipleOf}`;break;case L.not_finite:e="Number must be finite";break;default:e=t.defaultError,ne.assertNever(n)}return{message:e}},vi=vn;function Xa(n){vi=n}function Er(){return vi}var Pr=n=>{let{data:t,path:e,errorMaps:r,issueData:i}=n,s=[...e,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}},Za=[];function b(n,t){let e=Er(),r=Pr({issueData:t,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,e,e===vn?void 0:vn].filter(i=>!!i)});n.common.issues.push(r)}var Ce=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let r=[];for(let i of e){if(i.status==="aborted")return j;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let s=await i.key,o=await i.value;r.push({key:s,value:o})}return n.mergeObjectSync(t,r)}static mergeObjectSync(t,e){let r={};for(let i of e){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return j;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}},j=Object.freeze({status:"aborted"}),Cn=n=>({status:"dirty",value:n}),we=n=>({status:"valid",value:n}),Cs=n=>n.status==="aborted",vs=n=>n.status==="dirty",Kt=n=>n.status==="valid",Yn=n=>typeof Promise<"u"&&n instanceof Promise;function Ar(n,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)}function wi(n,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e}var B;(function(n){n.errToObj=t=>typeof t=="string"?{message:t}:t||{},n.toString=t=>typeof t=="string"?t:t?.message})(B||(B={}));var Kn,$n,Ne=class{constructor(t,e,r,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},_i=(n,t)=>{if(Kt(t))return{success:!0,data:t.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new Ae(n.common.issues);return this._error=e,this._error}}};function K(n){if(!n)return{};let{errorMap:t,invalid_type_error:e,required_error:r,description:i}=n;if(t&&(e||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var l,c;let{message:u}=n;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??e)!==null&&c!==void 0?c:a.defaultError}},description:i}}var $=class{get description(){return this._def.description}_getType(t){return st(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:st(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ce,ctx:{common:t.parent.common,data:t.data,parsedType:st(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Yn(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let i={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:st(t)},s=this._parseSync({data:t,path:i.path,parent:i});return _i(i,s)}"~validate"(t){var e,r;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:st(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:i});return Kt(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(e=s?.message)===null||e===void 0?void 0:e.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(s=>Kt(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:st(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Yn(i)?i:Promise.resolve(i));return _i(r,s)}refine(t,e){let r=i=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(i):e;return this._refinement((i,s)=>{let o=t(i),a=()=>s.addIssue({code:L.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,e){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof e=="function"?e(r,i):e),!1))}_refinement(t){return new Te({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return De.create(this,this._def)}nullable(){return Je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ot.create(this)}promise(){return gt.create(this,this._def)}or(t){return en.create([this,t],this._def)}and(t){return tn.create(this,t,this._def)}transform(t){return new Te({...K(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new an({...K(this._def),innerType:this,defaultValue:e,typeName:H.ZodDefault})}brand(){return new Xn({typeName:H.ZodBranded,type:this,...K(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new ln({...K(this._def),innerType:this,catchValue:e,typeName:H.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Zn.create(this,t)}readonly(){return cn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ja=/^c[^\s-]{8,}$/i,Qa=/^[0-9a-z]+$/,el=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nl=/^[a-z0-9_-]{21}$/i,rl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,il=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ol="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ss,al=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ll=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,cl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ul=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ii="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fl=new RegExp(`^${Ii}$`);function Li(n){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?t=`${t}\\.\\d{${n.precision}}`:n.precision==null&&(t=`${t}(\\.\\d+)?`),t}function ml(n){return new RegExp(`^${Li(n)}$`)}function Oi(n){let t=`${Ii}T${Li(n)}`,e=[];return e.push(n.local?"Z?":"Z"),n.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function hl(n,t){return!!((t==="v4"||!t)&&al.test(n)||(t==="v6"||!t)&&cl.test(n))}function gl(n,t){if(!rl.test(n))return!1;try{let[e]=n.split("."),r=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function yl(n,t){return!!((t==="v4"||!t)&&ll.test(n)||(t==="v6"||!t)&&ul.test(n))}var mt=class n extends ${_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_type,expected:N.string,received:s.parsedType}),j}let r=new Ce,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),b(i,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),b(i,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?b(i,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&b(i,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")il.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"email",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Ss||(Ss=new RegExp(ol,"u")),Ss.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"emoji",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")tl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"uuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")nl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"nanoid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Ja.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"cuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Qa.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"cuid2",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")el.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"ulid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),b(i,{validation:"url",code:L.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"regex",code:L.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Oi(s).test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?fl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?ml(s).test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?sl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"duration",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?hl(t.data,s.version)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"ip",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?gl(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"jwt",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?yl(t.data,s.version)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"cidr",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?pl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?dl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64url",code:L.invalid_string,message:s.message}),r.dirty()):ne.assertNever(s);return{status:r.value,value:t.data}}_regex(t,e,r){return this.refinement(i=>t.test(i),{validation:e,code:L.invalid_string,...B.errToObj(r)})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...B.errToObj(t)})}url(t){return this._addCheck({kind:"url",...B.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...B.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...B.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...B.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...B.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...B.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...B.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...B.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...B.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...B.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...B.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...B.errToObj(t)})}datetime(t){var e,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(e=t?.offset)!==null&&e!==void 0?e:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...B.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...B.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...B.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...B.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...B.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...B.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...B.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...B.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...B.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...B.errToObj(e)})}nonempty(t){return this.min(1,B.errToObj(t))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};mt.create=n=>{var t;return new mt({checks:[],typeName:H.ZodString,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...K(n)})};function xl(n,t){let e=(n.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=e>r?e:r,s=parseInt(n.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var $t=class n extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N.number){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_type,expected:N.number,received:s.parsedType}),j}let r,i=new Ce;for(let s of this._def.checks)s.kind==="int"?ne.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),b(r,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?xl(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),b(r,{code:L.not_finite,message:s.message}),i.dirty()):ne.assertNever(s);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,B.toString(e))}gt(t,e){return this.setLimit("min",t,!1,B.toString(e))}lte(t,e){return this.setLimit("max",t,!0,B.toString(e))}lt(t,e){return this.setLimit("max",t,!1,B.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:B.toString(i)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:B.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:B.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:B.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ne.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(e===null||r.value>e)&&(e=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(e)&&Number.isFinite(t)}};$t.create=n=>new $t({checks:[],typeName:H.ZodNumber,coerce:n?.coerce||!1,...K(n)});var Yt=class n extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==N.bigint)return this._getInvalidInput(t);let r,i=new Ce;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),b(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ne.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return b(e,{code:L.invalid_type,expected:N.bigint,received:e.parsedType}),j}gte(t,e){return this.setLimit("min",t,!0,B.toString(e))}gt(t,e){return this.setLimit("min",t,!1,B.toString(e))}lte(t,e){return this.setLimit("max",t,!0,B.toString(e))}lt(t,e){return this.setLimit("max",t,!1,B.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:B.toString(i)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:B.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};Yt.create=n=>{var t;return new Yt({checks:[],typeName:H.ZodBigInt,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...K(n)})};var Xt=class extends ${_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==N.boolean){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.boolean,received:r.parsedType}),j}return we(t.data)}};Xt.create=n=>new Xt({typeName:H.ZodBoolean,coerce:n?.coerce||!1,...K(n)});var Zt=class n extends ${_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_type,expected:N.date,received:s.parsedType}),j}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_date}),j}let r=new Ce,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),b(i,{code:L.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),b(i,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ne.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:B.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:B.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};Zt.create=n=>new Zt({checks:[],coerce:n?.coerce||!1,typeName:H.ZodDate,...K(n)});var wn=class extends ${_parse(t){if(this._getType(t)!==N.symbol){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.symbol,received:r.parsedType}),j}return we(t.data)}};wn.create=n=>new wn({typeName:H.ZodSymbol,...K(n)});var Jt=class extends ${_parse(t){if(this._getType(t)!==N.undefined){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.undefined,received:r.parsedType}),j}return we(t.data)}};Jt.create=n=>new Jt({typeName:H.ZodUndefined,...K(n)});var Qt=class extends ${_parse(t){if(this._getType(t)!==N.null){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.null,received:r.parsedType}),j}return we(t.data)}};Qt.create=n=>new Qt({typeName:H.ZodNull,...K(n)});var ht=class extends ${constructor(){super(...arguments),this._any=!0}_parse(t){return we(t.data)}};ht.create=n=>new ht({typeName:H.ZodAny,...K(n)});var it=class extends ${constructor(){super(...arguments),this._unknown=!0}_parse(t){return we(t.data)}};it.create=n=>new it({typeName:H.ZodUnknown,...K(n)});var je=class extends ${_parse(t){let e=this._getOrReturnCtx(t);return b(e,{code:L.invalid_type,expected:N.never,received:e.parsedType}),j}};je.create=n=>new je({typeName:H.ZodNever,...K(n)});var In=class extends ${_parse(t){if(this._getType(t)!==N.undefined){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.void,received:r.parsedType}),j}return we(t.data)}};In.create=n=>new In({typeName:H.ZodVoid,...K(n)});var ot=class n extends ${_parse(t){let{ctx:e,status:r}=this._processInputParams(t),i=this._def;if(e.parsedType!==N.array)return b(e,{code:L.invalid_type,expected:N.array,received:e.parsedType}),j;if(i.exactLength!==null){let o=e.data.length>i.exactLength.value,a=e.data.length<i.exactLength.value;(o||a)&&(b(e,{code:o?L.too_big:L.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&e.data.length<i.minLength.value&&(b(e,{code:L.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&e.data.length>i.maxLength.value&&(b(e,{code:L.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),e.common.async)return Promise.all([...e.data].map((o,a)=>i.type._parseAsync(new Ne(e,o,e.path,a)))).then(o=>Ce.mergeArray(r,o));let s=[...e.data].map((o,a)=>i.type._parseSync(new Ne(e,o,e.path,a)));return Ce.mergeArray(r,s)}get element(){return this._def.type}min(t,e){return new n({...this._def,minLength:{value:t,message:B.toString(e)}})}max(t,e){return new n({...this._def,maxLength:{value:t,message:B.toString(e)}})}length(t,e){return new n({...this._def,exactLength:{value:t,message:B.toString(e)}})}nonempty(t){return this.min(1,t)}};ot.create=(n,t)=>new ot({type:n,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...K(t)});function _n(n){if(n instanceof Oe){let t={};for(let e in n.shape){let r=n.shape[e];t[e]=De.create(_n(r))}return new Oe({...n._def,shape:()=>t})}else return n instanceof ot?new ot({...n._def,type:_n(n.element)}):n instanceof De?De.create(_n(n.unwrap())):n instanceof Je?Je.create(_n(n.unwrap())):n instanceof Ze?Ze.create(n.items.map(t=>_n(t))):n}var Oe=class n extends ${constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=ne.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==N.object){let c=this._getOrReturnCtx(t);return b(c,{code:L.invalid_type,expected:N.object,received:c.parsedType}),j}let{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof je&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let l=[];for(let c of o){let u=s[c],p=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ne(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof je){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(b(i,{code:L.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let p=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ne(i,p,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let p=await u.key,d=await u.value;c.push({key:p,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Ce.mergeObjectSync(r,c)):Ce.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return B.errToObj,new n({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,r)=>{var i,s,o,a;let l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,e,r).message)!==null&&o!==void 0?o:r.defaultError;return e.code==="unrecognized_keys"?{message:(a=B.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(t){return new n({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new n({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:H.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new n({...this._def,catchall:t})}pick(t){let e={};return ne.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(e[r]=this.shape[r])}),new n({...this._def,shape:()=>e})}omit(t){let e={};return ne.objectKeys(this.shape).forEach(r=>{t[r]||(e[r]=this.shape[r])}),new n({...this._def,shape:()=>e})}deepPartial(){return _n(this)}partial(t){let e={};return ne.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?e[r]=i:e[r]=i.optional()}),new n({...this._def,shape:()=>e})}required(t){let e={};return ne.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])e[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof De;)s=s._def.innerType;e[r]=s}}),new n({...this._def,shape:()=>e})}keyof(){return Ei(ne.objectKeys(this.shape))}};Oe.create=(n,t)=>new Oe({shape:()=>n,unknownKeys:"strip",catchall:je.create(),typeName:H.ZodObject,...K(t)});Oe.strictCreate=(n,t)=>new Oe({shape:()=>n,unknownKeys:"strict",catchall:je.create(),typeName:H.ZodObject,...K(t)});Oe.lazycreate=(n,t)=>new Oe({shape:n,unknownKeys:"strip",catchall:je.create(),typeName:H.ZodObject,...K(t)});var en=class extends ${_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Ae(a.ctx.common.issues));return b(e,{code:L.invalid_union,unionErrors:o}),j}if(e.common.async)return Promise.all(r.map(async s=>{let o={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let l of r){let c={...e,common:{...e.common,issues:[]},parent:null},u=l._parseSync({data:e.data,path:e.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(l=>new Ae(l));return b(e,{code:L.invalid_union,unionErrors:a}),j}}get options(){return this._def.options}};en.create=(n,t)=>new en({options:n,typeName:H.ZodUnion,...K(t)});var rt=n=>n instanceof nn?rt(n.schema):n instanceof Te?rt(n.innerType()):n instanceof rn?[n.value]:n instanceof sn?n.options:n instanceof on?ne.objectValues(n.enum):n instanceof an?rt(n._def.innerType):n instanceof Jt?[void 0]:n instanceof Qt?[null]:n instanceof De?[void 0,...rt(n.unwrap())]:n instanceof Je?[null,...rt(n.unwrap())]:n instanceof Xn||n instanceof cn?rt(n.unwrap()):n instanceof ln?rt(n._def.innerType):[],Tr=class n extends ${_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==N.object)return b(e,{code:L.invalid_type,expected:N.object,received:e.parsedType}),j;let r=this.discriminator,i=e.data[r],s=this.optionsMap.get(i);return s?e.common.async?s._parseAsync({data:e.data,path:e.path,parent:e}):s._parseSync({data:e.data,path:e.path,parent:e}):(b(e,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let s of e){let o=rt(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new n({typeName:H.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...K(r)})}};function ws(n,t){let e=st(n),r=st(t);if(n===t)return{valid:!0,data:n};if(e===N.object&&r===N.object){let i=ne.objectKeys(t),s=ne.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...t};for(let a of s){let l=ws(n[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(e===N.array&&r===N.array){if(n.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<n.length;s++){let o=n[s],a=t[s],l=ws(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return e===N.date&&r===N.date&&+n==+t?{valid:!0,data:n}:{valid:!1}}var tn=class extends ${_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(Cs(s)||Cs(o))return j;let a=ws(s.value,o.value);return a.valid?((vs(s)||vs(o))&&e.dirty(),{status:e.value,value:a.data}):(b(r,{code:L.invalid_intersection_types}),j)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};tn.create=(n,t,e)=>new tn({left:n,right:t,typeName:H.ZodIntersection,...K(e)});var Ze=class n extends ${_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.array)return b(r,{code:L.invalid_type,expected:N.array,received:r.parsedType}),j;if(r.data.length<this._def.items.length)return b(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&r.data.length>this._def.items.length&&(b(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let s=[...r.data].map((o,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Ne(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Ce.mergeArray(e,o)):Ce.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new n({...this._def,rest:t})}};Ze.create=(n,t)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:n,typeName:H.ZodTuple,rest:null,...K(t)})};var Mr=class n extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return b(r,{code:L.invalid_type,expected:N.object,received:r.parsedType}),j;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)i.push({key:s._parse(new Ne(r,a,r.path,a)),value:o._parse(new Ne(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ce.mergeObjectAsync(e,i):Ce.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){return e instanceof $?new n({keyType:t,valueType:e,typeName:H.ZodRecord,...K(r)}):new n({keyType:mt.create(),valueType:t,typeName:H.ZodRecord,...K(e)})}},Ln=class extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.map)return b(r,{code:L.invalid_type,expected:N.map,received:r.parsedType}),j;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Ne(r,a,r.path,[c,"key"])),value:s._parse(new Ne(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return j;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}})}else{let a=new Map;for(let l of o){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return j;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}}}};Ln.create=(n,t,e)=>new Ln({valueType:t,keyType:n,typeName:H.ZodMap,...K(e)});var On=class n extends ${_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.set)return b(r,{code:L.invalid_type,expected:N.set,received:r.parsedType}),j;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(b(r,{code:L.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(b(r,{code:L.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty());let s=this._def.valueType;function o(l){let c=new Set;for(let u of l){if(u.status==="aborted")return j;u.status==="dirty"&&e.dirty(),c.add(u.value)}return{status:e.value,value:c}}let a=[...r.data.values()].map((l,c)=>s._parse(new Ne(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,e){return new n({...this._def,minSize:{value:t,message:B.toString(e)}})}max(t,e){return new n({...this._def,maxSize:{value:t,message:B.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};On.create=(n,t)=>new On({valueType:n,minSize:null,maxSize:null,typeName:H.ZodSet,...K(t)});var br=class n extends ${constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==N.function)return b(e,{code:L.invalid_type,expected:N.function,received:e.parsedType}),j;function r(a,l){return Pr({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Er(),vn].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function i(a,l){return Pr({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Er(),vn].filter(c=>!!c),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let s={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof gt){let a=this;return we(async function(...l){let c=new Ae([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),p=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(p,s).catch(f=>{throw c.addIssue(i(p,f)),c})})}else{let a=this;return we(function(...l){let c=a._def.args.safeParse(l,s);if(!c.success)throw new Ae([r(l,c.error)]);let u=Reflect.apply(o,this,c.data),p=a._def.returns.safeParse(u,s);if(!p.success)throw new Ae([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new n({...this._def,args:Ze.create(t).rest(it.create())})}returns(t){return new n({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,r){return new n({args:t||Ze.create([]).rest(it.create()),returns:e||it.create(),typeName:H.ZodFunction,...K(r)})}},nn=class extends ${get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};nn.create=(n,t)=>new nn({getter:n,typeName:H.ZodLazy,...K(t)});var rn=class extends ${_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return b(e,{received:e.data,code:L.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:t.data}}get value(){return this._def.value}};rn.create=(n,t)=>new rn({value:n,typeName:H.ZodLiteral,...K(t)});function Ei(n,t){return new sn({values:n,typeName:H.ZodEnum,...K(t)})}var sn=class n extends ${constructor(){super(...arguments),Kn.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),r=this._def.values;return b(e,{expected:ne.joinValues(r),received:e.parsedType,code:L.invalid_type}),j}if(Ar(this,Kn,"f")||wi(this,Kn,new Set(this._def.values),"f"),!Ar(this,Kn,"f").has(t.data)){let e=this._getOrReturnCtx(t),r=this._def.values;return b(e,{received:e.data,code:L.invalid_enum_value,options:r}),j}return we(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return n.create(t,{...this._def,...e})}exclude(t,e=this._def){return n.create(this.options.filter(r=>!t.includes(r)),{...this._def,...e})}};Kn=new WeakMap;sn.create=Ei;var on=class extends ${constructor(){super(...arguments),$n.set(this,void 0)}_parse(t){let e=ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==N.string&&r.parsedType!==N.number){let i=ne.objectValues(e);return b(r,{expected:ne.joinValues(i),received:r.parsedType,code:L.invalid_type}),j}if(Ar(this,$n,"f")||wi(this,$n,new Set(ne.getValidEnumValues(this._def.values)),"f"),!Ar(this,$n,"f").has(t.data)){let i=ne.objectValues(e);return b(r,{received:r.data,code:L.invalid_enum_value,options:i}),j}return we(t.data)}get enum(){return this._def.values}};$n=new WeakMap;on.create=(n,t)=>new on({values:n,typeName:H.ZodNativeEnum,...K(t)});var gt=class extends ${unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==N.promise&&e.common.async===!1)return b(e,{code:L.invalid_type,expected:N.promise,received:e.parsedType}),j;let r=e.parsedType===N.promise?e.data:Promise.resolve(e.data);return we(r.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};gt.create=(n,t)=>new gt({type:n,typeName:H.ZodPromise,...K(t)});var Te=class extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{b(r,o),o.fatal?e.abort():e.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(e.value==="aborted")return j;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?j:l.status==="dirty"||e.value==="dirty"?Cn(l.value):l});{if(e.value==="aborted")return j;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?j:a.status==="dirty"||e.value==="dirty"?Cn(a.value):a}}if(i.type==="refinement"){let o=a=>{let l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?j:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?j:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Kt(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Kt(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:e.value,value:a})):o);ne.assertNever(i)}};Te.create=(n,t,e)=>new Te({schema:n,typeName:H.ZodEffects,effect:t,...K(e)});Te.createWithPreprocess=(n,t,e)=>new Te({schema:t,effect:{type:"preprocess",transform:n},typeName:H.ZodEffects,...K(e)});var De=class extends ${_parse(t){return this._getType(t)===N.undefined?we(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};De.create=(n,t)=>new De({innerType:n,typeName:H.ZodOptional,...K(t)});var Je=class extends ${_parse(t){return this._getType(t)===N.null?we(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Je.create=(n,t)=>new Je({innerType:n,typeName:H.ZodNullable,...K(t)});var an=class extends ${_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===N.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};an.create=(n,t)=>new an({innerType:n,typeName:H.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(t)});var ln=class extends ${_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Yn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ae(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ae(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ln.create=(n,t)=>new ln({innerType:n,typeName:H.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var En=class extends ${_parse(t){if(this._getType(t)!==N.nan){let r=this._getOrReturnCtx(t);return b(r,{code:L.invalid_type,expected:N.nan,received:r.parsedType}),j}return{status:"valid",value:t.data}}};En.create=n=>new En({typeName:H.ZodNaN,...K(n)});var Sl=Symbol("zod_brand"),Xn=class extends ${_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},Zn=class n extends ${_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?j:s.status==="dirty"?(e.dirty(),Cn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?j:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new n({in:t,out:e,typeName:H.ZodPipeline})}},cn=class extends ${_parse(t){let e=this._def.innerType._parse(t),r=i=>(Kt(i)&&(i.value=Object.freeze(i.value)),i);return Yn(e)?e.then(i=>r(i)):r(e)}unwrap(){return this._def.innerType}};cn.create=(n,t)=>new cn({innerType:n,typeName:H.ZodReadonly,...K(t)});function Pi(n,t={},e){return n?ht.create().superRefine((r,i)=>{var s,o;if(!n(r)){let a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:e)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):ht.create()}var _l={object:Oe.lazycreate},H;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(H||(H={}));var Cl=(n,t={message:`Input not instance of ${n.name}`})=>Pi(e=>e instanceof n,t),Ai=mt.create,Ti=$t.create,vl=En.create,wl=Yt.create,Mi=Xt.create,Il=Zt.create,Ll=wn.create,Ol=Jt.create,El=Qt.create,Pl=ht.create,Al=it.create,Tl=je.create,Ml=In.create,bl=ot.create,Jn=Oe.create,Dl=Oe.strictCreate,Nl=en.create,Vl=Tr.create,kl=tn.create,Bl=Ze.create,Rl=Mr.create,Fl=Ln.create,Gl=On.create,Wl=br.create,Ul=nn.create,zl=rn.create,Hl=sn.create,jl=on.create,ql=gt.create,Ci=Te.create,Kl=De.create,$l=Je.create,Yl=Te.createWithPreprocess,Xl=Zn.create,Zl=()=>Ai().optional(),Jl=()=>Ti().optional(),Ql=()=>Mi().optional(),ec={string:n=>mt.create({...n,coerce:!0}),number:n=>$t.create({...n,coerce:!0}),boolean:n=>Xt.create({...n,coerce:!0}),bigint:n=>Yt.create({...n,coerce:!0}),date:n=>Zt.create({...n,coerce:!0})},tc=j,Qn=Object.freeze({__proto__:null,defaultErrorMap:vn,setErrorMap:Xa,getErrorMap:Er,makeIssue:Pr,EMPTY_PATH:Za,addIssueToContext:b,ParseStatus:Ce,INVALID:j,DIRTY:Cn,OK:we,isAborted:Cs,isDirty:vs,isValid:Kt,isAsync:Yn,get util(){return ne},get objectUtil(){return _s},ZodParsedType:N,getParsedType:st,ZodType:$,datetimeRegex:Oi,ZodString:mt,ZodNumber:$t,ZodBigInt:Yt,ZodBoolean:Xt,ZodDate:Zt,ZodSymbol:wn,ZodUndefined:Jt,ZodNull:Qt,ZodAny:ht,ZodUnknown:it,ZodNever:je,ZodVoid:In,ZodArray:ot,ZodObject:Oe,ZodUnion:en,ZodDiscriminatedUnion:Tr,ZodIntersection:tn,ZodTuple:Ze,ZodRecord:Mr,ZodMap:Ln,ZodSet:On,ZodFunction:br,ZodLazy:nn,ZodLiteral:rn,ZodEnum:sn,ZodNativeEnum:on,ZodPromise:gt,ZodEffects:Te,ZodTransformer:Te,ZodOptional:De,ZodNullable:Je,ZodDefault:an,ZodCatch:ln,ZodNaN:En,BRAND:Sl,ZodBranded:Xn,ZodPipeline:Zn,ZodReadonly:cn,custom:Pi,Schema:$,ZodSchema:$,late:_l,get ZodFirstPartyTypeKind(){return H},coerce:ec,any:Pl,array:bl,bigint:wl,boolean:Mi,date:Il,discriminatedUnion:Vl,effect:Ci,enum:Hl,function:Wl,instanceof:Cl,intersection:kl,lazy:Ul,literal:zl,map:Fl,nan:vl,nativeEnum:jl,never:Tl,null:El,nullable:$l,number:Ti,object:Jn,oboolean:Ql,onumber:Jl,optional:Kl,ostring:Zl,pipeline:Xl,preprocess:Yl,promise:ql,record:Rl,set:Gl,strictObject:Dl,string:Ai,symbol:Ll,transformer:Ci,tuple:Bl,undefined:Ol,union:Nl,unknown:Al,void:Ml,NEVER:tc,ZodIssueCode:L,quotelessJson:Ya,ZodError:Ae});function bi(n){let t=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1)for(let[D,T]of Object.entries(t))T===""&&delete t[D];if(!!n.skipValidation)return t;let i=typeof n.client=="object"?n.client:{},s=typeof n.server=="object"?n.server:{},o=typeof n.shared=="object"?n.shared:{},a=Jn(i),l=Jn(s),c=Jn(o),u=n.isServer??(typeof window>"u"||"Deno"in window),p=a.merge(c),d=l.merge(c).merge(a),f=u?d.safeParse(t):p.safeParse(t),m=n.onValidationError??(D=>{throw console.error("\u274C Invalid environment variables:",D.flatten().fieldErrors),new Error("Invalid environment variables")}),g=n.onInvalidAccess??(D=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(f.success===!1)return m(f.error);let x=D=>n.clientPrefix?!D.startsWith(n.clientPrefix)&&!(D in c.shape):!0,h=D=>u||!x(D),y=D=>D==="__esModule"||D==="$$typeof",S=(n.extends??[]).reduce((D,T)=>Object.assign(D,T),{}),_=Object.assign(f.data,S);return new Proxy(_,{get(D,T){if(typeof T=="string"&&!y(T))return h(T)?Reflect.get(D,T):g(T)}})}var Pn=(o=>(o.PROD_CN="prod-cn",o.PROD="prod",o.STAGING="staging",o.STAGING_CN="staging-cn",o.DEV="dev",o.LOCAL="local",o))(Pn||{}),Di=({fallback:n="prod"})=>{let t=process.env.ENV;if(!t)return n;let e=t.toLowerCase().trim();return Object.values(Pn).includes(e)?e:n};var nc=n=>{switch(n){case"local":return{CONNECT_API_BASE_URL:"http://localhost:3000/rest",CANVA_ENV_URL:"http://localhost:3000",CANVA_CLI_CLIENT_ID:"FAKE_CLIENT_ID",FLAVOR:"local"};case"dev":return{CONNECT_API_BASE_URL:"https://api.canva-dev.com/rest",CANVA_ENV_URL:"https://www.canva-dev.com",CANVA_CLI_CLIENT_ID:"OC-AZFEJKOjQYw3",FLAVOR:"dev"};case"staging-cn":return{CONNECT_API_BASE_URL:"https://api.canva-staging.cn/rest",CANVA_ENV_URL:"https://www.canva-staging.cn",CANVA_CLI_CLIENT_ID:"OC-AZNlOhtxI_Zb",FLAVOR:"staging-cn"};case"staging":return{CONNECT_API_BASE_URL:"https://api.canva-staging.com/rest",CANVA_ENV_URL:"https://www.canva-staging.com",CANVA_CLI_CLIENT_ID:"OC-AZH-EOTpT8Ib",FLAVOR:"staging"};case"prod-cn":return{CONNECT_API_BASE_URL:"https://api.canva.cn/rest",CANVA_ENV_URL:"https://www.canva.cn",CANVA_CLI_CLIENT_ID:"OC-AZN2AS1hKtVM",FLAVOR:"prod-cn"};case"prod":default:return{CONNECT_API_BASE_URL:"https://api.canva.com/rest",CANVA_ENV_URL:"https://www.canva.com",CANVA_CLI_CLIENT_ID:"OC-AZICxlGo2biD",FLAVOR:"prod"}}},Ni=({fallback:n="prod"})=>bi({server:{FLAVOR:Qn.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(n),CONNECT_API_BASE_URL:Qn.string().url(),CANVA_ENV_URL:Qn.string().url(),CANVA_CLI_CLIENT_ID:Qn.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD")},runtimeEnv:nc(Di({fallback:n})),emptyStringAsUndefined:!0});var Dr=class{constructor(t,e,r=!1){this.storageService=t;this.env=e;this.debug=r}generatePreviewResult=async t=>{let e=t;if(!e){let i=await this.getAppId();if(!i.success)return i;e=i.data}return{success:!0,data:this.constructPreviewUrl(e)}};async getAppId(){try{let t=await this.storageService.getAppIdFromEnvFile();if(!t.success)return t;let e=t.data;if(e==="YOUR_APP_ID_HERE"){let r="CANVA_APP_ID is set to the default placeholder value. Please update it in the .env file.";return this.debug&&console.error(r),{success:!1,code:"MISSING_FIELD",message:r}}return{success:!0,data:e}}catch(t){let e=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(e),{success:!1,code:"ENV_READ_ERROR",message:e}}}constructPreviewUrl(t){let e=this.encodeUiState({appId:t}),r=this.env.CANVA_ENV_URL,i=new URL("/login/",r),s=new URL("/design",r);return s.searchParams.append("create",""),s.searchParams.append("width","800"),s.searchParams.append("height","600"),s.searchParams.append("units","px"),s.searchParams.append("ui",e),i.searchParams.append("redirect",s.pathname+s.search),i.toString()}encodeUiState(t){let e={E:{"A?":"N",S:t.appId,g:!0}},r=JSON.stringify(e);return btoa(r).replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")}};var qn=Sn(require("crypto"),1),ba=Sn(Ma(),1);var gs=class{KEY_DERIVATION_ITERATIONS=1e5;KEY_LENGTH=32;async generateMachineId(){let t=await ba.default.uuid();return`${t.os}::${t.hardware}`}deriveKeyFromMachineId(t,e){return qn.default.pbkdf2Sync(t,e,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let e=await this.generateMachineId(),r=qn.default.randomBytes(16),i=this.deriveKeyFromMachineId(e,r),s=qn.default.randomBytes(12),o=qn.default.createCipheriv("aes-256-gcm",i,s),a=o.update(t,"utf8","hex");a+=o.final("hex");let l={iv:s.toString("hex"),authTag:o.getAuthTag().toString("hex"),cipherText:a,salt:r.toString("hex")};return{success:!0,data:[l.iv,l.authTag,l.cipherText,l.salt].join(":")}}catch(e){return{success:!1,code:"ENCRYPTION_ERROR",message:`Encryption failed: ${e instanceof Error?e.message:String(e)}`}}}async decrypt(t){try{let e=await this.generateMachineId(),r=t.split(":");if(r.length!==4)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Invalid encrypted data format."};let[i,s,o,a]=r;if(!i||!s||!o||!a)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Missing required components for decryption."};let l=Buffer.from(i,"hex"),c=Buffer.from(s,"hex"),u=Buffer.from(a,"hex"),p=this.deriveKeyFromMachineId(e,u),d=qn.default.createDecipheriv("aes-256-gcm",p,l);d.setAuthTag(c);let f=d.update(o,"hex","utf8");return f+=d.final("utf8"),{success:!0,data:f}}catch(e){return{success:!1,code:"DECRYPTION_ERROR",message:`Decryption failed: ${e instanceof Error?e.message:String(e)}`}}}};var Ra=Sn(require("fs/promises"),1),Fa=Sn(require("os"),1),Ga=Sn(require("path"),1),Wa=Sn(Ba(),1);var xs=class{constructor(t,e=Ra.default,r=Ga.default,i=Fa.default.homedir(),s=!1){this.encryptionService=t;this.fileSystem=e;this.pathModule=r;this.debug=s;this.filePath=this.pathModule.join(i,".canva-cli","credentials")}tokenKey="tokenData";flavorKey="flavor";filePath;isNodeError(t){return t instanceof Error&&typeof t.code=="string"}async ensureDirectoryExists(t){try{await this.fileSystem.mkdir(t,{recursive:!0})}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to create directory ${t}: ${r}`)}}async readJsonFromFile(){try{let t=await this.fileSystem.readFile(this.filePath,"utf-8");return JSON.parse(t)}catch(t){let e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read the file at ${this.filePath}: ${e}`)}}async writeJsonToFile(t){try{await this.fileSystem.writeFile(this.filePath,JSON.stringify(t,null,2),"utf-8")}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to write the file at ${this.filePath}: ${r}`)}try{await this.fileSystem.chmod(this.filePath,384)}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to set permissions on the file at ${this.filePath}: ${r}`)}}async saveTokenData({tokenData:t,flavor:e}){let r=await this.encryptionService.encrypt(JSON.stringify(t));if(!r.success)return{success:!1,code:"ENCRYPTION_ERROR",message:`Failed to encrypt token data: ${r.message}`};let i={tokenData:r.data,flavor:e};try{let s=this.pathModule.dirname(this.filePath);return await this.ensureDirectoryExists(s),await this.writeJsonToFile(i),{success:!0,data:void 0}}catch(s){let o=s instanceof Error?s.message:String(s);return{success:!1,code:"API_FAILURE",message:`Failed to save token data to file: ${o}`}}}async getTokenData(){try{let t=await this.readJsonFromFile();if(t[this.tokenKey]){let e=await this.encryptionService.decrypt(t[this.tokenKey]);return e.success?{success:!0,data:JSON.parse(e.data)}:e}else return{success:!1,code:"NO_TOKEN",message:"Token data not found in credentials file."}}catch(t){let e=t instanceof Error?t.message:String(t);return{success:!1,code:"NO_TOKEN",message:`Failed to read the token file: ${e}`}}}async getFlavor(){try{let e=(await this.readJsonFromFile())[this.flavorKey];if(e&&typeof e=="string"&&Object.values(Pn).includes(e))return e}catch{return"prod"}return"prod"}async deleteToken(){try{if((await this.readJsonFromFile())[this.tokenKey])try{await this.fileSystem.access(this.filePath),await this.fileSystem.unlink(this.filePath)}catch(e){if(this.isNodeError(e)&&e.code==="ENOENT")return;let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to delete the token data file: ${r}`)}else throw new Error("Token file does not exist or token data not found.")}catch(t){let e=t instanceof Error?t.message:String(t);throw new Error(`Failed to delete the token data file: ${e}`)}}async getAppIdFromEnvFile(){try{let t=this.pathModule.resolve(process.cwd(),".env");try{await this.fileSystem.access(t)}catch{let s="No .env file found, ensure you are in your intended app's directory.";return this.debug&&console.error(s),{success:!1,code:"FILE_NOT_FOUND",message:s}}let e=await this.fileSystem.readFile(t,"utf-8"),i=Wa.parse(e).CANVA_APP_ID;if(!i){let s="CANVA_APP_ID not found in .env file";return this.debug&&console.error(s),{success:!1,code:"MISSING_FIELD",message:s}}return{success:!0,data:i}}catch(t){let e=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(e),{success:!1,code:"ENV_READ_ERROR",message:e}}}};var Ud=Ni({fallback:"prod"}),zd=new gs,Hd=new xs(zd),jd=new Dr(Hd,Ud),qd=()=>jd.generatePreviewResult();0&&(module.exports={generatePreviewUrl});
|