@canva/cli 0.0.1-beta.18 → 0.0.1-beta.19

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/lib/cjs/index.cjs CHANGED
@@ -1,54 +1,54 @@
1
1
  // Copyright 2024 Canva Inc. All Rights Reserved.
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
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,Mn=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,Tn="",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=Mn("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){Tn=Tn+n.toString("utf8"),n.indexOf(kr)>=0&&(Ls(Tn),Tn="")}),he.stderr.on("data",function(){Ls(Tn+Ri)}),he.on("error",function(){Ls(Tn+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=Mn("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=Mn("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=Mn("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=Mn("which smartctl 2>/dev/null",Rr).toString().split(`\r
7
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
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
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
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(`
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=Mn("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(),Dn=require("child_process").exec,bn=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)&&Dn("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",function(r,i){let s=i.toString().split(`
13
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{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(`
17
+ echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;try{s=bn(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=bn("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=bn("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=bn('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');a.toString().split(`
20
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(`
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&&Dn("ioreg -c IOPlatformExpertDevice -d 2",function(r,i){if(!r){let s=i.toString().replace(/[<>"]/g,"").split(`
22
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
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(`
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",Dn(r,function(i,s){let o=s.toString().split(`
25
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=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
27
+ echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;try{o=bn(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.",Dn("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
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
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=Mn(a,v.execOptsLinux).toString().split(`
34
+ echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;try{o=bn(a,v.execOptsLinux).toString().split(`
35
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
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
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
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;
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)&&Dn(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
40
40
  echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
41
41
  echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
42
42
  echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
43
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(`
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&&Dn("ioreg -c IOPlatformExpertDevice -d 2",function(i,s){if(!i){let o=s.toString().replace(/[<>"]/g,"").split(`
45
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(`
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(Vn=>{"use strict";var Re=require("os"),Ve=require("fs"),F=ue(),W=require("child_process").exec,ar=require("child_process").execSync,Ye=process.platform,Nn=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||Nn)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}Vn.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":Nn&&n&&(t=n.toLowerCase().trim().replace(/\s+/g,"-")),t}function nu(){let n=Re.hostname;if(Nn||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(Nn&&W("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",function(r,i){let s={};i.toString().split(`
47
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
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
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
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(`
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)}}})})}Vn.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
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
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
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(`
@@ -68,7 +68,7 @@
68
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
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
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(`
71
+ `)[0]||"";s.versions.mongodb=(p.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"postgresql")&&(Nn?W("locate bin/postgres",function(c,u){if(c)W("psql -V",function(p,d){if(!p){let f=d.toString().split(`
72
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
73
  `).sort();p.length?W(p[p.length-1]+" -V",function(d,f){if(!d){let m=f.toString().split(`
74
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
@@ -97,24 +97,24 @@
97
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
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
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 ||
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)}})})}Vn.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)})}})})}Vn.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)}),Nn&&W(`echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null ||
102
102
  cat /etc/machine-id 2> /dev/null; echo;
103
103
  echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,function(s,o){let a=o.toString().split(`
104
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
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
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
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(`
108
+ \r`)[0].split("REG_SZ"),e.os=r.length>1?r[1].replace(/\r+|\n+|\s+/ig,"").toLowerCase():"",n&&n(e),t(e)})})}})})}Vn.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,Bn=Ct==="linux"||Ct==="android",$r=Ct==="darwin",Yr=Ct==="win32",Xr=Ct==="freebsd",Zr=Ct==="openbsd",Jr=Ct==="netbsd",Qr=Ct==="sunos",kn=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,kn=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)})}),Bn){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)}kn=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
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
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(`
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)}kn=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
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(`-----
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,kn=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(Bn)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&&kn!==0){let r=parseFloat(kn);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(Bn){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
118
  `);if(s.length===2){let o=s[0].split(`
119
119
  `),a=s[1].split(`
120
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(`
@@ -123,16 +123,16 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,fu
123
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
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
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(`
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(Bn)try{Ie("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
127
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
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
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(`
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(Bn)try{Ie("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
131
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
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
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
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(`
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,Bn)try{let h=Kr("cat /proc/stat 2>/dev/null | grep cpu",O.execOptsLinux).toString().split(`
136
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
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
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(`
@@ -146,46 +146,46 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,fu
146
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
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
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(`
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,Rn=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="";Rn.existsSync("/sys/class/power_supply/BAT1/uevent")?r="/sys/class/power_supply/BAT1/":Rn.existsSync("/sys/class/power_supply/BAT0/uevent")&&(r="/sys/class/power_supply/BAT0/");let i=!1,s="";Rn.existsSync("/sys/class/power_supply/AC/online")?s="/sys/class/power_supply/AC/online":Rn.existsSync("/sys/class/power_supply/AC0/online")&&(s="/sys/class/power_supply/AC0/online"),s&&(i=Rn.readFileSync(s).toString().trim()==="1"),r?Rn.readFile(r+"uevent",function(o,a){if(o)n&&n(e),t(e);else{let l=a.toString().split(`
150
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
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
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
153
153
  `).filter(u=>u),c=i.results[2].split(`\r
154
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(`
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"),Fn=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
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(`
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&&Fn("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()&&Fn(`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})}),Fn("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()))||{}))}}Fn("clinfo --raw",function(y,S){if(!y){let C=S.toString().split(`
160
+ `);f.controllers=r(f.controllers,C)}Fn("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}Fn("xrandr --verbose 2>/dev/null",function(E,J){if(!E){let U=J.toString().split(`
162
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
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
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
165
  `);y=V.getValue(T,"MonitorManufacturer",":"),S=V.getValue(T,"Name",":"),_=V.getValue(T,"PNPDeviceID",":").replace(/&amp;/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
166
  `),E=f[T].split(`
167
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(`
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",Gn=Pt==="win32",Ge=Pt==="freebsd",We=Pt==="openbsd",Ue=Pt==="netbsd",Wn=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
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(`
170
170
  `).filter(p=>!p.startsWith("/")&&p.indexOf(":")>0),Ot("mount").toString().split(`
171
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
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
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(Wn&&(t&&t(c),l(c)),Gn)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
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
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
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(`
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)}}),Wn&&(n&&n(null),t(null)),Gn&&(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
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
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
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
181
  `);e=Hs(a),e=Ao(e)}n&&n(e),t(e)});else{let s=js(i).split(`
182
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(`
183
+ `);e=Uu(s),e=Ku(e)}n&&n(e),t(e)}),Wn&&(n&&n(e),t(e)),Gn){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(Gn||Ge||We||Ue||Wn)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
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
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
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(`
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(Gn||Wn)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
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,
190
190
  "`,{maxBuffer:1024*1024},function(l,c){l||(c.toString().split(`
191
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(`
@@ -193,7 +193,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,fu
193
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
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
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(`
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)),Wn&&(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
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
198
  `).split(" Physical Interconnect: ");f.shift(),f.forEach(function(m){m="InterfaceType: "+m;let g=m.split(`
199
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 "
@@ -210,9 +210,9 @@ ${f}|"; smartctl -H ${f} | grep overall;`,o+=`${o?'printf ",";':""}smartctl -a -
210
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
211
  `+h+'|"; diskutil info /dev/'+h+" | grep SMART;"}}})}catch{I.noop()}if(s)s=s+`printf "
212
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
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)}}}),Gn)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
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(`
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="",Un={},Vo=[],zn=[],Hn={},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
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
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
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(`
@@ -231,7 +231,7 @@ Profile on interface`)}catch(n){return n.status===1&&n.stdout.includes("AutoConf
231
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
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
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;
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(Un)&&!t)s=zn,n&&n(s),r(s);else{let c=hn();Un=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})}),zn=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(Un)&&!t)s=zn,n&&n(s),r(s);else{Un=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(Hn).length===0&&(Hn=ko()),g=Hn[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
235
  echo -n "address: "; cat /sys/class/net/${U}/address 2>/dev/null; echo;
236
236
  echo -n "addr_len: "; cat /sys/class/net/${U}/addr_len 2>/dev/null; echo;
237
237
  echo -n "broadcast: "; cat /sys/class/net/${U}/broadcast 2>/dev/null; echo;
@@ -256,7 +256,7 @@ Profile on interface`)}catch(n){return n.status===1&&n.stdout.includes("AutoConf
256
256
  echo -n "type: "; cat /sys/class/net/${U}/type 2>/dev/null; echo;
257
257
  echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${U}; echo;
258
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
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})}}zn=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(Un)&&!t)s=zn,n&&n(s),r(s);else{Un=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(Hn).length===0&&(Hn=ko()),_=Hn[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})}}zn=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
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
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
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(`
@@ -300,12 +300,12 @@ Interface `);return r.shift(),r.forEach(i=>{let s=i.split(`
300
300
  `).split(`:\r
301
301
  \r
302
302
  `);o.shift(),o.forEach(a=>{let l=a.split(`\r
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(`
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:{}},jn={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
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
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
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
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(`
308
+ `),x=ti(g.shift()),h={},y={};g.forEach(S=>{if(y=ni(S,x,jn),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}}}),jn.all=x,jn.list=Object.assign({},h),jn.ms=Date.now()-jn.ms,jn.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
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
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
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(`
@@ -360,7 +360,7 @@ Interface `);return r.shift(),r.forEach(i=>{let s=i.split(`
360
360
  \r
361
361
  `)}),e.on("data",s=>{r=r+s.toString()}),e.on("error",()=>{e=!1,t({})}),e.on("end",()=>{let s=r.indexOf(`\r
362
362
  \r
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(`
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",qn={},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 qn)({}).hasOwnProperty.call(qn,l)&&(e(a,l)||delete qn[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 qn)({}).hasOwnProperty.call(qn,c)&&(e(a,c)||delete qn[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
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=(`
365
365
  `+a.toString()).split(`
366
366
  printer `);for(let c=1;c<l.length;c++){let u=I0(l[c].split(`
@@ -385,4 +385,4 @@ Bus `);for(let a=1;a<o.length;a++){let l=k0(o[a]);e.push(l)}}n&&n(e),t(e)}),A0&&
385
385
  `),"PNPClass",":")==="Bluetooth"&&e.push(yd(o.split(`
386
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
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});
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",Xn=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 $n,Yn,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(Xn(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(Xn(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 Zn({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 Jn.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 Zn||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),$n.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,$n,"f")||wi(this,$n,new Set(this._def.values),"f"),!Ar(this,$n,"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})}};$n=new WeakMap;sn.create=Ei;var on=class extends ${constructor(){super(...arguments),Yn.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,Yn,"f")||wi(this,Yn,new Set(ne.getValidEnumValues(this._def.values)),"f"),!Ar(this,Yn,"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}};Yn=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 Xn(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"),Zn=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}},Jn=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 Xn(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,Qn=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=Jn.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,Pn=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:Xn,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:Zn,ZodPipeline:Jn,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:Qn,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=Qn(i),l=Qn(s),c=Qn(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 An=(o=>(o.PROD_CN="prod-cn",o.PROD="prod",o.STAGING="staging",o.STAGING_CN="staging-cn",o.DEV="dev",o.LOCAL="local",o))(An||{}),Di=({fallback:n="prod"})=>{let t=process.env.ENV;if(!t)return n;let e=t.toLowerCase().trim();return Object.values(An).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:Pn.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(n),CONNECT_API_BASE_URL:Pn.string().url(),CANVA_ENV_URL:Pn.string().url(),CANVA_CLI_CLIENT_ID:Pn.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD"),CANVA_CLI_DOCTOR_ENABLED:Pn.boolean().default(!1)},runtimeEnv:{...nc(Di({fallback:n})),CANVA_CLI_DOCTOR_ENABLED:process.env.CANVA_CLI_DOCTOR_ENABLED==="true"},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 Kn=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 Kn.default.pbkdf2Sync(t,e,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let e=await this.generateMachineId(),r=Kn.default.randomBytes(16),i=this.deriveKeyFromMachineId(e,r),s=Kn.default.randomBytes(12),o=Kn.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=Kn.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(An).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});