@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/esm/index.mjs CHANGED
@@ -1,54 +1,54 @@
1
1
  // Copyright 2024 Canva Inc. All Rights Reserved.
2
- var Fa=Object.create;var xi=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var Ua=Object.getPrototypeOf,za=Object.prototype.hasOwnProperty;var k=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var ae=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Ha=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wa(t))!za.call(n,i)&&i!==e&&xi(n,i,{get:()=>t[i],enumerable:!(r=Ga(t,i))||r.enumerable});return n};var Si=(n,t,e)=>(e=n!=null?Fa(Ua(n)):{},Ha(t||!n||!n.__esModule?xi(e,"default",{value:n,enumerable:!0}):e,n));var ki=ae((af,Ql)=>{Ql.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 pe=ae(W=>{"use strict";var St=k("os"),Ye=k("fs"),ec=k("path"),As=k("child_process").spawn,tc=k("child_process").exec,Tn=k("child_process").execSync,nc=k("util"),dn=process.platform,Ts=dn==="linux"||dn==="android",Gi=dn==="darwin",kr=dn==="win32",Wi=dn==="freebsd",Ui=dn==="openbsd",zi=dn==="netbsd",ws=0,pn="",Ke="",xt=null,$e=null,Ms=process.env.WINDIR||"C:\\Windows",ge,An="",Qn=[],bs=!1,Nr="",Bi="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",Ls="--###START###--",Ri="--ERROR--",Vr="--###ENDCMD###--",Os="--##ID##--",er={windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Object.assign({},process.env,{LANG:"en_US.UTF-8"})},Br={maxBuffer:1024*2e4,encoding:"UTF-8",stdio:["pipe","pipe","ignore"]};function rc(n){let t=parseInt(n,10);return isNaN(t)&&(t=0),t}function sc(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 Dr=new String,Es=new String().replace,Ps=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 ic(n){return n&&{}.toString.call(n)==="[object Function]"}function oc(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 ac(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 lc(){return ws===0&&(ws=St.cpus().length),ws}function _t(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 cc(n,t){return t=t||16,n.replace(/\\x([0-9A-Fa-f]{2})/g,function(){return String.fromCharCode(parseInt(arguments[1],t))})}function uc(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 pc(n,t){t=t||"",n=n.toUpperCase();let e=0,r=0,i=uc(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 dc(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=pc(o,i)}return e}function fc(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 mc(n,t,e){for(let r=0;r<n.length;r++)if(n[r][t]===e)return r;return-1}function hc(){if(Nr="powershell.exe",kr){let n=`${Ms}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`;Ye.existsSync(n)&&(Nr=n)}}function Xi(){if(St.type()==="Windows_NT"&&!pn&&(pn=Ms+"\\system32\\wbem\\wmic.exe",!Ye.existsSync(pn)))try{let n=Tn("WHERE WMIC",er).toString().split(`\r
3
- `);n&&n.length?pn=n[0]:pn="wmic"}catch{pn="wmic"}return pn}function gc(n){return new Promise(t=>{process.nextTick(()=>{try{Zi(Xi()+" "+n).then(e=>{t(e,"")})}catch(e){t("",e)}})})}function yc(){return kr?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"}function Is(n){let t="",e,r="";if(n.indexOf(Ls)>=0){e=n.split(Ls);let s=e[1].split(Os);t=s[0],s.length>1&&(n=s.slice(1).join(Os))}n.indexOf(Vr)>=0&&(e=n.split(Vr),r=e[0]);let i=-1;for(let s=0;s<Qn.length;s++)Qn[s].id===t&&(i=s,Qn[s].callback(r));i>=0&&Qn.splice(i,1)}function xc(){ge||(ge=As(Nr,["-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"})}),ge&&ge.pid&&(bs=!0,ge.stdout.on("data",function(n){An=An+n.toString("utf8"),n.indexOf(Vr)>=0&&(Is(An),An="")}),ge.stderr.on("data",function(){Is(An+Ri)}),ge.on("error",function(){Is(An+Ri)}),ge.on("close",function(){ge&&ge.kill()})))}function Sc(){try{ge&&(ge.stdin.write("exit"+St.EOL),ge.stdin.end(),bs=!1)}catch{ge&&ge.kill()}ge=null}function Zi(n){if(bs){let t=Math.random().toString(36).substring(2,12);return new Promise(e=>{process.nextTick(()=>{function r(i){e(i)}Qn.push({id:t,cmd:n,callback:r,start:new Date});try{ge&&ge.pid&&ge.stdin.write(Bi+"echo "+Ls+t+Os+"; "+St.EOL+n+St.EOL+"echo "+Vr+St.EOL)}catch{e("")}})})}else{let t="";return new Promise(e=>{process.nextTick(()=>{try{let r=As(Nr,["-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+St.EOL),r.stdin.write("exit"+St.EOL),r.stdin.end()}catch{r.kill(),e(t)}}else e(t)}catch{e(t)}})})}}function _c(n,t,e){let r="";return e=e||{},new Promise(i=>{process.nextTick(()=>{try{let s=As(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 Cc(){if(kr){if(!Ke)try{let e=Tn("chcp",er).toString().split(`\r
4
- `)[0].split(":");Ke=e.length>1?e[1].replace(".","").trim():""}catch{Ke="437"}return Ke}if(Ts||Gi||Wi||Ui||zi){if(!Ke)try{let e=Tn("echo $LANG",Br).toString().split(`\r
5
- `)[0].split(".");Ke=e.length>1?e[1].trim():"",Ke||(Ke="UTF-8")}catch{Ke="UTF-8"}return Ke}}function vc(){if(xt!==null)return xt;if(xt=!1,kr)try{let n=Tn("WHERE smartctl 2>nul",er).toString().split(`\r
6
- `);n&&n.length?xt=n[0].indexOf(":\\")>=0:xt=!1}catch{xt=!1}if(Ts||Gi||Wi||Ui||zi)try{xt=Tn("which smartctl 2>/dev/null",Br).toString().split(`\r
2
+ var Fa=Object.create;var xi=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var Ua=Object.getPrototypeOf,za=Object.prototype.hasOwnProperty;var k=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var ae=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Ha=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wa(t))!za.call(n,i)&&i!==e&&xi(n,i,{get:()=>t[i],enumerable:!(r=Ga(t,i))||r.enumerable});return n};var Si=(n,t,e)=>(e=n!=null?Fa(Ua(n)):{},Ha(t||!n||!n.__esModule?xi(e,"default",{value:n,enumerable:!0}):e,n));var ki=ae((af,Ql)=>{Ql.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 pe=ae(W=>{"use strict";var St=k("os"),Ye=k("fs"),ec=k("path"),As=k("child_process").spawn,tc=k("child_process").exec,Mn=k("child_process").execSync,nc=k("util"),dn=process.platform,Ts=dn==="linux"||dn==="android",Gi=dn==="darwin",kr=dn==="win32",Wi=dn==="freebsd",Ui=dn==="openbsd",zi=dn==="netbsd",ws=0,pn="",Ke="",xt=null,$e=null,Ms=process.env.WINDIR||"C:\\Windows",ge,Tn="",Qn=[],bs=!1,Nr="",Bi="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",Ls="--###START###--",Ri="--ERROR--",Vr="--###ENDCMD###--",Os="--##ID##--",er={windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Object.assign({},process.env,{LANG:"en_US.UTF-8"})},Br={maxBuffer:1024*2e4,encoding:"UTF-8",stdio:["pipe","pipe","ignore"]};function rc(n){let t=parseInt(n,10);return isNaN(t)&&(t=0),t}function sc(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 Dr=new String,Es=new String().replace,Ps=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 ic(n){return n&&{}.toString.call(n)==="[object Function]"}function oc(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 ac(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 lc(){return ws===0&&(ws=St.cpus().length),ws}function _t(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 cc(n,t){return t=t||16,n.replace(/\\x([0-9A-Fa-f]{2})/g,function(){return String.fromCharCode(parseInt(arguments[1],t))})}function uc(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 pc(n,t){t=t||"",n=n.toUpperCase();let e=0,r=0,i=uc(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 dc(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=pc(o,i)}return e}function fc(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 mc(n,t,e){for(let r=0;r<n.length;r++)if(n[r][t]===e)return r;return-1}function hc(){if(Nr="powershell.exe",kr){let n=`${Ms}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`;Ye.existsSync(n)&&(Nr=n)}}function Xi(){if(St.type()==="Windows_NT"&&!pn&&(pn=Ms+"\\system32\\wbem\\wmic.exe",!Ye.existsSync(pn)))try{let n=Mn("WHERE WMIC",er).toString().split(`\r
3
+ `);n&&n.length?pn=n[0]:pn="wmic"}catch{pn="wmic"}return pn}function gc(n){return new Promise(t=>{process.nextTick(()=>{try{Zi(Xi()+" "+n).then(e=>{t(e,"")})}catch(e){t("",e)}})})}function yc(){return kr?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"}function Is(n){let t="",e,r="";if(n.indexOf(Ls)>=0){e=n.split(Ls);let s=e[1].split(Os);t=s[0],s.length>1&&(n=s.slice(1).join(Os))}n.indexOf(Vr)>=0&&(e=n.split(Vr),r=e[0]);let i=-1;for(let s=0;s<Qn.length;s++)Qn[s].id===t&&(i=s,Qn[s].callback(r));i>=0&&Qn.splice(i,1)}function xc(){ge||(ge=As(Nr,["-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"})}),ge&&ge.pid&&(bs=!0,ge.stdout.on("data",function(n){Tn=Tn+n.toString("utf8"),n.indexOf(Vr)>=0&&(Is(Tn),Tn="")}),ge.stderr.on("data",function(){Is(Tn+Ri)}),ge.on("error",function(){Is(Tn+Ri)}),ge.on("close",function(){ge&&ge.kill()})))}function Sc(){try{ge&&(ge.stdin.write("exit"+St.EOL),ge.stdin.end(),bs=!1)}catch{ge&&ge.kill()}ge=null}function Zi(n){if(bs){let t=Math.random().toString(36).substring(2,12);return new Promise(e=>{process.nextTick(()=>{function r(i){e(i)}Qn.push({id:t,cmd:n,callback:r,start:new Date});try{ge&&ge.pid&&ge.stdin.write(Bi+"echo "+Ls+t+Os+"; "+St.EOL+n+St.EOL+"echo "+Vr+St.EOL)}catch{e("")}})})}else{let t="";return new Promise(e=>{process.nextTick(()=>{try{let r=As(Nr,["-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+St.EOL),r.stdin.write("exit"+St.EOL),r.stdin.end()}catch{r.kill(),e(t)}}else e(t)}catch{e(t)}})})}}function _c(n,t,e){let r="";return e=e||{},new Promise(i=>{process.nextTick(()=>{try{let s=As(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 Cc(){if(kr){if(!Ke)try{let e=Mn("chcp",er).toString().split(`\r
4
+ `)[0].split(":");Ke=e.length>1?e[1].replace(".","").trim():""}catch{Ke="437"}return Ke}if(Ts||Gi||Wi||Ui||zi){if(!Ke)try{let e=Mn("echo $LANG",Br).toString().split(`\r
5
+ `)[0].split(".");Ke=e.length>1?e[1].trim():"",Ke||(Ke="UTF-8")}catch{Ke="UTF-8"}return Ke}}function vc(){if(xt!==null)return xt;if(xt=!1,kr)try{let n=Mn("WHERE smartctl 2>nul",er).toString().split(`\r
6
+ `);n&&n.length?xt=n[0].indexOf(":\\")>=0:xt=!1}catch{xt=!1}if(Ts||Gi||Wi||Ui||zi)try{xt=Mn("which smartctl 2>/dev/null",Br).toString().split(`\r
7
7
  `).length>0}catch{nc.noop()}return xt}function wc(n){let t=["BCM2708","BCM2709","BCM2710","BCM2711","BCM2712","BCM2835","BCM2836","BCM2837","BCM2837B0"];if($e!==null)n=$e;else if(n===void 0)try{n=Ye.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
8
8
  `),$e=n}catch{return!1}let e=_t(n,"hardware"),r=_t(n,"model");return e&&t.indexOf(e)>-1||r&&r.indexOf("Raspberry Pi")>-1}function Ic(){let n=[];try{n=Ye.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split(`
9
9
  `)}catch{return!1}let t=_t(n,"id","=");return t&&t.indexOf("raspbian")>-1}function Lc(n,t,e){e||(e=t,t=er);let r="chcp 65001 > nul && cmd /C "+n+" && chcp "+Ke+" > nul";tc(r,t,function(i,s){e(i,s)})}function Oc(){let n=Ye.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),t=Ye.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),e=Ye.existsSync("/Library/Developer/Xcode/");return n||e||t}function Ec(){let n=process.hrtime();return!Array.isArray(n)||n.length!==2?0:+n[0]*1e9+ +n[1]}function Pc(n,t){t=t||"";let e=[];return n.forEach(r=>{r.startsWith(t)&&e.indexOf(r)===-1&&e.push(r)}),e.length}function Ac(n,t){t=t||"";let e=[];return n.forEach(r=>{r.startsWith(t)&&e.push(r)}),e.length}function Tc(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 Mc(){let n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",t=!0,e="";try{e.__proto__.replace=Es,e.__proto__.toLowerCase=Ps,e.__proto__.toString=Hi,e.__proto__.substr=ji,e.__proto__.substring=qi,e.__proto__.trim=Ki,e.__proto__.startsWith=$i}catch{Object.setPrototypeOf(e,Dr)}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=Es}catch{Object.setPrototypeOf(o,Dr)}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=Ps}catch{Object.setPrototypeOf(e,Dr)}let p=l?l[c]:"",d=u.toLowerCase();t=t&&d[0]===p&&d[0]&&!d[1]}}return!t}function bc(n){return("00000000"+parseInt(n,16).toString(2)).substr(-8)}function Dc(n){let t=Ye.lstatSync,e=Ye.readdirSync,r=ec.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 Ye.existsSync(n)?l(n):[]}function Ji(n){$e===null?$e=n:n===void 0&&(n=$e);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=_t(n,"revision",":",!0),o=_t(n,"model:",":",!0),a=_t(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"+_t(n,"revision",":",!0).toLowerCase()).substr(-8),u=parseInt(bc(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 Nc(n){if($e===null&&n!==void 0)$e=n;else if(n===void 0&&$e!==null)n=$e;else try{n=Ye.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
11
- `),$e=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 Vc(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 kc(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 Bc(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 Rc(){let n="";if(Ts)try{n=Tn("uname -v",Br).toString()}catch{n=""}return n}function Fc(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 Gc(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 Wc(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 Uc(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 zc(n,t=5e3){let e=n.startsWith("https:")||n.indexOf(":443/")>0||n.indexOf(":8443/")>0?k("https"):k("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 Hc(n){return n.replace(/To Be Filled By O.E.M./g,"")}function jc(){}W.toInt=rc;W.splitByNumber=sc;W.execOptsWin=er;W.execOptsLinux=Br;W.getCodepage=Cc;W.execWin=Lc;W.isFunction=ic;W.unique=oc;W.sortByKey=ac;W.cores=lc;W.getValue=_t;W.decodeEscapeSequence=cc;W.parseDateTime=dc;W.parseHead=fc;W.findObjectByKey=mc;W.getWmic=Xi;W.wmic=gc;W.darwinXcodeExists=Oc;W.getVboxmanage=yc;W.powerShell=Zi;W.powerShellStart=xc;W.powerShellRelease=Sc;W.execSafe=_c;W.nanoSeconds=Ec;W.countUniqueLines=Pc;W.countLines=Ac;W.noop=jc;W.isRaspberry=wc;W.isRaspbian=Ic;W.sanitizeShellString=Tc;W.isPrototypePolluted=Mc;W.decodePiCpuinfo=Ji;W.getRpiGpu=Nc;W.promiseAll=Vc;W.promisify=kc;W.promisifySave=Bc;W.smartMonToolsInstalled=vc;W.linuxVersion=Rc;W.plistParser=Fc;W.plistReader=Gc;W.stringObj=Dr;W.stringReplace=Es;W.stringToLower=Ps;W.stringToString=Hi;W.stringSubstr=ji;W.stringSubstring=qi;W.stringTrim=Ki;W.stringStartWith=$i;W.mathMin=Yi;W.WINDIR=Ms;W.getFilesInPath=Dc;W.semverCompare=Wc;W.getAppleModel=Uc;W.checkWebsite=zc;W.cleanString=Hc;W.getPowershell=hc});var eo=ae(sr=>{"use strict";var Ds=k("fs"),fn=k("os"),v=pe(),bn=k("child_process").exec,Mn=k("child_process").execSync,Rr=v.promisify(k("child_process").exec),Ct=process.platform,Fr=Ct==="linux"||Ct==="android",Gr=Ct==="darwin",Wr=Ct==="win32",tr=Ct==="freebsd",nr=Ct==="openbsd",rr=Ct==="netbsd",Ur=Ct==="sunos";function qc(n){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((Fr||tr||nr||rr)&&bn("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",function(r,i){let s=i.toString().split(`
11
+ `),$e=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 Vc(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 kc(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 Bc(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 Rc(){let n="";if(Ts)try{n=Mn("uname -v",Br).toString()}catch{n=""}return n}function Fc(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 Gc(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 Wc(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 Uc(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 zc(n,t=5e3){let e=n.startsWith("https:")||n.indexOf(":443/")>0||n.indexOf(":8443/")>0?k("https"):k("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 Hc(n){return n.replace(/To Be Filled By O.E.M./g,"")}function jc(){}W.toInt=rc;W.splitByNumber=sc;W.execOptsWin=er;W.execOptsLinux=Br;W.getCodepage=Cc;W.execWin=Lc;W.isFunction=ic;W.unique=oc;W.sortByKey=ac;W.cores=lc;W.getValue=_t;W.decodeEscapeSequence=cc;W.parseDateTime=dc;W.parseHead=fc;W.findObjectByKey=mc;W.getWmic=Xi;W.wmic=gc;W.darwinXcodeExists=Oc;W.getVboxmanage=yc;W.powerShell=Zi;W.powerShellStart=xc;W.powerShellRelease=Sc;W.execSafe=_c;W.nanoSeconds=Ec;W.countUniqueLines=Pc;W.countLines=Ac;W.noop=jc;W.isRaspberry=wc;W.isRaspbian=Ic;W.sanitizeShellString=Tc;W.isPrototypePolluted=Mc;W.decodePiCpuinfo=Ji;W.getRpiGpu=Nc;W.promiseAll=Vc;W.promisify=kc;W.promisifySave=Bc;W.smartMonToolsInstalled=vc;W.linuxVersion=Rc;W.plistParser=Fc;W.plistReader=Gc;W.stringObj=Dr;W.stringReplace=Es;W.stringToLower=Ps;W.stringToString=Hi;W.stringSubstr=ji;W.stringSubstring=qi;W.stringTrim=Ki;W.stringStartWith=$i;W.mathMin=Yi;W.WINDIR=Ms;W.getFilesInPath=Dc;W.semverCompare=Wc;W.getAppleModel=Uc;W.checkWebsite=zc;W.cleanString=Hc;W.getPowershell=hc});var eo=ae(sr=>{"use strict";var Ds=k("fs"),fn=k("os"),v=pe(),Dn=k("child_process").exec,bn=k("child_process").execSync,Rr=v.promisify(k("child_process").exec),Ct=process.platform,Fr=Ct==="linux"||Ct==="android",Gr=Ct==="darwin",Wr=Ct==="win32",tr=Ct==="freebsd",nr=Ct==="openbsd",rr=Ct==="netbsd",Ur=Ct==="sunos";function qc(n){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((Fr||tr||nr||rr)&&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=X(v.getValue(s,"manufacturer")),e.model=X(v.getValue(s,"product name")),e.version=X(v.getValue(s,"version")),e.serial=X(v.getValue(s,"serial number")),e.uuid=X(v.getValue(s,"uuid")).toLowerCase(),e.sku=X(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=X(e.manufacturer===""?v.getValue(s,"sys_vendor"):e.manufacturer),e.model=X(e.model===""?v.getValue(s,"product_name"):e.model),e.version=X(e.version===""?v.getValue(s,"product_version"):e.version),e.serial=X(e.serial===""?v.getValue(s,"product_serial"):e.serial),e.uuid=X(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&&(fn.release().toLowerCase().indexOf("microsoft")>=0||fn.release().toLowerCase().endsWith("wsl2"))){let a=parseFloat(fn.release().toLowerCase());e.virtual=!0,e.manufacturer="Microsoft",e.model="WSL",e.version=a<4.19?"1":"2"}if((tr||nr||rr)&&!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()}(Ds.existsSync("/.dockerenv")||Ds.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=X(e.manufacturer===""?v.getValue(s,"sys_vendor"):e.manufacturer),e.model=X(e.model===""?v.getValue(s,"product_name"):e.model),e.version=X(e.version===""?v.getValue(s,"product_version"):e.version),e.serial=X(e.serial===""?v.getValue(s,"product_serial"):e.serial),e.uuid=X(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&&(fn.release().toLowerCase().indexOf("microsoft")>=0||fn.release().toLowerCase().endsWith("wsl2"))){let a=parseFloat(fn.release().toLowerCase());e.virtual=!0,e.manufacturer="Microsoft",e.model="WSL",e.version=a<4.19?"1":"2"}if((tr||nr||rr)&&!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()}(Ds.existsSync("/.dockerenv")||Ds.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===""?Ds.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))}),Gr&&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))}),Gr&&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)}),Ur&&(n&&n(e),t(e)),Wr)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)}})})}sr.system=qc;function X(n){let t=n.toLowerCase();return t.indexOf("o.e.m.")===-1&&t.indexOf("default string")===-1&&t!=="default"&&n||""}function Kc(n){return new Promise(t=>{process.nextTick(()=>{let e={vendor:"",version:"",releaseDate:"",revision:""},r="";if((Fr||tr||nr||rr)&&(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)}})})}sr.system=qc;function X(n){let t=n.toLowerCase();return t.indexOf("o.e.m.")===-1&&t.indexOf("default string")===-1&&t!=="default"&&n||""}function Kc(n){return new Promise(t=>{process.nextTick(()=>{let e={vendor:"",version:"",releaseDate:"",revision:""},r="";if((Fr||tr||nr||rr)&&(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)})),Gr&&(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)})),Ur&&(e.vendor="Sun Microsystems",n&&n(e),t(e)),Wr)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)})),Gr&&(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)})),Ur&&(e.vendor="Sun Microsystems",n&&n(e),t(e)),Wr)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=X(v.getValue(o,"serialnumber",":"))}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}sr.bios=Kc;function $c(n){return new Promise(t=>{process.nextTick(()=>{let e={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},r="";if(Fr||tr||nr||rr){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(Rr(r)),i.push(Rr("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=X(v.getValue(o,"Manufacturer")),e.model=X(v.getValue(o,"Product Name")),e.version=X(v.getValue(o,"Version")),e.serial=X(v.getValue(o,"Serial Number")),e.assetTag=X(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=X(e.manufacturer?e.manufacturer:v.getValue(o,"board_vendor")),e.model=X(e.model?e.model:v.getValue(o,"board_name")),e.version=X(e.version?e.version:v.getValue(o,"board_version")),e.serial=X(e.serial?e.serial:v.getValue(o,"board_serial")),e.assetTag=X(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=fn.totalmem(),e.memSlots=0}n&&n(e),t(e)})}if(Gr){let i=[];i.push(Rr("ioreg -c IOPlatformExpertDevice -d 2")),i.push(Rr("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,fn.arch()==="arm64"&&(e.memSlots=0,e.memMax=fn.totalmem()),n&&n(e),t(e)})}if(Ur&&(n&&n(e),t(e)),Wr)try{let i=[],s=parseInt(fn.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=X(v.getValue(l,"manufacturer",":")),e.model=X(v.getValue(l,"model",":")),e.model||(e.model=X(v.getValue(l,"product",":"))),e.version=X(v.getValue(l,"version",":")),e.serial=X(v.getValue(l,"serialnumber",":")),e.assetTag=X(v.getValue(l,"partnumber",":")),e.assetTag||(e.assetTag=X(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)}})})}sr.baseboard=$c;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 Yc(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((Fr||tr||nr||rr)&&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)}})})}sr.baseboard=$c;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 Yc(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((Fr||tr||nr||rr)&&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=X(v.getValue(a,"chassis_vendor"));let l=parseInt(v.getValue(a,"chassis_type").replace(/\D/g,""));r.type=X(l&&!isNaN(l)&&l<t.length?t[l-1]:""),r.version=X(v.getValue(a,"chassis_version")),r.serial=X(v.getValue(a,"chassis_serial")),r.assetTag=X(v.getValue(a,"chassis_asset_tag")),n&&n(r),e(r)}),Gr&&bn("ioreg -c IOPlatformExpertDevice -d 2",function(i,s){if(!i){let o=s.toString().replace(/[<>"]/g,"").split(`
44
+ `);r.manufacturer=X(v.getValue(a,"chassis_vendor"));let l=parseInt(v.getValue(a,"chassis_type").replace(/\D/g,""));r.type=X(l&&!isNaN(l)&&l<t.length?t[l-1]:""),r.version=X(v.getValue(a,"chassis_version")),r.serial=X(v.getValue(a,"chassis_serial")),r.assetTag=X(v.getValue(a,"chassis_asset_tag")),n&&n(r),e(r)}),Gr&&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)}),Ur&&(n&&n(r),e(r)),Wr)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=X(v.getValue(o,"manufacturer",":")),r.model=X(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=X(v.getValue(o,"version",":")),r.serial=X(v.getValue(o,"serialnumber",":")),r.assetTag=X(v.getValue(o,"partnumber",":")),r.assetTag||(r.assetTag=X(v.getValue(o,"SMBIOSAssetTag",":"))),r.sku=X(v.getValue(o,"sku",":"))}n&&n(r),e(r)})}catch{n&&n(r),e(r)}})})}sr.chassis=Yc});var no=ae(Nn=>{"use strict";var Fe=k("os"),ke=k("fs"),G=pe(),U=k("child_process").exec,or=k("child_process").execSync,Xe=process.platform,Dn=Xe==="linux"||Xe==="android",Be=Xe==="darwin",Re=Xe==="win32",Ns=Xe==="freebsd",Vs=Xe==="openbsd",ks=Xe==="netbsd",Xc=Xe==="sunos";function Zc(){let n=new Date().toString().split(" "),t={current:Date.now(),uptime:Fe.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(Be||Dn)try{let r=or("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null",G.execOptsLinux).toString().split(Fe.EOL);r.length>3&&!r[0]&&r.shift();let i=r[0]||"";return(i.startsWith("+")||i.startsWith("-"))&&(i="GMT"),{current:Date.now(),uptime:Fe.uptime(),timezone:r[1]?i+r[1]:i,timezoneName:r[2]&&r[2].indexOf("/zoneinfo/")>0&&r[2].split("/zoneinfo/")[1]||""}}catch{G.noop()}return t}Nn.time=Zc;function ir(n){n=n||"",n=n.toLowerCase();let t=Xe;return Re?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 Jc(){let n=Fe.hostname;if(Dn||Be)try{n=or("hostname -f 2>/dev/null",G.execOptsLinux).toString().split(Fe.EOL)[0]}catch{G.noop()}if(Ns||Vs||ks)try{n=or("hostname 2>/dev/null").toString().split(Fe.EOL)[0]}catch{G.noop()}if(Re)try{n=or("echo %COMPUTERNAME%.%USERDNSDOMAIN%",G.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(Fe.EOL)[0]}catch{G.noop()}return n}function Qc(n){return new Promise(t=>{process.nextTick(()=>{let e={platform:Xe==="win32"?"Windows":Xe,distro:"unknown",release:"unknown",codename:"",kernel:Fe.release(),arch:Fe.arch(),hostname:Fe.hostname(),fqdn:Jc(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(Dn&&U("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",function(r,i){let s={};i.toString().split(`
46
+ `);r.manufacturer=X(v.getValue(o,"manufacturer",":")),r.model=X(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=X(v.getValue(o,"version",":")),r.serial=X(v.getValue(o,"serialnumber",":")),r.assetTag=X(v.getValue(o,"partnumber",":")),r.assetTag||(r.assetTag=X(v.getValue(o,"SMBIOSAssetTag",":"))),r.sku=X(v.getValue(o,"sku",":"))}n&&n(r),e(r)})}catch{n&&n(r),e(r)}})})}sr.chassis=Yc});var no=ae(Vn=>{"use strict";var Fe=k("os"),ke=k("fs"),G=pe(),U=k("child_process").exec,or=k("child_process").execSync,Xe=process.platform,Nn=Xe==="linux"||Xe==="android",Be=Xe==="darwin",Re=Xe==="win32",Ns=Xe==="freebsd",Vs=Xe==="openbsd",ks=Xe==="netbsd",Xc=Xe==="sunos";function Zc(){let n=new Date().toString().split(" "),t={current:Date.now(),uptime:Fe.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(Be||Nn)try{let r=or("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null",G.execOptsLinux).toString().split(Fe.EOL);r.length>3&&!r[0]&&r.shift();let i=r[0]||"";return(i.startsWith("+")||i.startsWith("-"))&&(i="GMT"),{current:Date.now(),uptime:Fe.uptime(),timezone:r[1]?i+r[1]:i,timezoneName:r[2]&&r[2].indexOf("/zoneinfo/")>0&&r[2].split("/zoneinfo/")[1]||""}}catch{G.noop()}return t}Vn.time=Zc;function ir(n){n=n||"",n=n.toLowerCase();let t=Xe;return Re?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 Jc(){let n=Fe.hostname;if(Nn||Be)try{n=or("hostname -f 2>/dev/null",G.execOptsLinux).toString().split(Fe.EOL)[0]}catch{G.noop()}if(Ns||Vs||ks)try{n=or("hostname 2>/dev/null").toString().split(Fe.EOL)[0]}catch{G.noop()}if(Re)try{n=or("echo %COMPUTERNAME%.%USERDNSDOMAIN%",G.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(Fe.EOL)[0]}catch{G.noop()}return n}function Qc(n){return new Promise(t=>{process.nextTick(()=>{let e={platform:Xe==="win32"?"Windows":Xe,distro:"unknown",release:"unknown",codename:"",kernel:Fe.release(),arch:Fe.arch(),hostname:Fe.hostname(),fqdn:Jc(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(Nn&&U("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=ir(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=G.getCodepage(),e.build=(s.BUILD_ID||"").replace(/"/g,"").trim(),eu().then(u=>{e.uefi=u,to().then(p=>{e.serial=p.os,n&&n(e),t(e)})})}),(Ns||Vs||ks)&&U("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=G.getValue(s,"kern.ostype"),a=ir(o),l=G.getValue(s,"kern.osrelease").split("-")[0],c=G.getValue(s,"kern.uuid"),u=G.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=G.getCodepage(),e.uefi=d||null,n&&n(e),t(e)}),Be&&U("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",function(r,i){let s=i.toString().split(`
49
49
  `);e.serial=G.getValue(s,"kern.uuid"),e.distro=G.getValue(s,"ProductName"),e.release=(G.getValue(s,"ProductVersion",":",!0,!0)+" "+G.getValue(s,"ProductVersionExtra",":",!0,!0)).trim(),e.build=G.getValue(s,"BuildVersion"),e.logofile=ir(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=G.getCodepage(),n&&n(e),t(e)}),Xc&&(e.release=e.kernel,U("uname -o",function(r,i){let s=i.toString().split(`
50
50
  `);e.distro=s[0],e.logofile=ir(e.distro),n&&n(e),t(e)})),Re){e.logofile=ir(),e.release=e.kernel;try{let r=[];r.push(G.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")),r.push(G.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),r.push(G.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),G.promiseAll(r).then(i=>{let s=i.results[0]?i.results[0].toString().split(`\r
51
- `):[""];e.distro=G.getValue(s,"Caption",":").trim(),e.serial=G.getValue(s,"SerialNumber",":").trim(),e.build=G.getValue(s,"BuildNumber",":").trim(),e.servicepack=G.getValue(s,"ServicePackMajorVersion",":").trim()+"."+G.getValue(s,"ServicePackMinorVersion",":").trim(),e.codepage=G.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,tu().then(l=>{e.uefi=l,n&&n(e),t(e)})})}catch{n&&n(e),t(e)}}})})}Nn.osInfo=Qc;function eu(){return new Promise(n=>{process.nextTick(()=>{ke.stat("/sys/firmware/efi",function(t){if(t)U('dmesg | grep -E "EFI v"',function(e,r){if(!e){let i=r.toString().split(`
51
+ `):[""];e.distro=G.getValue(s,"Caption",":").trim(),e.serial=G.getValue(s,"SerialNumber",":").trim(),e.build=G.getValue(s,"BuildNumber",":").trim(),e.servicepack=G.getValue(s,"ServicePackMajorVersion",":").trim()+"."+G.getValue(s,"ServicePackMinorVersion",":").trim(),e.codepage=G.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,tu().then(l=>{e.uefi=l,n&&n(e),t(e)})})}catch{n&&n(e),t(e)}}})})}Vn.osInfo=Qc;function eu(){return new Promise(n=>{process.nextTick(()=>{ke.stat("/sys/firmware/efi",function(t){if(t)U('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 tu(){return new Promise(n=>{process.nextTick(()=>{try{U('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',G.execOptsWin,function(t,e){if(t)U("echo %firmware_type%",G.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 nu(n,t){let e={kernel:Fe.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(G.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,U("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")&&U("npm -v",function(c,u){c||(s.versions.npm=u.toString().split(`
@@ -68,7 +68,7 @@ var Fa=Object.create;var xi=Object.defineProperty;var Ga=Object.getOwnPropertyDe
68
68
  `)[0]||"").split(" ");s.versions.redis=G.getValue(d,"v","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"docker")&&U("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")&&U("postconf -d | grep mail_version",function(c,u){if(!c){let p=u.toString().split(`
70
70
  `)||[];s.versions.postfix=G.getValue(p,"mail_version","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"mongodb")&&U("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?U("locate bin/postgres",function(c,u){if(c)U("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?U("locate bin/postgres",function(c,u){if(c)U("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?U(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()}}):Re?G.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 @@ var Fa=Object.create;var xi=Object.defineProperty;var Ga=Object.getOwnPropertyDe
97
97
  `)[0].trim().split(" ");d.length>1&&(s.versions.deno=d[1])}a()}),{}.hasOwnProperty.call(s.versions,"node")&&U("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")&&(Re?G.powerShell("$PSVersionTable").then(c=>{let u=c.toString().toLowerCase().split(`
99
99
  `).map(p=>p.replace(/ +/g," ").replace(/ +/g,":"));s.versions.powershell=G.getValue(u,"psversion"),a()}):a()),{}.hasOwnProperty.call(s.versions,"dotnet")&&(Re?G.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=nu;function ru(n){return new Promise(t=>{process.nextTick(()=>{if(Re)try{let e="CMD";G.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="";U("echo $SHELL",function(r,i){r||(e=i.toString().split(`
101
- `)[0]),n&&n(e),t(e)})}})})}Nn.shell=ru;function su(){let n=[];try{let t=Fe.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:su()},r;if(Be&&U("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{G.noop()}n&&n(e),t(e)}),Dn&&U(`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=nu;function ru(n){return new Promise(t=>{process.nextTick(()=>{if(Re)try{let e="CMD";G.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="";U("echo $SHELL",function(r,i){r||(e=i.toString().split(`
101
+ `)[0]),n&&n(e),t(e)})}})})}Vn.shell=ru;function su(){let n=[];try{let t=Fe.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:su()},r;if(Be&&U("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{G.noop()}n&&n(e),t(e)}),Nn&&U(`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=G.getValue(a,"os").toLowerCase(),e.hardware=G.getValue(a,"hardware").toLowerCase(),!e.hardware){let l=ke.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
105
105
  `),c=G.getValue(l,"serial");e.hardware=c||""}n&&n(e),t(e)}),(Ns||Vs||ks)&&U("sysctl -i kern.hostid kern.hostuuid",function(i,s){let o=s.toString().split(`
106
106
  `);e.os=G.getValue(o,"kern.hostid",":").toLowerCase(),e.hardware=G.getValue(o,"kern.hostuuid",":").toLowerCase(),e.os.indexOf("unknown")>=0&&(e.os=""),e.hardware.indexOf("unknown")>=0&&(e.hardware=""),n&&n(e),t(e)}),Re){let i="%windir%\\System32";process.arch==="ia32"&&Object.prototype.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")&&(i="%windir%\\sysnative\\cmd.exe /c %windir%\\System32"),G.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then(s=>{let o=s.split(`\r
107
107
  `);e.hardware=G.getValue(o,"uuid",":").toLowerCase(),U(`${i}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`,G.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=ae(wt=>{"use strict";var Ze=k("os"),Le=k("child_process").exec,qr=k("child_process").execSync,jr=k("fs"),O=pe(),vt=process.platform,kn=vt==="linux"||vt==="android",Kr=vt==="darwin",$r=vt==="win32",Yr=vt==="freebsd",Xr=vt==="openbsd",Zr=vt==="netbsd",Jr=vt==="sunos",Vn=0,J={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=[],Bs=0,Rs={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 iu(n){let t="";for(let e in so)so[e].split(" ").forEach(i=>{n.indexOf(i)>=0&&(t=e)});return t}function Hr(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 zr(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=Hr(n.brand);let t=n.brand.split(" ");return t.shift(),n.brand=t.join(" "),n}function Fs(n){let t="0";for(let e in Rs)if({}.hasOwnProperty.call(Rs,e)){let r=e.split("|"),i=0;r.forEach(s=>{n.indexOf(s)>-1&&i++}),i===r.length&&(t=Rs[e])}return parseFloat(t)}function ou(){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,Kr&&Le("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=zr(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(Ze.arch()==="arm64"){e.socket="SOC";try{let m=qr("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=[];Ze.cpus()[0]&&Ze.cpus()[0].model&&(i=Ze.cpus()[0].model),Le('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=Fs(e.brand)),e.speed===0){let g=Gs();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=zr(e),e.vendor=Hr(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=jr.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=ae(wt=>{"use strict";var Ze=k("os"),Le=k("child_process").exec,qr=k("child_process").execSync,jr=k("fs"),O=pe(),vt=process.platform,Bn=vt==="linux"||vt==="android",Kr=vt==="darwin",$r=vt==="win32",Yr=vt==="freebsd",Xr=vt==="openbsd",Zr=vt==="netbsd",Jr=vt==="sunos",kn=0,J={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=[],Bs=0,Rs={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 iu(n){let t="";for(let e in so)so[e].split(" ").forEach(i=>{n.indexOf(i)>=0&&(t=e)});return t}function Hr(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 zr(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=Hr(n.brand);let t=n.brand.split(" ");return t.shift(),n.brand=t.join(" "),n}function Fs(n){let t="0";for(let e in Rs)if({}.hasOwnProperty.call(Rs,e)){let r=e.split("|"),i=0;r.forEach(s=>{n.indexOf(s)>-1&&i++}),i===r.length&&(t=Rs[e])}return parseFloat(t)}function ou(){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,Kr&&Le("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=zr(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(Ze.arch()==="arm64"){e.socket="SOC";try{let m=qr("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=[];Ze.cpus()[0]&&Ze.cpus()[0].model&&(i=Ze.cpus()[0].model),Le('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=Fs(e.brand)),e.speed===0){let g=Gs();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=zr(e),e.vendor=Hr(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=jr.readFileSync("/proc/cpuinfo").toString().split(`
112
112
  `),x=O.getValue(g,"uarch")||"";if(x.indexOf(",")>-1){let h=x.split(",");e.manufacturer=Hr(h[0]),e.brand=h[1]}}let m=[];Le('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(Yr||Xr||Zr){let i="",s=[];Ze.cpus()[0]&&Ze.cpus()[0].model&&(i=Ze.cpus()[0].model),Le("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=Fs(e.brand)),e.speed===0){let f=Gs();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=zr(e),e.vendor=Hr(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=Fs(e.brand)),e.speed===0){let f=Gs();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=zr(e),e.vendor=Hr(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(Jr&&n(e),$r)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=zr(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=Fs(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=iu(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 au(n){return new Promise(t=>{process.nextTick(()=>{ou().then(e=>{n&&n(e),t(e)})})})}wt.cpu=au;function Gs(){let n=Ze.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=qr('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 lu(n){return new Promise(t=>{process.nextTick(()=>{let e=Gs();if(e.avg===0&&Vn!==0){let r=parseFloat(Vn);e={min:r,max:r,avg:r,cores:[]}}n&&n(e),t(e)})})}wt.cpuCurrentSpeed=lu;function cu(n){return new Promise(t=>{process.nextTick(()=>{let e={main:null,cores:[],max:null,socket:[],chipset:null};if(kn){try{let s=qr('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=zr(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=Fs(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=iu(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 au(n){return new Promise(t=>{process.nextTick(()=>{ou().then(e=>{n&&n(e),t(e)})})})}wt.cpu=au;function Gs(){let n=Ze.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=qr('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 lu(n){return new Promise(t=>{process.nextTick(()=>{let e=Gs();if(e.avg===0&&kn!==0){let r=parseFloat(kn);e={min:r,max:r,avg:r,cores:[]}}n&&n(e),t(e)})})}wt.cpuCurrentSpeed=lu;function cu(n){return new Promise(t=>{process.nextTick(()=>{let e={main:null,cores:[],max:null,socket:[],chipset:null};if(Bn){try{let s=qr('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{Le(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)}):Le("/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((Yr||Xr||Zr)&&Le("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)}),Kr){let r=null;try{r=k("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(Jr&&(n&&n(e),t(e)),$r)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)}})})}wt.cpuTemperature=cu;function io(n){return new Promise(t=>{process.nextTick(()=>{let e="";if($r)try{Le('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{Le("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)}})})}wt.cpuTemperature=cu;function io(n){return new Promise(t=>{process.nextTick(()=>{let e="";if($r)try{Le('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{Le("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)):jr.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)}(Yr||Xr||Zr)&&Le("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)}),Kr&&Le("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)}),Jr&&(n&&n(e),t(e))})})}wt.cpuFlags=io;function oo(n){return new Promise(t=>{process.nextTick(()=>{let e={l1d:null,l1i:null,l2:null,l3:null};if(kn)try{Le("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)}),Jr&&(n&&n(e),t(e))})})}wt.cpuFlags=io;function oo(n){return new Promise(t=>{process.nextTick(()=>{let e={l1d:null,l1i:null,l2:null,l3:null};if(Bn)try{Le("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((Yr||Xr||Zr)&&Le("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)}),Kr&&Le("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)}),Jr&&(n&&n(e),t(e)),$r)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}wt.cpuCache=oo;function uu(){return new Promise(n=>{process.nextTick(()=>{let t=Ze.loadavg().map(function(s){return s/O.cores()}),e=parseFloat(Math.max.apply(Math,t).toFixed(2)),r={};if(Date.now()-J.ms>=200){J.ms=Date.now();let s=Ze.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(Bs=s&&s.length?s.length:0,kn)try{let h=qr("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}wt.cpuCache=oo;function uu(){return new Promise(n=>{process.nextTick(()=>{let t=Ze.loadavg().map(function(s){return s/O.cores()}),e=parseFloat(Math.max.apply(Math,t).toFixed(2)),r={};if(Date.now()-J.ms>=200){J.ms=Date.now();let s=Ze.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(Bs=s&&s.length?s.length:0,Bn)try{let h=qr("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<Bs;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,ee=w&&w[h]&&w[h].idle?w[h].idle:0,E=w&&w[h]&&w[h].irq?w[h].irq:0,Q=w&&w[h]&&w[h].steal?w[h].steal:0,z=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-ee,w[h].loadIrq=w[h].irq-E,w[h].loadSteal=w[h].steal-Q,w[h].loadGuest=w[h].guest-z,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-J.tick;r={avgLoad:e,currentLoad:(g-J.load)/x*100,currentLoadUser:(o-J.user)/x*100,currentLoadSystem:(a-J.system)/x*100,currentLoadNice:(l-J.nice)/x*100,currentLoadIdle:(u-J.idle)/x*100,currentLoadIrq:(c-J.irq)/x*100,currentLoadSteal:(p-J.steal)/x*100,currentLoadGuest:(d-J.guest)/x*100,rawCurrentLoad:g-J.load,rawCurrentLoadUser:o-J.user,rawCurrentLoadSystem:a-J.system,rawCurrentLoadNice:l-J.nice,rawCurrentLoadIdle:u-J.idle,rawCurrentLoadIrq:c-J.irq,rawCurrentLoadSteal:p-J.steal,rawCurrentLoadGuest:d-J.guest,cpus:f},J={user:o,nice:l,system:a,idle:u,irq:c,steal:p,guest:d,tick:m,load:g,ms:J.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<Bs;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:J.currentLoad,currentLoadUser:J.currentLoadUser,currentLoadSystem:J.currentLoadSystem,currentLoadNice:J.currentLoadNice,currentLoadIdle:J.currentLoadIdle,currentLoadIrq:J.currentLoadIrq,currentLoadSteal:J.currentLoadSteal,currentLoadGuest:J.currentLoadGuest,rawCurrentLoad:J.rawCurrentLoad,rawCurrentLoadUser:J.rawCurrentLoadUser,rawCurrentLoadSystem:J.rawCurrentLoadSystem,rawCurrentLoadNice:J.rawCurrentLoadNice,rawCurrentLoadIdle:J.rawCurrentLoadIdle,rawCurrentLoadIrq:J.rawCurrentLoadIrq,rawCurrentLoadSteal:J.rawCurrentLoadSteal,rawCurrentLoadGuest:J.rawCurrentLoadGuest,cpus:s}}n(r)})})}function pu(n){return new Promise(t=>{process.nextTick(()=>{uu().then(e=>{n&&n(e),t(e)})})})}wt.currentLoad=pu;function du(){return new Promise(n=>{process.nextTick(()=>{let t=Ze.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 fu(n){return new Promise(t=>{process.nextTick(()=>{du().then(e=>{n&&n(e),t(e)})})})}wt.fullLoad=fu});var So=ae(Ws=>{"use strict";var et=k("os"),ar=k("child_process").exec,Qr=k("child_process").execSync,M=pe(),mu=k("fs"),It=process.platform,po=It==="linux"||It==="android",fo=It==="darwin",mo=It==="win32",ho=It==="freebsd",go=It==="openbsd",yo=It==="netbsd",xo=It==="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 hu(n){return new Promise(t=>{process.nextTick(()=>{let e={total:et.totalmem(),free:et.freemem(),used:et.totalmem()-et.freemem(),active:et.totalmem()-et.freemem(),available:et.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0,writeback:null,dirty:null};if(po)try{mu.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:et.totalmem(),e.free=parseInt(M.getValue(s,"memfree"),10),e.free=e.free?e.free*1024:et.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{ar("/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(Qr("sysctl -n vm.pagesize").toString())||r}catch{M.noop()}try{ar('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)}}})})}Ws.memLayout=gu});var vo=ae((ff,Co)=>{"use strict";var _o=k("child_process").exec,Bn=k("fs"),K=pe(),Lt=process.platform,yu=Lt==="linux"||Lt==="android",xu=Lt==="darwin",Su=Lt==="win32",_u=Lt==="freebsd",Cu=Lt==="openbsd",vu=Lt==="netbsd",wu=Lt==="sunos";function Iu(n,t,e){let r={},i=K.getValue(n,"BatteryStatus",":").trim();if(i>=0){let s=i?parseInt(i):0;r.status=s,r.hasBattery=!0,r.maxCapacity=e||parseInt(K.getValue(n,"DesignCapacity",":")||0),r.designedCapacity=parseInt(K.getValue(n,"DesignCapacity",":")||t),r.voltage=parseInt(K.getValue(n,"DesignVoltage",":")||0)/1e3,r.capacityUnit="mWh",r.percent=parseInt(K.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=K.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(yu){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)}}})})}Ws.memLayout=gu});var vo=ae((ff,Co)=>{"use strict";var _o=k("child_process").exec,Rn=k("fs"),K=pe(),Lt=process.platform,yu=Lt==="linux"||Lt==="android",xu=Lt==="darwin",Su=Lt==="win32",_u=Lt==="freebsd",Cu=Lt==="openbsd",vu=Lt==="netbsd",wu=Lt==="sunos";function Iu(n,t,e){let r={},i=K.getValue(n,"BatteryStatus",":").trim();if(i>=0){let s=i?parseInt(i):0;r.status=s,r.hasBattery=!0,r.maxCapacity=e||parseInt(K.getValue(n,"DesignCapacity",":")||0),r.designedCapacity=parseInt(K.getValue(n,"DesignCapacity",":")||t),r.voltage=parseInt(K.getValue(n,"DesignVoltage",":")||0)/1e3,r.capacityUnit="mWh",r.percent=parseInt(K.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=K.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(yu){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=K.getValue(l,"POWER_SUPPLY_STATUS","=").toLowerCase()==="charging",e.acConnected=i||e.isCharging,e.voltage=parseInt("0"+K.getValue(l,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,e.capacityUnit=e.voltage?"mWh":"mAh",e.cycleCount=parseInt("0"+K.getValue(l,"POWER_SUPPLY_CYCLE_COUNT","="),10),e.maxCapacity=Math.round(parseInt("0"+K.getValue(l,"POWER_SUPPLY_CHARGE_FULL","=",!0,!0),10)/1e3*(e.voltage||1));let c=parseInt("0"+K.getValue(l,"POWER_SUPPLY_VOLTAGE_MIN_DESIGN","="),10)/1e6;e.designedCapacity=Math.round(parseInt("0"+K.getValue(l,"POWER_SUPPLY_CHARGE_FULL_DESIGN","=",!0,!0),10)/1e3*(c||e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+K.getValue(l,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3*(e.voltage||1)),e.maxCapacity||(e.maxCapacity=parseInt("0"+K.getValue(l,"POWER_SUPPLY_ENERGY_FULL","=",!0,!0),10)/1e3,e.designedCapacity=parseInt("0"+K.getValue(l,"POWER_SUPPLY_ENERGY_FULL_DESIGN","=",!0,!0),10)/1e3|e.maxCapacity,e.currentCapacity=parseInt("0"+K.getValue(l,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);let u=K.getValue(l,"POWER_SUPPLY_CAPACITY","="),p=parseInt("0"+K.getValue(l,"POWER_SUPPLY_ENERGY_NOW","="),10),d=parseInt("0"+K.getValue(l,"POWER_SUPPLY_POWER_NOW","="),10),f=parseInt("0"+K.getValue(l,"POWER_SUPPLY_CURRENT_NOW","="),10),m=parseInt("0"+K.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=K.getValue(l,"POWER_SUPPLY_TECHNOLOGY","="),e.model=K.getValue(l,"POWER_SUPPLY_MODEL_NAME","="),e.manufacturer=K.getValue(l,"POWER_SUPPLY_MANUFACTURER","="),e.serial=K.getValue(l,"POWER_SUPPLY_SERIAL_NUMBER","="),n&&n(e),t(e)}}):(n&&n(e),t(e))}if((_u||Cu||vu)&&_o("sysctl -i hw.acpi.battery hw.acpi.acline",function(r,i){let s=i.toString().split(`
151
151
  `),o=parseInt("0"+K.getValue(s,"hw.acpi.battery.units"),10),a=parseInt("0"+K.getValue(s,"hw.acpi.battery.life"),10);e.hasBattery=o>0,e.cycleCount=null,e.isCharging=K.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)}),xu&&_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"+K.getValue(s,"cyclecount","="),10),e.voltage=parseInt("0"+K.getValue(s,"voltage","="),10)/1e3,e.capacityUnit=e.voltage?"mWh":"mAh",e.maxCapacity=Math.round(parseInt("0"+K.getValue(s,"applerawmaxcapacity","="),10)*(e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+K.getValue(s,"applerawcurrentcapacity","="),10)*(e.voltage||1)),e.designedCapacity=Math.round(parseInt("0"+K.getValue(s,"DesignCapacity","="),10)*(e.voltage||1)),e.manufacturer="Apple",e.serial=K.getValue(s,"BatterySerialNumber","=")||K.getValue(s,"Serial","="),e.model=K.getValue(s,"DeviceName","=");let o=null,l=K.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=K.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"+K.getValue(s,"TimeRemaining","="),10)))}n&&n(e),t(e)}),wu&&(n&&n(e),t(e)),Su)try{let r=[];r.push(K.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")),r.push(K.powerShell("(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")),r.push(K.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")),K.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]?K.toInt(l[d]):0,g=c&&c.length>=d+1&&c[d]?K.toInt(c[d]):0,x=Iu(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=ae(Oo=>{"use strict";var es=k("fs"),Rn=k("child_process").exec,Us=k("child_process").execSync,V=pe(),Ot=process.platform,lr="",ts=Ot==="linux"||Ot==="android",Lu=Ot==="darwin",wo=Ot==="win32",Ou=Ot==="freebsd",Eu=Ot==="openbsd",Pu=Ot==="netbsd",Au=Ot==="sunos",cr=0,ur=0,ns=0,rs=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 Tu(n){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[n]||""}function Mu(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 bu(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 Du(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=bu(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"]||Mu((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"),ee=S.spdisplays_depth||"",E=S["_spdisplays_display-serial-number"]||S["_spdisplays_display-serial-number2"]||null;f.displays.push({vendor:Tu(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:ee==="CGSThirtyBitColor"?30:ee==="CGSThirtytwoBitColor"?32:ee==="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=Us('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]?K.toInt(l[d]):0,g=c&&c.length>=d+1&&c[d]?K.toInt(c[d]):0,x=Iu(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=ae(Oo=>{"use strict";var es=k("fs"),Fn=k("child_process").exec,Us=k("child_process").execSync,V=pe(),Ot=process.platform,lr="",ts=Ot==="linux"||Ot==="android",Lu=Ot==="darwin",wo=Ot==="win32",Ou=Ot==="freebsd",Eu=Ot==="openbsd",Pu=Ot==="netbsd",Au=Ot==="sunos",cr=0,ur=0,ns=0,rs=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 Tu(n){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[n]||""}function Mu(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 bu(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 Du(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=bu(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"]||Mu((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"),ee=S.spdisplays_depth||"",E=S["_spdisplays_display-serial-number"]||S["_spdisplays_display-serial-number2"]||null;f.displays.push({vendor:Tu(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:ee==="CGSThirtyBitColor"?30:ee==="CGSThirtytwoBitColor"?32:ee==="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=Us('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 ee=y.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),E=y.substr(C,ee-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 Q=S.split(m.model)[0].trim();Q&&(m.subVendor=Q)}}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(lr)return lr;if(wo)try{let d=V.WINDIR+"\\System32\\DriverStore\\FileRepository",m=es.readdirSync(d).filter(g=>es.readdirSync([d,g].join("/")).includes("nvidia-smi.exe")).reduce((g,x)=>{let h=es.statSync([d,g,"nvidia-smi.exe"].join("/")),y=es.statSync([d,x,"nvidia-smi.exe"].join("/"));return h.ctimeMs>y.ctimeMs?g:x});m&&(lr=[d,m,"nvidia-smi.exe"].join("/"))}catch{V.noop()}else ts&&(lr="nvidia-smi");return lr}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"+(ts?" 2>/dev/null":"");ts&&(d.stdio=["pipe","pipe","ignore"]);try{return Us(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(Lu&&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=Us('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)}),ts&&(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,Q){if(!E){let z=Q.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(Lu&&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=Us('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)}),ts&&(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,Q){if(!E){let z=Q.toString().split(`
162
162
  `);f.displays=c(z,T)}n&&n(f),d(f)})})})})),(Ou||Eu||Pu)&&(n&&n(null),d(null)),Au&&(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(Q=>{let z=(E.subDeviceId||"").toLowerCase(),ue=Q.subDeviceId.split("x"),me=ue.length>1?ue[1].toLowerCase():ue[0].toLowerCase(),_e=Math.abs(z.length-me.length);if(z.length>me.length)for(let Z=0;Z<_e;Z++)me="0"+me;else if(z.length<me.length)for(let Z=0;Z<_e;Z++)z="0"+z;return z===me})||{}):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/),ee=[];T.forEach(E=>{let Q=E.split("|");Q.length===5&&ee.push({vendor:Q[0],code:Q[1],model:Q[2],serial:Q[3],instanceId:Q[4]})}),f.displays=p(C,_,S,D,ee),f.displays.length===1&&(cr&&(f.displays[0].resolutionX=cr,f.displays[0].currentResX||(f.displays[0].currentResX=cr)),ur&&(f.displays[0].resolutionY=ur,f.displays[0].currentResY===0&&(f.displays[0].currentResY=ur)),ns&&(f.displays[0].pixelDepth=ns)),f.displays=f.displays.map(E=>(rs&&!E.currentRefreshRate&&(E.currentRefreshRate=rs),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}),cr=V.toInt(V.getValue(h,"CurrentHorizontalResolution",":"))||cr,ur=V.toInt(V.getValue(h,"CurrentVerticalResolution",":"))||ur,rs=V.toInt(V.getValue(h,"CurrentRefreshRate",":"))||rs,ns=V.toInt(V.getValue(h,"CurrentBitsPerPixel",":"))||ns}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 ee=d[T].split(`
166
166
  `),E=f[T].split(`
167
167
  `),Q=g[T].split(`
168
- `),z=V.getValue(ee,"BitsPerPixel"),ue=V.getValue(ee,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),me=V.getValue(ee,"Primary"),_e=V.getValue(E,"MaxHorizontalImageSize"),Z=V.getValue(E,"MaxVerticalImageSize"),Ce=V.getValue(E,"InstanceName").toLowerCase(),he=V.getValue(Q,"VideoOutputTechnology"),De=V.getValue(ee,"DeviceName"),Ae="",ie="";x.forEach(oe=>{oe.instanceId.toLowerCase().startsWith(Ce)&&y.startsWith("(")&&S.startsWith("PnP")&&(Ae=oe.vendor,ie=oe.model)}),h.push({vendor:Ce.startsWith(_)&&Ae===""?y:Ae,model:Ce.startsWith(_)&&ie===""?S:ie,deviceName:De,main:me.toLowerCase()==="true",builtin:he==="2147483648",connection:he&&Io[he]?Io[he]:"",resolutionX:V.toInt(V.getValue(ue,"Width",":")),resolutionY:V.toInt(V.getValue(ue,"Height",":")),sizeX:_e?parseInt(_e,10):null,sizeY:Z?parseInt(Z,10):null,pixelDepth:z,currentResX:V.toInt(V.getValue(ue,"Width",":")),currentResY:V.toInt(V.getValue(ue,"Height",":")),positionX:V.toInt(V.getValue(ue,"X",":")),positionY:V.toInt(V.getValue(ue,"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=Du});var bo=ae(mn=>{"use strict";var I=pe(),Po=k("fs"),we=k("child_process").exec,Et=k("child_process").execSync,Nu=I.promisifySave(k("child_process").exec),At=process.platform,Ge=At==="linux"||At==="android",Pt=At==="darwin",Fn=At==="win32",We=At==="freebsd",Ue=At==="openbsd",ze=At==="netbsd",Gn=At==="sunos",se={},H={};function Vu(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
+ `),z=V.getValue(ee,"BitsPerPixel"),ue=V.getValue(ee,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),me=V.getValue(ee,"Primary"),_e=V.getValue(E,"MaxHorizontalImageSize"),Z=V.getValue(E,"MaxVerticalImageSize"),Ce=V.getValue(E,"InstanceName").toLowerCase(),he=V.getValue(Q,"VideoOutputTechnology"),De=V.getValue(ee,"DeviceName"),Ae="",ie="";x.forEach(oe=>{oe.instanceId.toLowerCase().startsWith(Ce)&&y.startsWith("(")&&S.startsWith("PnP")&&(Ae=oe.vendor,ie=oe.model)}),h.push({vendor:Ce.startsWith(_)&&Ae===""?y:Ae,model:Ce.startsWith(_)&&ie===""?S:ie,deviceName:De,main:me.toLowerCase()==="true",builtin:he==="2147483648",connection:he&&Io[he]?Io[he]:"",resolutionX:V.toInt(V.getValue(ue,"Width",":")),resolutionY:V.toInt(V.getValue(ue,"Height",":")),sizeX:_e?parseInt(_e,10):null,sizeY:Z?parseInt(Z,10):null,pixelDepth:z,currentResX:V.toInt(V.getValue(ue,"Width",":")),currentResY:V.toInt(V.getValue(ue,"Height",":")),positionX:V.toInt(V.getValue(ue,"X",":")),positionY:V.toInt(V.getValue(ue,"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=Du});var bo=ae(mn=>{"use strict";var I=pe(),Po=k("fs"),we=k("child_process").exec,Et=k("child_process").execSync,Nu=I.promisifySave(k("child_process").exec),At=process.platform,Ge=At==="linux"||At==="android",Pt=At==="darwin",Gn=At==="win32",We=At==="freebsd",Ue=At==="openbsd",ze=At==="netbsd",Wn=At==="sunos",se={},H={};function Vu(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||!Pt&&!s(u[1])))){let p=u[0],d=Ge||We||Ue||ze?u[1]:i(u[0]),f=parseInt(Ge||We||Ue||ze?u[2]:u[1])*1024,m=parseInt(Ge||We||Ue||ze?u[3]:u[2])*1024,g=parseInt(Ge||We||Ue||ze?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,Ge||We||Ue||ze?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(Ge||We||Ue||ze||Pt){let u="";if(e=[],r={},Pt){u="df -kP";try{e=Et("diskutil list").toString().split(`
170
170
  `).filter(p=>!p.startsWith("/")&&p.indexOf(":")>0),Et("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(Ge)try{u="export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL",Et("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(We||Ue||ze)try{u="df -lkPT",Et("mount").toString().split(`
173
- `).forEach(p=>{r[p.split(" ")[0]]=p.toLowerCase().indexOf("read-only")===-1})}catch{I.noop()}we(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)):we("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()}we(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)):we("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)}})})}mn.fsSize=Vu;function ku(n){return new Promise(t=>{process.nextTick(()=>{let e={max:null,allocated:null,available:null};(We||Ue||ze||Pt)&&we("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)}),Ge&&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))})})}mn.fsOpenFiles=ku;function Bu(n){return parseInt(n.substr(n.indexOf(" (")+2,n.indexOf(" Bytes)")-10))}function Ru(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=Bu(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 zs(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 Fu(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=Et(`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))})})}mn.fsOpenFiles=ku;function Bu(n){return parseInt(n.substr(n.indexOf(" (")+2,n.indexOf(" Bytes)")-10))}function Ru(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=Bu(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 zs(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 Fu(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=Et(`mdadm --export --detail /dev/${e.name}`,I.execOptsLinux).toString().split(`
178
178
  `),i=Fu(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 Gu(n){let t=[];return n.forEach(e=>{e.type.startsWith("disk")&&t.push(e.name)}),t}function Wu(n){let t=n;try{let e=Gu(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 Uu(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 zu(n){let t=n;try{let e=Uu(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 Hu(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 ju(n,t){let e=Hu(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 Hs(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 qu(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Ge&&we("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)we("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=Hs(o).split(`
181
181
  `);e=zs(a),e=Ao(e)}n&&n(e),t(e)});else{let s=Hs(i).split(`
182
182
  `);e=zs(s),e=Ao(e),e=Wu(e),n&&n(e),t(e)}}),Pt&&we("diskutil info -all",{maxBuffer:1024*1024},function(r,i){if(!r){let s=i.toString().split(`
183
- `);e=Ru(s),e=zu(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=ju(e,a),n&&n(e),t(e)})}catch{n&&n(e),t(e)}}(We||Ue||ze)&&(n&&n(null),t(null))})})}mn.blockDevices=qu;function To(n,t){let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return se&&se.ms?(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,e.ms=Date.now()-se.ms,e.rx_sec=(e.rx-se.bytes_read)/(e.ms/1e3),e.wx_sec=(e.wx-se.bytes_write)/(e.ms/1e3),e.tx_sec=e.rx_sec+e.wx_sec,se.rx_sec=e.rx_sec,se.wx_sec=e.wx_sec,se.tx_sec=e.tx_sec,se.bytes_read=e.rx,se.bytes_write=e.wx,se.bytes_overall=e.rx+e.wx,se.ms=Date.now(),se.last_ms=e.ms):(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,se.rx_sec=null,se.wx_sec=null,se.tx_sec=null,se.bytes_read=e.rx,se.bytes_write=e.wx,se.bytes_overall=e.rx+e.wx,se.ms=Date.now(),se.last_ms=0),e}function Ku(n){return new Promise(t=>{process.nextTick(()=>{if(Fn||We||Ue||ze||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;se&&!se.ms||se&&se.ms&&Date.now()-se.ms>=500?(Ge&&we("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=Ru(s),e=zu(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=ju(e,a),n&&n(e),t(e)})}catch{n&&n(e),t(e)}}(We||Ue||ze)&&(n&&n(null),t(null))})})}mn.blockDevices=qu;function To(n,t){let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return se&&se.ms?(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,e.ms=Date.now()-se.ms,e.rx_sec=(e.rx-se.bytes_read)/(e.ms/1e3),e.wx_sec=(e.wx-se.bytes_write)/(e.ms/1e3),e.tx_sec=e.rx_sec+e.wx_sec,se.rx_sec=e.rx_sec,se.wx_sec=e.wx_sec,se.tx_sec=e.tx_sec,se.bytes_read=e.rx,se.bytes_write=e.wx,se.bytes_overall=e.rx+e.wx,se.ms=Date.now(),se.last_ms=e.ms):(e.rx=n,e.wx=t,e.tx=e.rx+e.wx,se.rx_sec=null,se.wx_sec=null,se.tx_sec=null,se.bytes_read=e.rx,se.bytes_write=e.wx,se.bytes_overall=e.rx+e.wx,se.ms=Date.now(),se.last_ms=0),e}function Ku(n){return new Promise(t=>{process.nextTick(()=>{if(Gn||We||Ue||ze||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;se&&!se.ms||se&&se.ms&&Date.now()-se.ms>=500?(Ge&&we("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("|");we('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)})}}),Pt&&we(`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=se.last_ms,e.rx=se.bytes_read,e.wx=se.bytes_write,e.tx=se.bytes_read+se.bytes_write,e.rx_sec=se.rx_sec,e.wx_sec=se.wx_sec,e.tx_sec=se.tx_sec,n&&n(e),t(e))})})}mn.fsStats=Ku;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 H&&H.ms?(s.rIO=n,s.wIO=t,s.tIO=n+t,s.ms=Date.now()-H.ms,s.rIO_sec=(s.rIO-H.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-H.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-H.rWaitTime)*100/s.ms,s.wWaitPercent=(s.wWaitTime-H.wWaitTime)*100/s.ms,s.tWaitPercent=(s.tWaitTime-H.tWaitTime)*100/s.ms,H.rIO=n,H.wIO=t,H.rIO_sec=s.rIO_sec,H.wIO_sec=s.wIO_sec,H.tIO_sec=s.tIO_sec,H.rWaitTime=e,H.wWaitTime=r,H.tWaitTime=i,H.rWaitPercent=s.rWaitPercent,H.wWaitPercent=s.wWaitPercent,H.tWaitPercent=s.tWaitPercent,H.last_ms=s.ms,H.ms=Date.now()):(s.rIO=n,s.wIO=t,s.tIO=n+t,s.rWaitTime=e,s.wWaitTime=r,s.tWaitTime=i,H.rIO=n,H.wIO=t,H.rIO_sec=null,H.wIO_sec=null,H.tIO_sec=null,H.rWaitTime=e,H.wWaitTime=r,H.tWaitTime=i,H.rWaitPercent=null,H.wWaitPercent=null,H.tWaitPercent=null,H.last_ms=0,H.ms=Date.now()),s}function $u(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;H&&!H.ms||H&&H.ms&&Date.now()-H.ms>=500?((Ge||We||Ue||ze)&&we('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=se.last_ms,e.rx=se.bytes_read,e.wx=se.bytes_write,e.tx=se.bytes_read+se.bytes_write,e.rx_sec=se.rx_sec,e.wx_sec=se.wx_sec,e.tx_sec=se.tx_sec,n&&n(e),t(e))})})}mn.fsStats=Ku;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 H&&H.ms?(s.rIO=n,s.wIO=t,s.tIO=n+t,s.ms=Date.now()-H.ms,s.rIO_sec=(s.rIO-H.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-H.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-H.rWaitTime)*100/s.ms,s.wWaitPercent=(s.wWaitTime-H.wWaitTime)*100/s.ms,s.tWaitPercent=(s.tWaitTime-H.tWaitTime)*100/s.ms,H.rIO=n,H.wIO=t,H.rIO_sec=s.rIO_sec,H.wIO_sec=s.wIO_sec,H.tIO_sec=s.tIO_sec,H.rWaitTime=e,H.wWaitTime=r,H.tWaitTime=i,H.rWaitPercent=s.rWaitPercent,H.wWaitPercent=s.wWaitPercent,H.tWaitPercent=s.tWaitPercent,H.last_ms=s.ms,H.ms=Date.now()):(s.rIO=n,s.wIO=t,s.tIO=n+t,s.rWaitTime=e,s.wWaitTime=r,s.tWaitTime=i,H.rIO=n,H.wIO=t,H.rIO_sec=null,H.wIO_sec=null,H.tIO_sec=null,H.rWaitTime=e,H.wWaitTime=r,H.tWaitTime=i,H.rWaitPercent=null,H.wWaitPercent=null,H.tWaitPercent=null,H.last_ms=0,H.ms=Date.now()),s}function $u(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;H&&!H.ms||H&&H.ms&&Date.now()-H.ms>=500?((Ge||We||Ue||ze)&&we('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))}),Pt&&we(`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=H.rIO,e.wIO=H.wIO,e.tIO=H.rIO+H.wIO,e.ms=H.last_ms,e.rIO_sec=H.rIO_sec,e.wIO_sec=H.wIO_sec,e.tIO_sec=H.tIO_sec,e.rWaitTime=H.rWaitTime,e.wWaitTime=H.wWaitTime,e.tWaitTime=H.tWaitTime,e.rWaitPercent=H.rWaitPercent,e.wWaitPercent=H.wWaitPercent,e.tWaitPercent=H.tWaitPercent,n&&n(e),t(e))})})}mn.disksIO=$u;function Yu(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(Ge){let o="";we("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=Et("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=Hs(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?we(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
  "`,we(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((We||Ue||ze)&&(n&&n(i),e(i)),Gn&&(n&&n(i),e(i)),Pt&&we("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((We||Ue||ze)&&(n&&n(i),e(i)),Wn&&(n&&n(i),e(i)),Pt&&we("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
  "`,we(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(Et("smartctl --scan -j").toString());a&&a.devices&&a.devices.length>0&&a.devices.forEach(l=>{o.push(Nu(`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(Et("smartctl --scan -j").toString());a&&a.devices&&a.devices.length>0&&a.devices.forEach(l=>{o.push(Nu(`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)}})})}mn.diskLayout=Yu});var Go=ae(yn=>{"use strict";var is=k("os"),be=k("child_process").exec,de=k("child_process").execSync,Xu=k("fs"),P=pe(),Tt=process.platform,lt=Tt==="linux"||Tt==="android",ct=Tt==="darwin",pr=Tt==="win32",Mt=Tt==="freebsd",bt=Tt==="openbsd",Dt=Tt==="netbsd",Do=Tt==="sunos",te={},No="",Wn={},Vo=[],Un=[],zn={},hn;function gn(){let n="",t="";try{let e=is.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||"",pr){let i="";if(de("netstat -r",P.execOptsWin).toString().split(is.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(lt){let o=de("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)}})})}mn.diskLayout=Yu});var Go=ae(yn=>{"use strict";var is=k("os"),be=k("child_process").exec,de=k("child_process").execSync,Xu=k("fs"),P=pe(),Tt=process.platform,lt=Tt==="linux"||Tt==="android",ct=Tt==="darwin",pr=Tt==="win32",Mt=Tt==="freebsd",bt=Tt==="openbsd",Dt=Tt==="netbsd",Do=Tt==="sunos",te={},No="",Un={},Vo=[],zn=[],Hn={},hn;function gn(){let n="",t="";try{let e=is.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||"",pr){let i="";if(de("netstat -r",P.execOptsWin).toString().split(is.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(lt){let o=de("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(ct||Mt||bt||Dt||Do){let i="";lt&&(i="ip route 2> /dev/null | grep default | awk '{print $5}'"),ct&&(i="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(Mt||bt||Dt||Do)&&(i="route get 0.0.0.0 | grep interface:"),n=de(i).toString().split(`
217
217
  `)[0],n.indexOf(":")>-1&&(n=n.split(":")[1].trim())}}catch{P.noop()}return n&&(No=n),No}yn.getDefaultNetworkInterface=gn;function ko(){let n="",t="",e={};if(lt||Mt||bt||Dt){if(typeof hn>"u")try{let r=de("which ip",P.execOptsLinux).toString().split(`
218
218
  `);r.length&&r[0].indexOf(":")===-1&&r[0].indexOf("/")===0?hn=r[0]:hn=""}catch{hn=""}try{let r="export LC_ALL=C; "+(hn?hn+" link show up":"/sbin/ifconfig")+"; unset LC_ALL",s=de(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 ip(e)}catch{return[]}}function ap(n){let t=`nmcli device status 2>/dev/null | grep ${n}`;try{let s=de(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'`;de(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 lp(){let n="ip a 2> /dev/null",t=[];try{let e=de(n,P.execOptsLinux).toString().split(`
233
233
  `),r=Bo(e);t=cp(r)}catch{P.noop()}try{t=Ro("/etc/network/interfaces")}catch{P.noop()}return t}function cp(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 up(n,t,e){let r=!1;if(t){let i=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.method;`;try{switch(de(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 pp(n){let t=!1,e=`ipconfig getpacket "${n}" 2>/dev/null | grep lease_time;`;try{let r=de(e).toString().split(`
234
- `);r.length&&r[0].startsWith("lease_time")&&(t=!0)}catch{P.noop()}return t}function dp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep ipv4.dns-search;`;try{let i=de(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"Not defined":i}catch{return"Unknown"}}else return"Unknown"}function fp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep 802-1x.eap;`;try{let i=de(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"":i}catch{return"Not defined"}}else return"Not defined"}function mp(n){return n?n=="Not defined"?"Disabled":"Enabled":"Unknown"}function js(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 qs(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=is.networkInterfaces(),s=[],o=[],a=[],l=[];if(ct||Mt||bt||Dt)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{let c=gn();Wn=JSON.parse(JSON.stringify(i)),o=op(),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:js(u.iface,u.iface,u.mac),operstate:u.operstate,type:u.type,duplex:u.duplex,mtu:u.mtu,speed:u.speed,dhcp:pp(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(lt)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{Wn=JSON.parse(JSON.stringify(i)),Vo=lp();let c=gn();for(let u in i){let p="",d="",f="",m="",g="",x="",h="",y=null,S=0,_=!1,C="",D="",T="",ee="";if({}.hasOwnProperty.call(i,u)){let E=u;i[u].forEach(function(oe){(oe.family==="IPv4"||oe.family===4)&&(p=oe.address,d=oe.netmask),(oe.family==="IPv6"||oe.family===6)&&(!f||f.match(/^fe80::/i))&&(f=oe.address,m=oe.netmask),g=oe.mac;let yi=parseInt(process.versions.node.split("."),10);g.indexOf("00:00:0")>-1&&(lt||ct)&&!oe.internal&&yi>=8&&yi<=11&&(Object.keys(zn).length===0&&(zn=ko()),g=zn[u]||"")});let Q=u.split(":")[0].trim().toLowerCase(),z="",ue=P.isPrototypePolluted()?"---":P.sanitizeShellString(Q),me=P.mathMin(ue.length,2e3);for(let oe=0;oe<=me;oe++)ue[oe]!==void 0&&(z=z+ue[oe]);let _e=`echo -n "addr_assign_type: "; cat /sys/class/net/${z}/addr_assign_type 2>/dev/null; echo;
234
+ `);r.length&&r[0].startsWith("lease_time")&&(t=!0)}catch{P.noop()}return t}function dp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep ipv4.dns-search;`;try{let i=de(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"Not defined":i}catch{return"Unknown"}}else return"Unknown"}function fp(n){if(n){let t=`nmcli connection show "${n}" 2>/dev/null | grep 802-1x.eap;`;try{let i=de(t,P.execOptsLinux).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"":i}catch{return"Not defined"}}else return"Not defined"}function mp(n){return n?n=="Not defined"?"Disabled":"Enabled":"Unknown"}function js(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 qs(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=is.networkInterfaces(),s=[],o=[],a=[],l=[];if(ct||Mt||bt||Dt)if(JSON.stringify(i)===JSON.stringify(Un)&&!t)s=zn,n&&n(s),r(s);else{let c=gn();Un=JSON.parse(JSON.stringify(i)),o=op(),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:js(u.iface,u.iface,u.mac),operstate:u.operstate,type:u.type,duplex:u.duplex,mtu:u.mtu,speed:u.speed,dhcp:pp(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(lt)if(JSON.stringify(i)===JSON.stringify(Un)&&!t)s=zn,n&&n(s),r(s);else{Un=JSON.parse(JSON.stringify(i)),Vo=lp();let c=gn();for(let u in i){let p="",d="",f="",m="",g="",x="",h="",y=null,S=0,_=!1,C="",D="",T="",ee="";if({}.hasOwnProperty.call(i,u)){let E=u;i[u].forEach(function(oe){(oe.family==="IPv4"||oe.family===4)&&(p=oe.address,d=oe.netmask),(oe.family==="IPv6"||oe.family===6)&&(!f||f.match(/^fe80::/i))&&(f=oe.address,m=oe.netmask),g=oe.mac;let yi=parseInt(process.versions.node.split("."),10);g.indexOf("00:00:0")>-1&&(lt||ct)&&!oe.internal&&yi>=8&&yi<=11&&(Object.keys(Hn).length===0&&(Hn=ko()),g=Hn[u]||"")});let Q=u.split(":")[0].trim().toLowerCase(),z="",ue=P.isPrototypePolluted()?"---":P.sanitizeShellString(Q),me=P.mathMin(ue.length,2e3);for(let oe=0;oe<=me;oe++)ue[oe]!==void 0&&(z=z+ue[oe]);let _e=`echo -n "addr_assign_type: "; cat /sys/class/net/${z}/addr_assign_type 2>/dev/null; echo;
235
235
  echo -n "address: "; cat /sys/class/net/${z}/address 2>/dev/null; echo;
236
236
  echo -n "addr_len: "; cat /sys/class/net/${z}/addr_len 2>/dev/null; echo;
237
237
  echo -n "broadcast: "; cat /sys/class/net/${z}/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/${z}/type 2>/dev/null; echo;
257
257
  echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${z}; echo;
258
258
  echo -n "wirelessspeed: "; iw dev ${z} link 2>&1 | grep bitrate; echo;`,Z=[];try{Z=de(_e,P.execOptsLinux).toString().split(`
259
- `);let oe=ap(z);_=up(z,oe,Vo),C=dp(oe),D=fp(oe),T=mp(D)}catch{P.noop()}x=P.getValue(Z,"duplex"),x=x.startsWith("cat")?"":x,h=parseInt(P.getValue(Z,"mtu"),10);let Ce=parseInt(P.getValue(Z,"speed"),10);y=isNaN(Ce)?null:Ce;let he=P.getValue(Z,"wirelessspeed").split("tx bitrate: ");y===null&&he.length===2&&(Ce=parseFloat(he[1]),y=isNaN(Ce)?null:Ce),S=parseInt(P.getValue(Z,"carrier_changes"),10);let De=P.getValue(Z,"operstate");ee=De==="up"?P.getValue(Z,"wireless").trim()?"wireless":"wired":"unknown",(z==="lo"||z.startsWith("bond"))&&(ee="virtual");let Ae=i[u]&&i[u][0]?i[u][0].internal:!1;(u.toLowerCase().indexOf("loopback")>-1||E.toLowerCase().indexOf("loopback")>-1)&&(Ae=!0);let ie=Ae?!1:js(u,E,g);s.push({iface:z,ifaceName:E,default:Q===c,ip4:p,ip4subnet:d,ip6:f,ip6subnet:m,mac:g,internal:Ae,virtual:ie,operstate:De,type:ee,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(pr)if(JSON.stringify(i)===JSON.stringify(Wn)&&!t)s=Un,n&&n(s),r(s);else{Wn=JSON.parse(JSON.stringify(i));let c=gn();Qu().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=np(),a=ep();for(let p in i){let d="",f=P.isPrototypePolluted()?"---":P.sanitizeShellString(p),m=P.mathMin(f.length,2e3);for(let Z=0;Z<=m;Z++)f[Z]!==void 0&&(d=d+f[Z]);let g=p,x="",h="",y="",S="",_="",C="",D="",T=null,ee=0,E="down",Q=!1,z="",ue="",me="",_e="";if({}.hasOwnProperty.call(i,p)){let Z=p;i[p].forEach(function(ie){(ie.family==="IPv4"||ie.family===4)&&(x=ie.address,h=ie.netmask),(ie.family==="IPv6"||ie.family===6)&&(!y||y.match(/^fe80::/i))&&(y=ie.address,S=ie.netmask),_=ie.mac;let oe=parseInt(process.versions.node.split("."),10);_.indexOf("00:00:0")>-1&&(lt||ct)&&!ie.internal&&oe>=8&&oe<=11&&(Object.keys(zn).length===0&&(zn=ko()),_=zn[p]||"")}),z=tp(a.ifaces,d);let Ce=!1;u.forEach(ie=>{ie.mac===_&&!Ce&&(g=ie.iface||g,Z=ie.name,Q=ie.dhcp,E=ie.operstate,T=E==="up"?ie.speed:0,_e=ie.type,Ce=!0)}),(p.toLowerCase().indexOf("wlan")>=0||Z.toLowerCase().indexOf("wlan")>=0||Z.toLowerCase().indexOf("802.11n")>=0||Z.toLowerCase().indexOf("wireless")>=0||Z.toLowerCase().indexOf("wi-fi")>=0||Z.toLowerCase().indexOf("wifi")>=0)&&(_e="wireless");let he=sp(_e,d,l);ue=he.protocol,me=he.state;let De=i[p]&&i[p][0]?i[p][0].internal:!1;(p.toLowerCase().indexOf("loopback")>-1||Z.toLowerCase().indexOf("loopback")>-1)&&(De=!0);let Ae=De?!1:js(p,Z,_);s.push({iface:g,ifaceName:Z,default:g===c,ip4:x,ip4subnet:h,ip6:y,ip6subnet:S,mac:_,internal:De,virtual:Ae,operstate:E,type:_e,duplex:C,mtu:D,speed:T,dhcp:Q,dnsSuffix:z,ieee8021xAuth:ue,ieee8021xState:me,carrierChanges:ee})}}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)})}})})}yn.networkInterfaces=qs;function ss(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 te[n]&&te[n].ms?(l.ms=Date.now()-te[n].ms,l.rx_sec=t-te[n].rx_bytes>=0?(t-te[n].rx_bytes)/(l.ms/1e3):0,l.tx_sec=e-te[n].tx_bytes>=0?(e-te[n].tx_bytes)/(l.ms/1e3):0,te[n].rx_bytes=t,te[n].tx_bytes=e,te[n].rx_sec=l.rx_sec,te[n].tx_sec=l.tx_sec,te[n].ms=Date.now(),te[n].last_ms=l.ms,te[n].operstate=r):(te[n]||(te[n]={}),te[n].rx_bytes=t,te[n].tx_bytes=e,te[n].rx_sec=null,te[n].tx_sec=null,te[n].ms=Date.now(),te[n].last_ms=0,te[n].operstate=r),l}function Fo(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(P.isFunction(n)&&!t)t=n,e=[gn()];else{if(typeof n!="string"&&n!==void 0)return t&&t([]),r([]);n=n||gn();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=[],qs(!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(hp(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function hp(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 oe=ap(z);_=up(z,oe,Vo),C=dp(oe),D=fp(oe),T=mp(D)}catch{P.noop()}x=P.getValue(Z,"duplex"),x=x.startsWith("cat")?"":x,h=parseInt(P.getValue(Z,"mtu"),10);let Ce=parseInt(P.getValue(Z,"speed"),10);y=isNaN(Ce)?null:Ce;let he=P.getValue(Z,"wirelessspeed").split("tx bitrate: ");y===null&&he.length===2&&(Ce=parseFloat(he[1]),y=isNaN(Ce)?null:Ce),S=parseInt(P.getValue(Z,"carrier_changes"),10);let De=P.getValue(Z,"operstate");ee=De==="up"?P.getValue(Z,"wireless").trim()?"wireless":"wired":"unknown",(z==="lo"||z.startsWith("bond"))&&(ee="virtual");let Ae=i[u]&&i[u][0]?i[u][0].internal:!1;(u.toLowerCase().indexOf("loopback")>-1||E.toLowerCase().indexOf("loopback")>-1)&&(Ae=!0);let ie=Ae?!1:js(u,E,g);s.push({iface:z,ifaceName:E,default:Q===c,ip4:p,ip4subnet:d,ip6:f,ip6subnet:m,mac:g,internal:Ae,virtual:ie,operstate:De,type:ee,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(pr)if(JSON.stringify(i)===JSON.stringify(Un)&&!t)s=zn,n&&n(s),r(s);else{Un=JSON.parse(JSON.stringify(i));let c=gn();Qu().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=np(),a=ep();for(let p in i){let d="",f=P.isPrototypePolluted()?"---":P.sanitizeShellString(p),m=P.mathMin(f.length,2e3);for(let Z=0;Z<=m;Z++)f[Z]!==void 0&&(d=d+f[Z]);let g=p,x="",h="",y="",S="",_="",C="",D="",T=null,ee=0,E="down",Q=!1,z="",ue="",me="",_e="";if({}.hasOwnProperty.call(i,p)){let Z=p;i[p].forEach(function(ie){(ie.family==="IPv4"||ie.family===4)&&(x=ie.address,h=ie.netmask),(ie.family==="IPv6"||ie.family===6)&&(!y||y.match(/^fe80::/i))&&(y=ie.address,S=ie.netmask),_=ie.mac;let oe=parseInt(process.versions.node.split("."),10);_.indexOf("00:00:0")>-1&&(lt||ct)&&!ie.internal&&oe>=8&&oe<=11&&(Object.keys(Hn).length===0&&(Hn=ko()),_=Hn[p]||"")}),z=tp(a.ifaces,d);let Ce=!1;u.forEach(ie=>{ie.mac===_&&!Ce&&(g=ie.iface||g,Z=ie.name,Q=ie.dhcp,E=ie.operstate,T=E==="up"?ie.speed:0,_e=ie.type,Ce=!0)}),(p.toLowerCase().indexOf("wlan")>=0||Z.toLowerCase().indexOf("wlan")>=0||Z.toLowerCase().indexOf("802.11n")>=0||Z.toLowerCase().indexOf("wireless")>=0||Z.toLowerCase().indexOf("wi-fi")>=0||Z.toLowerCase().indexOf("wifi")>=0)&&(_e="wireless");let he=sp(_e,d,l);ue=he.protocol,me=he.state;let De=i[p]&&i[p][0]?i[p][0].internal:!1;(p.toLowerCase().indexOf("loopback")>-1||Z.toLowerCase().indexOf("loopback")>-1)&&(De=!0);let Ae=De?!1:js(p,Z,_);s.push({iface:g,ifaceName:Z,default:g===c,ip4:x,ip4subnet:h,ip6:y,ip6subnet:S,mac:_,internal:De,virtual:Ae,operstate:E,type:_e,duplex:C,mtu:D,speed:T,dhcp:Q,dnsSuffix:z,ieee8021xAuth:ue,ieee8021xState:me,carrierChanges:ee})}}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)})}})})}yn.networkInterfaces=qs;function ss(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 te[n]&&te[n].ms?(l.ms=Date.now()-te[n].ms,l.rx_sec=t-te[n].rx_bytes>=0?(t-te[n].rx_bytes)/(l.ms/1e3):0,l.tx_sec=e-te[n].tx_bytes>=0?(e-te[n].tx_bytes)/(l.ms/1e3):0,te[n].rx_bytes=t,te[n].tx_bytes=e,te[n].rx_sec=l.rx_sec,te[n].tx_sec=l.tx_sec,te[n].ms=Date.now(),te[n].last_ms=l.ms,te[n].operstate=r):(te[n]||(te[n]={}),te[n].rx_bytes=t,te[n].tx_bytes=e,te[n].rx_sec=null,te[n].tx_sec=null,te[n].ms=Date.now(),te[n].last_ms=0,te[n].operstate=r),l}function Fo(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(P.isFunction(n)&&!t)t=n,e=[gn()];else{if(typeof n!="string"&&n!==void 0)return t&&t([]),r([]);n=n||gn();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=[],qs(!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(hp(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function hp(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(!te[r]||te[r]&&!te[r].ms||te[r]&&te[r].ms&&Date.now()-te[r].ms>=500){if(lt&&(Xu.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; ",be(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=ss(r,l,c,a,u,p,d,f)),e(o)})):e(o)),(Mt||bt||Dt)&&(m="netstat -ibndI "+r,be(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=ss(r,l,c,a,u,p,d,f)}e(o)})),ct&&(m="ifconfig "+r+' | grep "status"',be(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,be(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=Ip(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))})})}ls.wifiInterfaces=Op});var $o=ae(ps=>{"use strict";var us=k("os"),Ep=k("fs"),Pp=k("path"),hr=k("child_process").exec,Js=k("child_process").execSync,F=pe(),Vt=process.platform,tt=Vt==="linux"||Vt==="android",xn=Vt==="darwin",Qs=Vt==="win32",gr=Vt==="freebsd",yr=Vt==="openbsd",xr=Vt==="netbsd",cs=Vt==="sunos",ye={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:{}},Pe={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 Ap(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 Tp(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{F.noop()}return p}function Mp(n,t){return F.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=F.stringToLower,r.__proto__.replace=F.stringReplace,r.__proto__.toString=F.stringToString,r.__proto__.substr=F.stringSubstr,r.__proto__.substring=F.stringSubstring,r.__proto__.trim=F.stringTrim,r.__proto__.startsWith=F.stringStartWith}catch{Object.setPrototypeOf(r,F.stringObj)}let i=F.sanitizeShellString(n),s=F.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="*"),F.isPrototypePolluted()&&r!=="*"&&(r="------");let o=r.split("|"),a=[],l=[];if(tt||gr||yr||xr||xn){if((tt||gr||yr||xr)&&r==="*")try{let u=Js("systemctl --all --type=service --no-legend 2> /dev/null",F.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=Ip(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))})})}ls.wifiInterfaces=Op});var $o=ae(ps=>{"use strict";var us=k("os"),Ep=k("fs"),Pp=k("path"),hr=k("child_process").exec,Js=k("child_process").execSync,F=pe(),Vt=process.platform,tt=Vt==="linux"||Vt==="android",xn=Vt==="darwin",Qs=Vt==="win32",gr=Vt==="freebsd",yr=Vt==="openbsd",xr=Vt==="netbsd",cs=Vt==="sunos",ye={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:{}},Pe={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 Ap(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 Tp(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{F.noop()}return p}function Mp(n,t){return F.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=F.stringToLower,r.__proto__.replace=F.stringReplace,r.__proto__.toString=F.stringToString,r.__proto__.substr=F.stringSubstr,r.__proto__.substring=F.stringSubstring,r.__proto__.trim=F.stringTrim,r.__proto__.startsWith=F.stringStartWith}catch{Object.setPrototypeOf(r,F.stringObj)}let i=F.sanitizeShellString(n),s=F.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="*"),F.isPrototypePolluted()&&r!=="*"&&(r="------");let o=r.split("|"),a=[],l=[];if(tt||gr||yr||xr||xn){if((tt||gr||yr||xr)&&r==="*")try{let u=Js("systemctl --all --type=service --no-legend 2> /dev/null",F.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=Js("service --status-all 2> /dev/null",F.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=Js("ls /etc/init.d/ -m 2> /dev/null",F.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=[]}}}xn&&r==="*"&&(t&&t(a),e(a));let c=xn?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];r!==""&&o.length>0?F.execSafe("ps",c).then(u=>{if(u){let p=u.replace(/ +/g," ").replace(/,+/g,".").split(`
307
307
  `);if(o.forEach(function(d){let f;xn?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))})}),tt){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";hr(d,{maxBuffer:1024*2e4},function(f,m){let g=m.toString().split(`
308
- `),x=ei(g.shift()),h={},y={};g.forEach(S=>{if(y=ti(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"],F.execSafe("ps",c).then(p=>{if(p){let d=p.replace(/ +/g," ").replace(/,+/g,".").split(`
308
+ `),x=ei(g.shift()),h={},y={};g.forEach(S=>{if(y=ti(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"],F.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(Qs)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",F.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=F.getValue(m,"Name",":",!0).toLowerCase(),x=F.getValue(m,"Caption",":",!0).toLowerCase(),h=F.getValue(m,"Started",":",!0),y=F.getValue(m,"StartMode",":",!0),S=F.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([])})})}ps.services=Mp;function ei(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 ti(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 bp(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(Q){a=l,t[Q]?l=o.substring(t[Q].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=cs?Ap(o.substring(t[8].from+a,t[8].to+l).trim()):Tp(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="",ee="",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 Q=E.indexOf("("),z=E.indexOf(")"),ue=E.indexOf("/"),me=E.indexOf(":");if(Q<z&&Q<ue&&ue<z)T=E.split(" ")[0],T=T.replace(/:/g,"");else if(me>0&&(ue===-1||ue>3))T=E.split(" ")[0],T=T.replace(/:/g,"");else{let _e=E.indexOf(" -"),Z=E.indexOf(" /");_e=_e>=0?_e:1e4,Z=Z>=0?Z:1e4;let Ce=Math.min(_e,Z),he=E.substr(0,Ce),De=E.substr(Ce),Ae=he.lastIndexOf("/");if(Ae>=0&&(D=he.substr(0,Ae),he=he.substr(Ae+1)),Ce===1e4&&he.indexOf(" ")>-1){let ie=he.split(" ");Ep.existsSync(Pp.join(D,ie[0]))?(T=ie.shift(),ee=(ie.join(" ")+" "+De).trim()):(T=he.trim(),ee=De.trim())}else T=he.trim(),ee=De.trim()}}return{pid:u,parentPid:p,name:tt?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:ee,path:D}}function i(o){let a=[];if(o.length>1){let l=o[0];t=F.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/us.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(ye.ms&&Date.now()-ye.ms>=500||ye.ms===0)if(tt||gr||yr||xr||xn||cs)tt&&(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"),(gr||yr||xr)&&(l="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"),xn&&(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"),cs&&(l="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),hr(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,tt?(l='cat /proc/stat | grep "cpu "',a.list.forEach(p=>{l+=";cat /proc/"+p.pid+"/stat"}),hr(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=si});var aa=ae(Wt=>{"use strict";var le=pe(),Gt=ia(),Jp=process.platform,Qp=Jp==="win32",jn={},ce,ii=0;function e0(n){return new Promise(t=>{process.nextTick(()=>{ce||(ce=new Gt);let e={};ce.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)})})})}Wt.dockerInfo=e0;function t0(n,t){le.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(()=>{ce||(ce=new Gt);let i=[];ce.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(n0(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 n0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();r?(ce||(ce=new Gt),ce.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()})})}Wt.dockerImages=t0;function oi(n,t){function e(i,s){return i.filter(a=>a.Id&&a.Id===s).length>0}le.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(()=>{ce||(ce=new Gt);let s=[];ce.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(r0(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 r0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();r?(ce||(ce=new Gt),ce.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()})})}Wt.dockerContainers=oi;function s0(n,t){if(Qp){let e=le.nanoSeconds(),r=0;if(ii>0){let i=e-ii,s=n.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(r=100*s/i)}return ii=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 i0(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 o0(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 ai(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(le.isFunction(n)&&!t)t=n,e=["*"];else{if(n=n||"*",typeof n!="string")return t&&t([]),r([]);let o="";try{o.__proto__.toLowerCase=le.stringToLower,o.__proto__.replace=le.stringReplace,o.__proto__.toString=le.stringToString,o.__proto__.substr=le.stringSubstr,o.__proto__.substring=le.stringSubstring,o.__proto__.trim=le.stringTrim,o.__proto__.startsWith=le.stringStartWith}catch{Object.setPrototypeOf(o,le.stringObj)}if(o=n,o=o.trim(),o!=="*"){o="";let a=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim(),l=le.mathMin(a.length,2e3);for(let c=0;c<=l;c++)if(a[c]!==void 0){a[c].__proto__.toLowerCase=le.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=[],oi().then(o=>{for(let a of o)e.push(a.id.substring(0,12));e.length?ai(e.join(",")).then(a=>{t&&t(a),r(a)}):(t&&t(i),r(i))});else{for(let o of e)s.push(a0(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function a0(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?(ce||(ce=new Gt),ce.getInspect(n,r=>{try{ce.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?s0(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=i0(s.networks)),s.blkio_stats&&(t.blockIO=o0(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{le.noop()}e(t)})}catch{le.noop()}})):e(t)})})}Wt.dockerContainerStats=ai;function oa(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return r(e);let i=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();i?(ce||(ce=new Gt),ce.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{le.noop()}t&&t(e),r(e)})):(t&&t(e),r(e))})})}Wt.dockerContainerProcesses=oa;function l0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{ce||(ce=new Gt),ce.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)}})})})}Wt.dockerVolumes=l0;function c0(n){return new Promise(t=>{process.nextTick(()=>{oi(!0).then(e=>{if(e&&Object.prototype.toString.call(e)==="[object Array]"&&e.length>0){let r=e.length;e.forEach(function(i){ai(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)})})})}Wt.dockerAll=c0});var ca=ae(la=>{"use strict";var li=k("os"),u0=k("child_process").exec,ne=pe();function p0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{try{u0(ne.getVboxmanage()+" list vms --long",function(r,i){let s=(li.EOL+i.toString()).split(li.EOL+"Name:");s.shift(),s.forEach(o=>{let a=("Name:"+o).split(li.EOL),l=ne.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{ne.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{ne.noop()}t.push({id:ne.getValue(a,"UUID"),name:ne.getValue(a,"Name"),running:c,started:u,runningSince:p,stopped:d,stoppedSince:f,guestOS:ne.getValue(a,"Guest OS"),hardwareUUID:ne.getValue(a,"Hardware UUID"),memory:parseInt(ne.getValue(a,"Memory size"," "),10),vram:parseInt(ne.getValue(a,"VRAM size"),10),cpus:parseInt(ne.getValue(a,"Number of CPUs"),10),cpuExepCap:ne.getValue(a,"CPU exec cap"),cpuProfile:ne.getValue(a,"CPUProfile"),chipset:ne.getValue(a,"Chipset"),firmware:ne.getValue(a,"Firmware"),pageFusion:ne.getValue(a,"Page Fusion")==="enabled",configFile:ne.getValue(a,"Config file"),snapshotFolder:ne.getValue(a,"Snapshot folder"),logFolder:ne.getValue(a,"Log folder"),hpet:ne.getValue(a,"HPET")==="enabled",pae:ne.getValue(a,"PAE")==="enabled",longMode:ne.getValue(a,"Long Mode")==="enabled",tripleFaultReset:ne.getValue(a,"Triple Fault Reset")==="enabled",apic:ne.getValue(a,"APIC")==="enabled",x2Apic:ne.getValue(a,"X2APIC")==="enabled",acpi:ne.getValue(a,"ACPI")==="enabled",ioApic:ne.getValue(a,"IOAPIC")==="enabled",biosApicMode:ne.getValue(a,"BIOS APIC mode"),bootMenuMode:ne.getValue(a,"Boot menu mode"),bootDevice1:ne.getValue(a,"Boot Device 1"),bootDevice2:ne.getValue(a,"Boot Device 2"),bootDevice3:ne.getValue(a,"Boot Device 3"),bootDevice4:ne.getValue(a,"Boot Device 4"),timeOffset:ne.getValue(a,"Time offset"),rtc:ne.getValue(a,"RTC")})}),n&&n(t),e(t)})}catch{n&&n(t),e(t)}})})}la.vboxInfo=p0});var fa=ae(da=>{"use strict";var ci=k("child_process").exec,Se=pe(),Ut=process.platform,ua=Ut==="linux"||Ut==="android",d0=Ut==="darwin",f0=Ut==="win32",m0=Ut==="freebsd",h0=Ut==="openbsd",g0=Ut==="netbsd",y0=Ut==="sunos",pa={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function x0(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 S0(n){let t={},e=Se.getValue(n,"PrinterId"," ");return t.id=e?parseInt(e,10):null,t.name=Se.getValue(n,"Info"," "),t.model=n.length>0&&n[0]?n[0].split(" ")[0]:"",t.uri=Se.getValue(n,"DeviceURI"," "),t.uuid=Se.getValue(n,"UUID"," "),t.status=Se.getValue(n,"State"," "),t.local=Se.getValue(n,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=Se.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),t}function _0(n,t){let e={};return e.id=t,e.name=Se.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=Se.getValue(n,"Location",":",!0).toLowerCase().startsWith("local"),e.default=null,e.shared=Se.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),e}function C0(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 v0(n,t){let e={},r=parseInt(Se.getValue(n,"PrinterStatus",":"),10);return e.id=t,e.name=Se.getValue(n,"name",":"),e.model=Se.getValue(n,"DriverName",":"),e.uri=null,e.uuid=null,e.status=pa[r]?pa[r]:null,e.local=Se.getValue(n,"Local",":").toUpperCase()==="TRUE",e.default=Se.getValue(n,"Default",":").toUpperCase()==="TRUE",e.shared=Se.getValue(n,"Shared",":").toUpperCase()==="TRUE",e}function w0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(ua||m0||h0||g0){let r="cat /etc/cups/printers.conf 2>/dev/null";ci(r,function(i,s){if(!i){let o=s.toString().split("<Printer "),a=x0(o[0]);for(let l=1;l<o.length;l++){let c=S0(o[l].split(`
363
+ `);r=r.substring(s+4),e=!1;try{i=JSON.parse(r),t(i)}catch{t({})}})}catch{t({})}}};sa.exports=si});var aa=ae(Wt=>{"use strict";var le=pe(),Gt=ia(),Jp=process.platform,Qp=Jp==="win32",qn={},ce,ii=0;function e0(n){return new Promise(t=>{process.nextTick(()=>{ce||(ce=new Gt);let e={};ce.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)})})})}Wt.dockerInfo=e0;function t0(n,t){le.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(()=>{ce||(ce=new Gt);let i=[];ce.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(n0(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 n0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();r?(ce||(ce=new Gt),ce.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()})})}Wt.dockerImages=t0;function oi(n,t){function e(i,s){return i.filter(a=>a.Id&&a.Id===s).length>0}le.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(()=>{ce||(ce=new Gt);let s=[];ce.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(r0(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 r0(n,t){return new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return e();let r=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();r?(ce||(ce=new Gt),ce.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()})})}Wt.dockerContainers=oi;function s0(n,t){if(Qp){let e=le.nanoSeconds(),r=0;if(ii>0){let i=e-ii,s=n.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(r=100*s/i)}return ii=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 i0(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 o0(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 ai(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(le.isFunction(n)&&!t)t=n,e=["*"];else{if(n=n||"*",typeof n!="string")return t&&t([]),r([]);let o="";try{o.__proto__.toLowerCase=le.stringToLower,o.__proto__.replace=le.stringReplace,o.__proto__.toString=le.stringToString,o.__proto__.substr=le.stringSubstr,o.__proto__.substring=le.stringSubstring,o.__proto__.trim=le.stringTrim,o.__proto__.startsWith=le.stringStartWith}catch{Object.setPrototypeOf(o,le.stringObj)}if(o=n,o=o.trim(),o!=="*"){o="";let a=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim(),l=le.mathMin(a.length,2e3);for(let c=0;c<=l;c++)if(a[c]!==void 0){a[c].__proto__.toLowerCase=le.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=[],oi().then(o=>{for(let a of o)e.push(a.id.substring(0,12));e.length?ai(e.join(",")).then(a=>{t&&t(a),r(a)}):(t&&t(i),r(i))});else{for(let o of e)s.push(a0(o.trim()));s.length?Promise.all(s).then(o=>{t&&t(o),r(o)}):(t&&t(i),r(i))}})})}function a0(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?(ce||(ce=new Gt),ce.getInspect(n,r=>{try{ce.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?s0(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=i0(s.networks)),s.blkio_stats&&(t.blockIO=o0(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{le.noop()}e(t)})}catch{le.noop()}})):e(t)})})}Wt.dockerContainerStats=ai;function oa(n,t){let e=[];return new Promise(r=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return r(e);let i=(le.isPrototypePolluted()?"":le.sanitizeShellString(n,!0)).trim();i?(ce||(ce=new Gt),ce.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{le.noop()}t&&t(e),r(e)})):(t&&t(e),r(e))})})}Wt.dockerContainerProcesses=oa;function l0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{ce||(ce=new Gt),ce.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)}})})})}Wt.dockerVolumes=l0;function c0(n){return new Promise(t=>{process.nextTick(()=>{oi(!0).then(e=>{if(e&&Object.prototype.toString.call(e)==="[object Array]"&&e.length>0){let r=e.length;e.forEach(function(i){ai(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)})})})}Wt.dockerAll=c0});var ca=ae(la=>{"use strict";var li=k("os"),u0=k("child_process").exec,ne=pe();function p0(n){let t=[];return new Promise(e=>{process.nextTick(()=>{try{u0(ne.getVboxmanage()+" list vms --long",function(r,i){let s=(li.EOL+i.toString()).split(li.EOL+"Name:");s.shift(),s.forEach(o=>{let a=("Name:"+o).split(li.EOL),l=ne.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{ne.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{ne.noop()}t.push({id:ne.getValue(a,"UUID"),name:ne.getValue(a,"Name"),running:c,started:u,runningSince:p,stopped:d,stoppedSince:f,guestOS:ne.getValue(a,"Guest OS"),hardwareUUID:ne.getValue(a,"Hardware UUID"),memory:parseInt(ne.getValue(a,"Memory size"," "),10),vram:parseInt(ne.getValue(a,"VRAM size"),10),cpus:parseInt(ne.getValue(a,"Number of CPUs"),10),cpuExepCap:ne.getValue(a,"CPU exec cap"),cpuProfile:ne.getValue(a,"CPUProfile"),chipset:ne.getValue(a,"Chipset"),firmware:ne.getValue(a,"Firmware"),pageFusion:ne.getValue(a,"Page Fusion")==="enabled",configFile:ne.getValue(a,"Config file"),snapshotFolder:ne.getValue(a,"Snapshot folder"),logFolder:ne.getValue(a,"Log folder"),hpet:ne.getValue(a,"HPET")==="enabled",pae:ne.getValue(a,"PAE")==="enabled",longMode:ne.getValue(a,"Long Mode")==="enabled",tripleFaultReset:ne.getValue(a,"Triple Fault Reset")==="enabled",apic:ne.getValue(a,"APIC")==="enabled",x2Apic:ne.getValue(a,"X2APIC")==="enabled",acpi:ne.getValue(a,"ACPI")==="enabled",ioApic:ne.getValue(a,"IOAPIC")==="enabled",biosApicMode:ne.getValue(a,"BIOS APIC mode"),bootMenuMode:ne.getValue(a,"Boot menu mode"),bootDevice1:ne.getValue(a,"Boot Device 1"),bootDevice2:ne.getValue(a,"Boot Device 2"),bootDevice3:ne.getValue(a,"Boot Device 3"),bootDevice4:ne.getValue(a,"Boot Device 4"),timeOffset:ne.getValue(a,"Time offset"),rtc:ne.getValue(a,"RTC")})}),n&&n(t),e(t)})}catch{n&&n(t),e(t)}})})}la.vboxInfo=p0});var fa=ae(da=>{"use strict";var ci=k("child_process").exec,Se=pe(),Ut=process.platform,ua=Ut==="linux"||Ut==="android",d0=Ut==="darwin",f0=Ut==="win32",m0=Ut==="freebsd",h0=Ut==="openbsd",g0=Ut==="netbsd",y0=Ut==="sunos",pa={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function x0(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 S0(n){let t={},e=Se.getValue(n,"PrinterId"," ");return t.id=e?parseInt(e,10):null,t.name=Se.getValue(n,"Info"," "),t.model=n.length>0&&n[0]?n[0].split(" ")[0]:"",t.uri=Se.getValue(n,"DeviceURI"," "),t.uuid=Se.getValue(n,"UUID"," "),t.status=Se.getValue(n,"State"," "),t.local=Se.getValue(n,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=Se.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),t}function _0(n,t){let e={};return e.id=t,e.name=Se.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=Se.getValue(n,"Location",":",!0).toLowerCase().startsWith("local"),e.default=null,e.shared=Se.getValue(n,"Shared"," ").toLowerCase().startsWith("yes"),e}function C0(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 v0(n,t){let e={},r=parseInt(Se.getValue(n,"PrinterStatus",":"),10);return e.id=t,e.name=Se.getValue(n,"name",":"),e.model=Se.getValue(n,"DriverName",":"),e.uri=null,e.uuid=null,e.status=pa[r]?pa[r]:null,e.local=Se.getValue(n,"Local",":").toUpperCase()==="TRUE",e.default=Se.getValue(n,"Default",":").toUpperCase()==="TRUE",e.shared=Se.getValue(n,"Shared",":").toUpperCase()==="TRUE",e}function w0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(ua||m0||h0||g0){let r="cat /etc/cups/printers.conf 2>/dev/null";ci(r,function(i,s){if(!i){let o=s.toString().split("<Printer "),a=x0(o[0]);for(let l=1;l<o.length;l++){let c=S0(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",ci(r,function(o,a){let l=(`
365
365
  `+a.toString()).split(`
366
366
  printer `);for(let c=1;c<l.length;c++){let u=_0(l[c].split(`
@@ -385,4 +385,4 @@ Bus `);for(let a=1;a<o.length;a++){let l=b0(o[a]);e.push(l)}}n&&n(e),t(e)}),L0&&
385
385
  `),"PNPClass",":")==="Bluetooth"&&e.push(fd(o.split(`
386
386
  `)))}),n&&n(e),t(e)}),(od||ld||ad||cd)&&t(null)})})}va.bluetoothDevices=md});var Ma=ae(B=>{"use strict";var hd=ki().version,Kt=pe(),qt=eo(),dt=no(),je=lo(),fs=So(),Ia=vo(),La=Eo(),rt=bo(),ft=Go(),ms=jo(),wr=$o(),Oa=Zo(),fi=ra(),Sn=aa(),gd=ca(),yd=fa(),xd=ga(),Sd=Sa(),_d=wa(),Ir=process.platform,ds=Ir==="win32",_r=Ir==="freebsd",Cr=Ir==="openbsd",vr=Ir==="netbsd",nt=Ir==="sunos";ds&&(Kt.getCodepage(),Kt.getPowershell());function Ea(){return hd}function Pa(n){return new Promise(t=>{process.nextTick(()=>{let e={};e.version=Ea(),Promise.all([qt.system(),qt.bios(),qt.baseboard(),qt.chassis(),dt.osInfo(),dt.uuid(),dt.versions(),je.cpu(),je.cpuFlags(),La.graphics(),ft.networkInterfaces(),fs.memLayout(),rt.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 Kt.isFunction(t)&&(e=t,t=""),Kt.isFunction(n)&&(e=n,n=""),new Promise(r=>{process.nextTick(()=>{t=t||ft.getDefaultNetworkInterface(),n=n||"";let i=function(){let o=15;return ds&&(o=13),(_r||Cr||vr)&&(o=11),nt&&(o=6),function(){--o===0&&(e&&e(s),r(s))}}(),s={};s.time=dt.time(),s.node=process.versions.node,s.v8=process.versions.v8,je.cpuCurrentSpeed().then(o=>{s.cpuCurrentSpeed=o,i()}),Oa.users().then(o=>{s.users=o,i()}),wr.processes().then(o=>{s.processes=o,i()}),je.currentLoad().then(o=>{s.currentLoad=o,i()}),nt||je.cpuTemperature().then(o=>{s.temp=o,i()}),!Cr&&!_r&&!vr&&!nt&&ft.networkStats(t).then(o=>{s.networkStats=o,i()}),nt||ft.networkConnections().then(o=>{s.networkConnections=o,i()}),fs.mem().then(o=>{s.mem=o,i()}),nt||Ia().then(o=>{s.battery=o,i()}),nt||wr.services(n).then(o=>{s.services=o,i()}),nt||rt.fsSize().then(o=>{s.fsSize=o,i()}),!ds&&!Cr&&!_r&&!vr&&!nt&&rt.fsStats().then(o=>{s.fsStats=o,i()}),!ds&&!Cr&&!_r&&!vr&&!nt&&rt.disksIO().then(o=>{s.disksIO=o,i()}),!Cr&&!_r&&!vr&&!nt&&ms.wifiNetworks().then(o=>{s.wifiNetworks=o,i()}),fi.inetLatency().then(o=>{s.inetLatency=o,i()})})})}function Cd(n,t,e){return new Promise(r=>{process.nextTick(()=>{let i={};t&&Kt.isFunction(t)&&!e&&(e=t,t=""),n&&Kt.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(B,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?B[o](s):B[o]("")});Promise.all(r).then(i=>{let s={},o=0;for(let a in n)if({}.hasOwnProperty.call(n,a)&&{}.hasOwnProperty.call(B,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 vd(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)}B.version=Ea;B.system=qt.system;B.bios=qt.bios;B.baseboard=qt.baseboard;B.chassis=qt.chassis;B.time=dt.time;B.osInfo=dt.osInfo;B.versions=dt.versions;B.shell=dt.shell;B.uuid=dt.uuid;B.cpu=je.cpu;B.cpuFlags=je.cpuFlags;B.cpuCache=je.cpuCache;B.cpuCurrentSpeed=je.cpuCurrentSpeed;B.cpuTemperature=je.cpuTemperature;B.currentLoad=je.currentLoad;B.fullLoad=je.fullLoad;B.mem=fs.mem;B.memLayout=fs.memLayout;B.battery=Ia;B.graphics=La.graphics;B.fsSize=rt.fsSize;B.fsOpenFiles=rt.fsOpenFiles;B.blockDevices=rt.blockDevices;B.fsStats=rt.fsStats;B.disksIO=rt.disksIO;B.diskLayout=rt.diskLayout;B.networkInterfaceDefault=ft.networkInterfaceDefault;B.networkGatewayDefault=ft.networkGatewayDefault;B.networkInterfaces=ft.networkInterfaces;B.networkStats=ft.networkStats;B.networkConnections=ft.networkConnections;B.wifiNetworks=ms.wifiNetworks;B.wifiInterfaces=ms.wifiInterfaces;B.wifiConnections=ms.wifiConnections;B.services=wr.services;B.processes=wr.processes;B.processLoad=wr.processLoad;B.users=Oa.users;B.inetChecksite=fi.inetChecksite;B.inetLatency=fi.inetLatency;B.dockerInfo=Sn.dockerInfo;B.dockerImages=Sn.dockerImages;B.dockerContainers=Sn.dockerContainers;B.dockerContainerStats=Sn.dockerContainerStats;B.dockerContainerProcesses=Sn.dockerContainerProcesses;B.dockerVolumes=Sn.dockerVolumes;B.dockerAll=Sn.dockerAll;B.vboxInfo=gd.vboxInfo;B.printer=yd.printer;B.usb=xd.usb;B.audio=Sd.audio;B.bluetoothDevices=_d.bluetoothDevices;B.getStaticData=Pa;B.getDynamicData=Aa;B.getAllData=Cd;B.get=Ta;B.observe=vd;B.powerShellStart=Kt.powerShellStart;B.powerShellRelease=Kt.powerShellRelease});var Da=ae((Df,wd)=>{wd.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=ae((Nf,mt)=>{var mi=k("fs"),hi=k("path"),Id=k("os"),Ld=k("crypto"),Od=Da(),gi=Od.version,Ed=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Pd(n){let t={},e=n.toString();e=e.replace(/\r\n?/mg,`
387
387
  `);let r;for(;(r=Ed.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 Ad(n){let t=ka(n),e=xe.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=bd(e,a);s=xe.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=i)throw a}return xe.parse(s)}function Td(n){console.log(`[dotenv@${gi}][INFO] ${n}`)}function Md(n){console.log(`[dotenv@${gi}][WARN] ${n}`)}function gs(n){console.log(`[dotenv@${gi}][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 bd(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)mi.existsSync(e)&&(t=e.endsWith(".vault")?e:`${e}.vault`);else t=n.path.endsWith(".vault")?n.path:`${n.path}.vault`;else t=hi.resolve(process.cwd(),".env.vault");return mi.existsSync(t)?t:null}function Na(n){return n[0]==="~"?hi.join(Id.homedir(),n.slice(1)):n}function Dd(n){Td("Loading env from encrypted .env.vault");let t=xe._parseVault(n),e=process.env;return n&&n.processEnv!=null&&(e=n.processEnv),xe.populate(e,t,n),{parsed:t}}function Nd(n){let t=hi.resolve(process.cwd(),".env"),e="utf8",r=!!(n&&n.debug);n&&n.encoding?e=n.encoding:r&&gs("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=xe.parse(mi.readFileSync(l,{encoding:e}));xe.populate(o,c,n)}catch(c){r&&gs(`Failed to load ${l} ${c.message}`),s=c}let a=process.env;return n&&n.processEnv!=null&&(a=n.processEnv),xe.populate(a,o,n),s?{parsed:o,error:s}:{parsed:o}}function Vd(n){if(Va(n).length===0)return xe.configDotenv(n);let t=ka(n);return t?xe._configVault(n):(Md(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),xe.configDotenv(n))}function kd(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=Ld.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 Bd(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&&gs(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):n[s]=t[s]}var xe={configDotenv:Nd,_configVault:Dd,_parseVault:Ad,config:Vd,decrypt:kd,parse:Pd,populate:Bd};mt.exports.configDotenv=xe.configDotenv;mt.exports._configVault=xe._configVault;mt.exports._parseVault=xe._parseVault;mt.exports.config=xe.config;mt.exports.decrypt=xe.decrypt;mt.exports.parse=xe.parse;mt.exports.populate=xe.populate;mt.exports=xe});var re;(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})(re||(re={}));var Ss;(function(n){n.mergeShapes=(t,e)=>({...t,...e})})(Ss||(Ss={}));var N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),it=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=re.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"]),ja=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),Te=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,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},r=[];for(let i of this.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}};Te.create=n=>new Te(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,re.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:e=`Unrecognized key(s) in object: ${re.joinValues(n.keys,", ")}`;break;case L.invalid_union:e="Invalid input";break;case L.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${re.joinValues(n.options)}`;break;case L.invalid_enum_value:e=`Invalid enum value. Expected ${re.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}"`:re.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,re.assertNever(n)}return{message:e}},vi=vn;function qa(n){vi=n}function Or(){return vi}var Er=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}},Ka=[];function b(n,t){let e=Or(),r=Er({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 ve=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 q;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let 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 q;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}}},q=Object.freeze({status:"aborted"}),Cn=n=>({status:"dirty",value:n}),Ie=n=>({status:"valid",value:n}),_s=n=>n.status==="aborted",Cs=n=>n.status==="dirty",$t=n=>n.status==="valid",$n=n=>typeof Promise<"u"&&n instanceof Promise;function Pr(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 R;(function(n){n.errToObj=t=>typeof t=="string"?{message:t}:t||{},n.toString=t=>typeof t=="string"?t:t?.message})(R||(R={}));var qn,Kn,Ve=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($t(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 Te(n.common.issues);return this._error=e,this._error}}};function $(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 Y=class{get description(){return this._def.description}_getType(t){return it(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:it(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ve,ctx:{common:t.parent.common,data:t.data,parsedType:it(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if($n(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:it(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:it(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:i});return $t(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=>$t(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:it(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await($n(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 Me({schema:this,typeName:j.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 Ne.create(this,this._def)}nullable(){return Qe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this)}promise(){return yt.create(this,this._def)}or(t){return tn.create([this,t],this._def)}and(t){return nn.create(this,t,this._def)}transform(t){return new Me({...$(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new ln({...$(this._def),innerType:this,defaultValue:e,typeName:j.ZodDefault})}brand(){return new Yn({typeName:j.ZodBranded,type:this,...$(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new cn({...$(this._def),innerType:this,catchValue:e,typeName:j.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Xn.create(this,t)}readonly(){return un.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$a=/^c[^\s-]{8,}$/i,Ya=/^[0-9a-z]+$/,Xa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Za=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ja=/^[a-z0-9_-]{21}$/i,Qa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,el=/^[-+]?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)?)??$/,tl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xs,rl=/^(?:(?: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])$/,sl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,il=/^(([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]))$/,ol=/^(([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])$/,al=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ll=/^([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])))",cl=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 ul(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 pl(n,t){return!!((t==="v4"||!t)&&rl.test(n)||(t==="v6"||!t)&&il.test(n))}function dl(n,t){if(!Qa.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 fl(n,t){return!!((t==="v4"||!t)&&sl.test(n)||(t==="v6"||!t)&&ol.test(n))}var ht=class n extends Y{_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}),q}let r=new ve,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")tl.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")xs||(xs=new RegExp(nl,"u")),xs.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")Za.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")Ja.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")$a.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")Ya.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")Xa.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"?cl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?ul(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"?el.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"duration",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?pl(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"?dl(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"?fl(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"?al.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?ll.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64url",code:L.invalid_string,message:s.message}),r.dirty()):re.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,...R.errToObj(r)})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.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,...R.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,...R.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...R.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...R.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...R.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...R.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...R.errToObj(e)})}nonempty(t){return this.min(1,R.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}};ht.create=n=>{var t;return new ht({checks:[],typeName:j.ZodString,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...$(n)})};function ml(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 Yt=class n extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N.number){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_type,expected:N.number,received:s.parsedType}),q}let r,i=new ve;for(let s of this._def.checks)s.kind==="int"?re.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"?ml(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()):re.assertNever(s);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,R.toString(e))}gt(t,e){return this.setLimit("min",t,!1,R.toString(e))}lte(t,e){return this.setLimit("max",t,!0,R.toString(e))}lt(t,e){return this.setLimit("max",t,!1,R.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&re.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)}};Yt.create=n=>new Yt({checks:[],typeName:j.ZodNumber,coerce:n?.coerce||!1,...$(n)});var Xt=class n extends Y{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 ve;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()):re.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}),q}gte(t,e){return this.setLimit("min",t,!0,R.toString(e))}gt(t,e){return this.setLimit("min",t,!1,R.toString(e))}lte(t,e){return this.setLimit("max",t,!0,R.toString(e))}lt(t,e){return this.setLimit("max",t,!1,R.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:R.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:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:R.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}};Xt.create=n=>{var t;return new Xt({checks:[],typeName:j.ZodBigInt,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...$(n)})};var Zt=class extends Y{_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}),q}return Ie(t.data)}};Zt.create=n=>new Zt({typeName:j.ZodBoolean,coerce:n?.coerce||!1,...$(n)});var Jt=class n extends Y{_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}),q}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_date}),q}let r=new ve,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()):re.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:R.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:R.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}};Jt.create=n=>new Jt({checks:[],coerce:n?.coerce||!1,typeName:j.ZodDate,...$(n)});var wn=class extends Y{_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}),q}return Ie(t.data)}};wn.create=n=>new wn({typeName:j.ZodSymbol,...$(n)});var Qt=class extends Y{_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}),q}return Ie(t.data)}};Qt.create=n=>new Qt({typeName:j.ZodUndefined,...$(n)});var en=class extends Y{_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}),q}return Ie(t.data)}};en.create=n=>new en({typeName:j.ZodNull,...$(n)});var gt=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return Ie(t.data)}};gt.create=n=>new gt({typeName:j.ZodAny,...$(n)});var ot=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ie(t.data)}};ot.create=n=>new ot({typeName:j.ZodUnknown,...$(n)});var qe=class extends Y{_parse(t){let e=this._getOrReturnCtx(t);return b(e,{code:L.invalid_type,expected:N.never,received:e.parsedType}),q}};qe.create=n=>new qe({typeName:j.ZodNever,...$(n)});var In=class extends Y{_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}),q}return Ie(t.data)}};In.create=n=>new In({typeName:j.ZodVoid,...$(n)});var at=class n extends Y{_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}),q;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 Ve(e,o,e.path,a)))).then(o=>ve.mergeArray(r,o));let s=[...e.data].map((o,a)=>i.type._parseSync(new Ve(e,o,e.path,a)));return ve.mergeArray(r,s)}get element(){return this._def.type}min(t,e){return new n({...this._def,minLength:{value:t,message:R.toString(e)}})}max(t,e){return new n({...this._def,maxLength:{value:t,message:R.toString(e)}})}length(t,e){return new n({...this._def,exactLength:{value:t,message:R.toString(e)}})}nonempty(t){return this.min(1,t)}};at.create=(n,t)=>new at({type:n,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...$(t)});function _n(n){if(n instanceof Ee){let t={};for(let e in n.shape){let r=n.shape[e];t[e]=Ne.create(_n(r))}return new Ee({...n._def,shape:()=>t})}else return n instanceof at?new at({...n._def,type:_n(n.element)}):n instanceof Ne?Ne.create(_n(n.unwrap())):n instanceof Qe?Qe.create(_n(n.unwrap())):n instanceof Je?Je.create(n.items.map(t=>_n(t))):n}var Ee=class n extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=re.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}),q}let{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof qe&&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 Ve(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof qe){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 Ve(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=>ve.mergeObjectSync(r,c)):ve.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return R.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=R.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:j.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new n({...this._def,catchall:t})}pick(t){let e={};return re.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 re.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 re.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 re.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])e[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ne;)s=s._def.innerType;e[r]=s}}),new n({...this._def,shape:()=>e})}keyof(){return Ei(re.objectKeys(this.shape))}};Ee.create=(n,t)=>new Ee({shape:()=>n,unknownKeys:"strip",catchall:qe.create(),typeName:j.ZodObject,...$(t)});Ee.strictCreate=(n,t)=>new Ee({shape:()=>n,unknownKeys:"strict",catchall:qe.create(),typeName:j.ZodObject,...$(t)});Ee.lazycreate=(n,t)=>new Ee({shape:n,unknownKeys:"strip",catchall:qe.create(),typeName:j.ZodObject,...$(t)});var tn=class extends Y{_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 Te(a.ctx.common.issues));return b(e,{code:L.invalid_union,unionErrors:o}),q}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 Te(l));return b(e,{code:L.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}};tn.create=(n,t)=>new tn({options:n,typeName:j.ZodUnion,...$(t)});var st=n=>n instanceof rn?st(n.schema):n instanceof Me?st(n.innerType()):n instanceof sn?[n.value]:n instanceof on?n.options:n instanceof an?re.objectValues(n.enum):n instanceof ln?st(n._def.innerType):n instanceof Qt?[void 0]:n instanceof en?[null]:n instanceof Ne?[void 0,...st(n.unwrap())]:n instanceof Qe?[null,...st(n.unwrap())]:n instanceof Yn||n instanceof un?st(n.unwrap()):n instanceof cn?st(n._def.innerType):[],Ar=class n extends Y{_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}),q;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]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let s of e){let o=st(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:j.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...$(r)})}};function vs(n,t){let e=it(n),r=it(t);if(n===t)return{valid:!0,data:n};if(e===N.object&&r===N.object){let i=re.objectKeys(t),s=re.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...t};for(let a of s){let l=vs(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=vs(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 nn=class extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(_s(s)||_s(o))return q;let a=vs(s.value,o.value);return a.valid?((Cs(s)||Cs(o))&&e.dirty(),{status:e.value,value:a.data}):(b(r,{code:L.invalid_intersection_types}),q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([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}))}};nn.create=(n,t,e)=>new nn({left:n,right:t,typeName:j.ZodIntersection,...$(e)});var Je=class n extends Y{_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}),q;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"}),q;!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 Ve(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ve.mergeArray(e,o)):ve.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new n({...this._def,rest:t})}};Je.create=(n,t)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:n,typeName:j.ZodTuple,rest:null,...$(t)})};var Tr=class n extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return b(r,{code:L.invalid_type,expected:N.object,received:r.parsedType}),q;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)i.push({key:s._parse(new Ve(r,a,r.path,a)),value:o._parse(new Ve(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ve.mergeObjectAsync(e,i):ve.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){return e instanceof Y?new n({keyType:t,valueType:e,typeName:j.ZodRecord,...$(r)}):new n({keyType:ht.create(),valueType:t,typeName:j.ZodRecord,...$(e)})}},Ln=class extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.map)return b(r,{code:L.invalid_type,expected:N.map,received:r.parsedType}),q;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Ve(r,a,r.path,[c,"key"])),value:s._parse(new Ve(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}})}else{let a=new Map;for(let l of o){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}}}};Ln.create=(n,t,e)=>new Ln({valueType:t,keyType:n,typeName:j.ZodMap,...$(e)});var On=class n extends Y{_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}),q;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 q;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 Ve(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:R.toString(e)}})}max(t,e){return new n({...this._def,maxSize:{value:t,message:R.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:j.ZodSet,...$(t)});var Mr=class n extends Y{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}),q;function r(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Or(),vn].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function i(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Or(),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 yt){let a=this;return Ie(async function(...l){let c=new Te([]),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 Ie(function(...l){let c=a._def.args.safeParse(l,s);if(!c.success)throw new Te([r(l,c.error)]);let u=Reflect.apply(o,this,c.data),p=a._def.returns.safeParse(u,s);if(!p.success)throw new Te([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new n({...this._def,args:Je.create(t).rest(ot.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||Je.create([]).rest(ot.create()),returns:e||ot.create(),typeName:j.ZodFunction,...$(r)})}},rn=class extends Y{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};rn.create=(n,t)=>new rn({getter:n,typeName:j.ZodLazy,...$(t)});var sn=class extends Y{_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}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};sn.create=(n,t)=>new sn({value:n,typeName:j.ZodLiteral,...$(t)});function Ei(n,t){return new on({values:n,typeName:j.ZodEnum,...$(t)})}var on=class n extends Y{constructor(){super(...arguments),qn.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),r=this._def.values;return b(e,{expected:re.joinValues(r),received:e.parsedType,code:L.invalid_type}),q}if(Pr(this,qn,"f")||wi(this,qn,new Set(this._def.values),"f"),!Pr(this,qn,"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}),q}return Ie(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})}};qn=new WeakMap;on.create=Ei;var an=class extends Y{constructor(){super(...arguments),Kn.set(this,void 0)}_parse(t){let e=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==N.string&&r.parsedType!==N.number){let i=re.objectValues(e);return b(r,{expected:re.joinValues(i),received:r.parsedType,code:L.invalid_type}),q}if(Pr(this,Kn,"f")||wi(this,Kn,new Set(re.getValidEnumValues(this._def.values)),"f"),!Pr(this,Kn,"f").has(t.data)){let i=re.objectValues(e);return b(r,{received:r.data,code:L.invalid_enum_value,options:i}),q}return Ie(t.data)}get enum(){return this._def.values}};Kn=new WeakMap;an.create=(n,t)=>new an({values:n,typeName:j.ZodNativeEnum,...$(t)});var yt=class extends Y{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}),q;let r=e.parsedType===N.promise?e.data:Promise.resolve(e.data);return Ie(r.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};yt.create=(n,t)=>new yt({type:n,typeName:j.ZodPromise,...$(t)});var Me=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.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 q;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?q:l.status==="dirty"||e.value==="dirty"?Cn(l.value):l});{if(e.value==="aborted")return q;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?q:a.status==="dirty"||e.value==="dirty"?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"?q:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$t(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=>$t(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:e.value,value:a})):o);re.assertNever(i)}};Me.create=(n,t,e)=>new Me({schema:n,typeName:j.ZodEffects,effect:t,...$(e)});Me.createWithPreprocess=(n,t,e)=>new Me({schema:t,effect:{type:"preprocess",transform:n},typeName:j.ZodEffects,...$(e)});var Ne=class extends Y{_parse(t){return this._getType(t)===N.undefined?Ie(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ne.create=(n,t)=>new Ne({innerType:n,typeName:j.ZodOptional,...$(t)});var Qe=class extends Y{_parse(t){return this._getType(t)===N.null?Ie(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Qe.create=(n,t)=>new Qe({innerType:n,typeName:j.ZodNullable,...$(t)});var ln=class extends Y{_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}};ln.create=(n,t)=>new ln({innerType:n,typeName:j.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var cn=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $n(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};cn.create=(n,t)=>new cn({innerType:n,typeName:j.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var En=class extends Y{_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}),q}return{status:"valid",value:t.data}}};En.create=n=>new En({typeName:j.ZodNaN,...$(n)});var hl=Symbol("zod_brand"),Yn=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},Xn=class n extends Y{_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"?q: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"?q:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new n({in:t,out:e,typeName:j.ZodPipeline})}},un=class extends Y{_parse(t){let e=this._def.innerType._parse(t),r=i=>($t(i)&&(i.value=Object.freeze(i.value)),i);return $n(e)?e.then(i=>r(i)):r(e)}unwrap(){return this._def.innerType}};un.create=(n,t)=>new un({innerType:n,typeName:j.ZodReadonly,...$(t)});function Pi(n,t={},e){return n?gt.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})}}):gt.create()}var gl={object:Ee.lazycreate},j;(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"})(j||(j={}));var yl=(n,t={message:`Input not instance of ${n.name}`})=>Pi(e=>e instanceof n,t),Ai=ht.create,Ti=Yt.create,xl=En.create,Sl=Xt.create,Mi=Zt.create,_l=Jt.create,Cl=wn.create,vl=Qt.create,wl=en.create,Il=gt.create,Ll=ot.create,Ol=qe.create,El=In.create,Pl=at.create,Zn=Ee.create,Al=Ee.strictCreate,Tl=tn.create,Ml=Ar.create,bl=nn.create,Dl=Je.create,Nl=Tr.create,Vl=Ln.create,kl=On.create,Bl=Mr.create,Rl=rn.create,Fl=sn.create,Gl=on.create,Wl=an.create,Ul=yt.create,Ci=Me.create,zl=Ne.create,Hl=Qe.create,jl=Me.createWithPreprocess,ql=Xn.create,Kl=()=>Ai().optional(),$l=()=>Ti().optional(),Yl=()=>Mi().optional(),Xl={string:n=>ht.create({...n,coerce:!0}),number:n=>Yt.create({...n,coerce:!0}),boolean:n=>Zt.create({...n,coerce:!0}),bigint:n=>Xt.create({...n,coerce:!0}),date:n=>Jt.create({...n,coerce:!0})},Zl=q,Jn=Object.freeze({__proto__:null,defaultErrorMap:vn,setErrorMap:qa,getErrorMap:Or,makeIssue:Er,EMPTY_PATH:Ka,addIssueToContext:b,ParseStatus:ve,INVALID:q,DIRTY:Cn,OK:Ie,isAborted:_s,isDirty:Cs,isValid:$t,isAsync:$n,get util(){return re},get objectUtil(){return Ss},ZodParsedType:N,getParsedType:it,ZodType:Y,datetimeRegex:Oi,ZodString:ht,ZodNumber:Yt,ZodBigInt:Xt,ZodBoolean:Zt,ZodDate:Jt,ZodSymbol:wn,ZodUndefined:Qt,ZodNull:en,ZodAny:gt,ZodUnknown:ot,ZodNever:qe,ZodVoid:In,ZodArray:at,ZodObject:Ee,ZodUnion:tn,ZodDiscriminatedUnion:Ar,ZodIntersection:nn,ZodTuple:Je,ZodRecord:Tr,ZodMap:Ln,ZodSet:On,ZodFunction:Mr,ZodLazy:rn,ZodLiteral:sn,ZodEnum:on,ZodNativeEnum:an,ZodPromise:yt,ZodEffects:Me,ZodTransformer:Me,ZodOptional:Ne,ZodNullable:Qe,ZodDefault:ln,ZodCatch:cn,ZodNaN:En,BRAND:hl,ZodBranded:Yn,ZodPipeline:Xn,ZodReadonly:un,custom:Pi,Schema:Y,ZodSchema:Y,late:gl,get ZodFirstPartyTypeKind(){return j},coerce:Xl,any:Il,array:Pl,bigint:Sl,boolean:Mi,date:_l,discriminatedUnion:Ml,effect:Ci,enum:Gl,function:Bl,instanceof:yl,intersection:bl,lazy:Rl,literal:Fl,map:Vl,nan:xl,nativeEnum:Wl,never:Ol,null:wl,nullable:Hl,number:Ti,object:Zn,oboolean:Yl,onumber:$l,optional:zl,ostring:Kl,pipeline:ql,preprocess:jl,promise:Ul,record:Nl,set:kl,strictObject:Al,string:Ai,symbol:Cl,transformer:Ci,tuple:Dl,undefined:vl,union:Tl,unknown:Ll,void:El,NEVER:Zl,ZodIssueCode:L,quotelessJson:ja,ZodError:Te});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=Zn(i),l=Zn(s),c=Zn(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 Jl=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:Jn.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(n),CONNECT_API_BASE_URL:Jn.string().url(),CANVA_ENV_URL:Jn.string().url(),CANVA_CLI_CLIENT_ID:Jn.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD")},runtimeEnv:Jl(Di({fallback:n})),emptyStringAsUndefined:!0});var br=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 ba=Si(Ma(),1);import Lr from"crypto";var hs=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 Lr.pbkdf2Sync(t,e,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let e=await this.generateMachineId(),r=Lr.randomBytes(16),i=this.deriveKeyFromMachineId(e,r),s=Lr.randomBytes(12),o=Lr.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=Lr.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=Si(Ba(),1);import Rd from"fs/promises";import Fd from"os";import Gd from"path";var ys=class{constructor(t,e=Rd,r=Gd,i=Fd.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=Ra.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 Wd=Ni({fallback:"prod"}),Ud=new hs,zd=new ys(Ud),Hd=new br(zd,Wd),qf=()=>Hd.generatePreviewResult();export{qf as generatePreviewUrl};
388
+ `),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}function Ad(n){let t=ka(n),e=xe.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=bd(e,a);s=xe.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=i)throw a}return xe.parse(s)}function Td(n){console.log(`[dotenv@${gi}][INFO] ${n}`)}function Md(n){console.log(`[dotenv@${gi}][WARN] ${n}`)}function gs(n){console.log(`[dotenv@${gi}][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 bd(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)mi.existsSync(e)&&(t=e.endsWith(".vault")?e:`${e}.vault`);else t=n.path.endsWith(".vault")?n.path:`${n.path}.vault`;else t=hi.resolve(process.cwd(),".env.vault");return mi.existsSync(t)?t:null}function Na(n){return n[0]==="~"?hi.join(Id.homedir(),n.slice(1)):n}function Dd(n){Td("Loading env from encrypted .env.vault");let t=xe._parseVault(n),e=process.env;return n&&n.processEnv!=null&&(e=n.processEnv),xe.populate(e,t,n),{parsed:t}}function Nd(n){let t=hi.resolve(process.cwd(),".env"),e="utf8",r=!!(n&&n.debug);n&&n.encoding?e=n.encoding:r&&gs("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=xe.parse(mi.readFileSync(l,{encoding:e}));xe.populate(o,c,n)}catch(c){r&&gs(`Failed to load ${l} ${c.message}`),s=c}let a=process.env;return n&&n.processEnv!=null&&(a=n.processEnv),xe.populate(a,o,n),s?{parsed:o,error:s}:{parsed:o}}function Vd(n){if(Va(n).length===0)return xe.configDotenv(n);let t=ka(n);return t?xe._configVault(n):(Md(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),xe.configDotenv(n))}function kd(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=Ld.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 Bd(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&&gs(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):n[s]=t[s]}var xe={configDotenv:Nd,_configVault:Dd,_parseVault:Ad,config:Vd,decrypt:kd,parse:Pd,populate:Bd};mt.exports.configDotenv=xe.configDotenv;mt.exports._configVault=xe._configVault;mt.exports._parseVault=xe._parseVault;mt.exports.config=xe.config;mt.exports.decrypt=xe.decrypt;mt.exports.parse=xe.parse;mt.exports.populate=xe.populate;mt.exports=xe});var re;(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})(re||(re={}));var Ss;(function(n){n.mergeShapes=(t,e)=>({...t,...e})})(Ss||(Ss={}));var N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),it=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=re.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"]),ja=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),Te=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,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},r=[];for(let i of this.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}};Te.create=n=>new Te(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,re.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:e=`Unrecognized key(s) in object: ${re.joinValues(n.keys,", ")}`;break;case L.invalid_union:e="Invalid input";break;case L.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${re.joinValues(n.options)}`;break;case L.invalid_enum_value:e=`Invalid enum value. Expected ${re.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}"`:re.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,re.assertNever(n)}return{message:e}},vi=vn;function qa(n){vi=n}function Or(){return vi}var Er=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}},Ka=[];function b(n,t){let e=Or(),r=Er({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 ve=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 q;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let 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 q;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}}},q=Object.freeze({status:"aborted"}),Cn=n=>({status:"dirty",value:n}),Ie=n=>({status:"valid",value:n}),_s=n=>n.status==="aborted",Cs=n=>n.status==="dirty",$t=n=>n.status==="valid",Yn=n=>typeof Promise<"u"&&n instanceof Promise;function Pr(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 R;(function(n){n.errToObj=t=>typeof t=="string"?{message:t}:t||{},n.toString=t=>typeof t=="string"?t:t?.message})(R||(R={}));var Kn,$n,Ve=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($t(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 Te(n.common.issues);return this._error=e,this._error}}};function $(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 Y=class{get description(){return this._def.description}_getType(t){return it(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:it(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ve,ctx:{common:t.parent.common,data:t.data,parsedType:it(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:it(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:it(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:i});return $t(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=>$t(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:it(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 Me({schema:this,typeName:j.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 Ne.create(this,this._def)}nullable(){return Qe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this)}promise(){return yt.create(this,this._def)}or(t){return tn.create([this,t],this._def)}and(t){return nn.create(this,t,this._def)}transform(t){return new Me({...$(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new ln({...$(this._def),innerType:this,defaultValue:e,typeName:j.ZodDefault})}brand(){return new Xn({typeName:j.ZodBranded,type:this,...$(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new cn({...$(this._def),innerType:this,catchValue:e,typeName:j.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Zn.create(this,t)}readonly(){return un.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$a=/^c[^\s-]{8,}$/i,Ya=/^[0-9a-z]+$/,Xa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Za=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ja=/^[a-z0-9_-]{21}$/i,Qa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,el=/^[-+]?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)?)??$/,tl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xs,rl=/^(?:(?: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])$/,sl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,il=/^(([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]))$/,ol=/^(([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])$/,al=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ll=/^([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])))",cl=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 ul(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 pl(n,t){return!!((t==="v4"||!t)&&rl.test(n)||(t==="v6"||!t)&&il.test(n))}function dl(n,t){if(!Qa.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 fl(n,t){return!!((t==="v4"||!t)&&sl.test(n)||(t==="v6"||!t)&&ol.test(n))}var ht=class n extends Y{_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}),q}let r=new ve,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")tl.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")xs||(xs=new RegExp(nl,"u")),xs.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")Za.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")Ja.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")$a.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")Ya.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")Xa.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"?cl.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:L.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?ul(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"?el.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"duration",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?pl(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"?dl(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"?fl(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"?al.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?ll.test(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{validation:"base64url",code:L.invalid_string,message:s.message}),r.dirty()):re.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,...R.errToObj(r)})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.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,...R.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,...R.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...R.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...R.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...R.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...R.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...R.errToObj(e)})}nonempty(t){return this.min(1,R.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}};ht.create=n=>{var t;return new ht({checks:[],typeName:j.ZodString,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...$(n)})};function ml(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 Yt=class n extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N.number){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_type,expected:N.number,received:s.parsedType}),q}let r,i=new ve;for(let s of this._def.checks)s.kind==="int"?re.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"?ml(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()):re.assertNever(s);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,R.toString(e))}gt(t,e){return this.setLimit("min",t,!1,R.toString(e))}lte(t,e){return this.setLimit("max",t,!0,R.toString(e))}lt(t,e){return this.setLimit("max",t,!1,R.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&re.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)}};Yt.create=n=>new Yt({checks:[],typeName:j.ZodNumber,coerce:n?.coerce||!1,...$(n)});var Xt=class n extends Y{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 ve;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()):re.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}),q}gte(t,e){return this.setLimit("min",t,!0,R.toString(e))}gt(t,e){return this.setLimit("min",t,!1,R.toString(e))}lte(t,e){return this.setLimit("max",t,!0,R.toString(e))}lt(t,e){return this.setLimit("max",t,!1,R.toString(e))}setLimit(t,e,r,i){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:R.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:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:R.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}};Xt.create=n=>{var t;return new Xt({checks:[],typeName:j.ZodBigInt,coerce:(t=n?.coerce)!==null&&t!==void 0?t:!1,...$(n)})};var Zt=class extends Y{_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}),q}return Ie(t.data)}};Zt.create=n=>new Zt({typeName:j.ZodBoolean,coerce:n?.coerce||!1,...$(n)});var Jt=class n extends Y{_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}),q}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return b(s,{code:L.invalid_date}),q}let r=new ve,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()):re.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:R.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:R.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}};Jt.create=n=>new Jt({checks:[],coerce:n?.coerce||!1,typeName:j.ZodDate,...$(n)});var wn=class extends Y{_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}),q}return Ie(t.data)}};wn.create=n=>new wn({typeName:j.ZodSymbol,...$(n)});var Qt=class extends Y{_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}),q}return Ie(t.data)}};Qt.create=n=>new Qt({typeName:j.ZodUndefined,...$(n)});var en=class extends Y{_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}),q}return Ie(t.data)}};en.create=n=>new en({typeName:j.ZodNull,...$(n)});var gt=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return Ie(t.data)}};gt.create=n=>new gt({typeName:j.ZodAny,...$(n)});var ot=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ie(t.data)}};ot.create=n=>new ot({typeName:j.ZodUnknown,...$(n)});var qe=class extends Y{_parse(t){let e=this._getOrReturnCtx(t);return b(e,{code:L.invalid_type,expected:N.never,received:e.parsedType}),q}};qe.create=n=>new qe({typeName:j.ZodNever,...$(n)});var In=class extends Y{_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}),q}return Ie(t.data)}};In.create=n=>new In({typeName:j.ZodVoid,...$(n)});var at=class n extends Y{_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}),q;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 Ve(e,o,e.path,a)))).then(o=>ve.mergeArray(r,o));let s=[...e.data].map((o,a)=>i.type._parseSync(new Ve(e,o,e.path,a)));return ve.mergeArray(r,s)}get element(){return this._def.type}min(t,e){return new n({...this._def,minLength:{value:t,message:R.toString(e)}})}max(t,e){return new n({...this._def,maxLength:{value:t,message:R.toString(e)}})}length(t,e){return new n({...this._def,exactLength:{value:t,message:R.toString(e)}})}nonempty(t){return this.min(1,t)}};at.create=(n,t)=>new at({type:n,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...$(t)});function _n(n){if(n instanceof Ee){let t={};for(let e in n.shape){let r=n.shape[e];t[e]=Ne.create(_n(r))}return new Ee({...n._def,shape:()=>t})}else return n instanceof at?new at({...n._def,type:_n(n.element)}):n instanceof Ne?Ne.create(_n(n.unwrap())):n instanceof Qe?Qe.create(_n(n.unwrap())):n instanceof Je?Je.create(n.items.map(t=>_n(t))):n}var Ee=class n extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=re.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}),q}let{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof qe&&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 Ve(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof qe){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 Ve(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=>ve.mergeObjectSync(r,c)):ve.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return R.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=R.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:j.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new n({...this._def,catchall:t})}pick(t){let e={};return re.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 re.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 re.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 re.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])e[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ne;)s=s._def.innerType;e[r]=s}}),new n({...this._def,shape:()=>e})}keyof(){return Ei(re.objectKeys(this.shape))}};Ee.create=(n,t)=>new Ee({shape:()=>n,unknownKeys:"strip",catchall:qe.create(),typeName:j.ZodObject,...$(t)});Ee.strictCreate=(n,t)=>new Ee({shape:()=>n,unknownKeys:"strict",catchall:qe.create(),typeName:j.ZodObject,...$(t)});Ee.lazycreate=(n,t)=>new Ee({shape:n,unknownKeys:"strip",catchall:qe.create(),typeName:j.ZodObject,...$(t)});var tn=class extends Y{_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 Te(a.ctx.common.issues));return b(e,{code:L.invalid_union,unionErrors:o}),q}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 Te(l));return b(e,{code:L.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}};tn.create=(n,t)=>new tn({options:n,typeName:j.ZodUnion,...$(t)});var st=n=>n instanceof rn?st(n.schema):n instanceof Me?st(n.innerType()):n instanceof sn?[n.value]:n instanceof on?n.options:n instanceof an?re.objectValues(n.enum):n instanceof ln?st(n._def.innerType):n instanceof Qt?[void 0]:n instanceof en?[null]:n instanceof Ne?[void 0,...st(n.unwrap())]:n instanceof Qe?[null,...st(n.unwrap())]:n instanceof Xn||n instanceof un?st(n.unwrap()):n instanceof cn?st(n._def.innerType):[],Ar=class n extends Y{_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}),q;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]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let s of e){let o=st(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:j.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...$(r)})}};function vs(n,t){let e=it(n),r=it(t);if(n===t)return{valid:!0,data:n};if(e===N.object&&r===N.object){let i=re.objectKeys(t),s=re.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...t};for(let a of s){let l=vs(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=vs(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 nn=class extends Y{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(_s(s)||_s(o))return q;let a=vs(s.value,o.value);return a.valid?((Cs(s)||Cs(o))&&e.dirty(),{status:e.value,value:a.data}):(b(r,{code:L.invalid_intersection_types}),q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([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}))}};nn.create=(n,t,e)=>new nn({left:n,right:t,typeName:j.ZodIntersection,...$(e)});var Je=class n extends Y{_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}),q;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"}),q;!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 Ve(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ve.mergeArray(e,o)):ve.mergeArray(e,s)}get items(){return this._def.items}rest(t){return new n({...this._def,rest:t})}};Je.create=(n,t)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:n,typeName:j.ZodTuple,rest:null,...$(t)})};var Tr=class n extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return b(r,{code:L.invalid_type,expected:N.object,received:r.parsedType}),q;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)i.push({key:s._parse(new Ve(r,a,r.path,a)),value:o._parse(new Ve(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ve.mergeObjectAsync(e,i):ve.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){return e instanceof Y?new n({keyType:t,valueType:e,typeName:j.ZodRecord,...$(r)}):new n({keyType:ht.create(),valueType:t,typeName:j.ZodRecord,...$(e)})}},Ln=class extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.map)return b(r,{code:L.invalid_type,expected:N.map,received:r.parsedType}),q;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Ve(r,a,r.path,[c,"key"])),value:s._parse(new Ve(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}})}else{let a=new Map;for(let l of o){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&e.dirty(),a.set(c.value,u.value)}return{status:e.value,value:a}}}};Ln.create=(n,t,e)=>new Ln({valueType:t,keyType:n,typeName:j.ZodMap,...$(e)});var On=class n extends Y{_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}),q;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 q;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 Ve(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:R.toString(e)}})}max(t,e){return new n({...this._def,maxSize:{value:t,message:R.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:j.ZodSet,...$(t)});var Mr=class n extends Y{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}),q;function r(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Or(),vn].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function i(a,l){return Er({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Or(),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 yt){let a=this;return Ie(async function(...l){let c=new Te([]),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 Ie(function(...l){let c=a._def.args.safeParse(l,s);if(!c.success)throw new Te([r(l,c.error)]);let u=Reflect.apply(o,this,c.data),p=a._def.returns.safeParse(u,s);if(!p.success)throw new Te([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new n({...this._def,args:Je.create(t).rest(ot.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||Je.create([]).rest(ot.create()),returns:e||ot.create(),typeName:j.ZodFunction,...$(r)})}},rn=class extends Y{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};rn.create=(n,t)=>new rn({getter:n,typeName:j.ZodLazy,...$(t)});var sn=class extends Y{_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}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};sn.create=(n,t)=>new sn({value:n,typeName:j.ZodLiteral,...$(t)});function Ei(n,t){return new on({values:n,typeName:j.ZodEnum,...$(t)})}var on=class n extends Y{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:re.joinValues(r),received:e.parsedType,code:L.invalid_type}),q}if(Pr(this,Kn,"f")||wi(this,Kn,new Set(this._def.values),"f"),!Pr(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}),q}return Ie(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;on.create=Ei;var an=class extends Y{constructor(){super(...arguments),$n.set(this,void 0)}_parse(t){let e=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==N.string&&r.parsedType!==N.number){let i=re.objectValues(e);return b(r,{expected:re.joinValues(i),received:r.parsedType,code:L.invalid_type}),q}if(Pr(this,$n,"f")||wi(this,$n,new Set(re.getValidEnumValues(this._def.values)),"f"),!Pr(this,$n,"f").has(t.data)){let i=re.objectValues(e);return b(r,{received:r.data,code:L.invalid_enum_value,options:i}),q}return Ie(t.data)}get enum(){return this._def.values}};$n=new WeakMap;an.create=(n,t)=>new an({values:n,typeName:j.ZodNativeEnum,...$(t)});var yt=class extends Y{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}),q;let r=e.parsedType===N.promise?e.data:Promise.resolve(e.data);return Ie(r.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};yt.create=(n,t)=>new yt({type:n,typeName:j.ZodPromise,...$(t)});var Me=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.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 q;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?q:l.status==="dirty"||e.value==="dirty"?Cn(l.value):l});{if(e.value==="aborted")return q;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?q:a.status==="dirty"||e.value==="dirty"?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"?q:(a.status==="dirty"&&e.dirty(),o(a.value),{status:e.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&e.dirty(),o(a.value).then(()=>({status:e.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$t(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=>$t(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:e.value,value:a})):o);re.assertNever(i)}};Me.create=(n,t,e)=>new Me({schema:n,typeName:j.ZodEffects,effect:t,...$(e)});Me.createWithPreprocess=(n,t,e)=>new Me({schema:t,effect:{type:"preprocess",transform:n},typeName:j.ZodEffects,...$(e)});var Ne=class extends Y{_parse(t){return this._getType(t)===N.undefined?Ie(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ne.create=(n,t)=>new Ne({innerType:n,typeName:j.ZodOptional,...$(t)});var Qe=class extends Y{_parse(t){return this._getType(t)===N.null?Ie(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Qe.create=(n,t)=>new Qe({innerType:n,typeName:j.ZodNullable,...$(t)});var ln=class extends Y{_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}};ln.create=(n,t)=>new ln({innerType:n,typeName:j.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var cn=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Yn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Te(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};cn.create=(n,t)=>new cn({innerType:n,typeName:j.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var En=class extends Y{_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}),q}return{status:"valid",value:t.data}}};En.create=n=>new En({typeName:j.ZodNaN,...$(n)});var hl=Symbol("zod_brand"),Xn=class extends Y{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},Zn=class n extends Y{_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"?q: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"?q:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new n({in:t,out:e,typeName:j.ZodPipeline})}},un=class extends Y{_parse(t){let e=this._def.innerType._parse(t),r=i=>($t(i)&&(i.value=Object.freeze(i.value)),i);return Yn(e)?e.then(i=>r(i)):r(e)}unwrap(){return this._def.innerType}};un.create=(n,t)=>new un({innerType:n,typeName:j.ZodReadonly,...$(t)});function Pi(n,t={},e){return n?gt.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})}}):gt.create()}var gl={object:Ee.lazycreate},j;(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"})(j||(j={}));var yl=(n,t={message:`Input not instance of ${n.name}`})=>Pi(e=>e instanceof n,t),Ai=ht.create,Ti=Yt.create,xl=En.create,Sl=Xt.create,Mi=Zt.create,_l=Jt.create,Cl=wn.create,vl=Qt.create,wl=en.create,Il=gt.create,Ll=ot.create,Ol=qe.create,El=In.create,Pl=at.create,Jn=Ee.create,Al=Ee.strictCreate,Tl=tn.create,Ml=Ar.create,bl=nn.create,Dl=Je.create,Nl=Tr.create,Vl=Ln.create,kl=On.create,Bl=Mr.create,Rl=rn.create,Fl=sn.create,Gl=on.create,Wl=an.create,Ul=yt.create,Ci=Me.create,zl=Ne.create,Hl=Qe.create,jl=Me.createWithPreprocess,ql=Zn.create,Kl=()=>Ai().optional(),$l=()=>Ti().optional(),Yl=()=>Mi().optional(),Xl={string:n=>ht.create({...n,coerce:!0}),number:n=>Yt.create({...n,coerce:!0}),boolean:n=>Zt.create({...n,coerce:!0}),bigint:n=>Xt.create({...n,coerce:!0}),date:n=>Jt.create({...n,coerce:!0})},Zl=q,Pn=Object.freeze({__proto__:null,defaultErrorMap:vn,setErrorMap:qa,getErrorMap:Or,makeIssue:Er,EMPTY_PATH:Ka,addIssueToContext:b,ParseStatus:ve,INVALID:q,DIRTY:Cn,OK:Ie,isAborted:_s,isDirty:Cs,isValid:$t,isAsync:Yn,get util(){return re},get objectUtil(){return Ss},ZodParsedType:N,getParsedType:it,ZodType:Y,datetimeRegex:Oi,ZodString:ht,ZodNumber:Yt,ZodBigInt:Xt,ZodBoolean:Zt,ZodDate:Jt,ZodSymbol:wn,ZodUndefined:Qt,ZodNull:en,ZodAny:gt,ZodUnknown:ot,ZodNever:qe,ZodVoid:In,ZodArray:at,ZodObject:Ee,ZodUnion:tn,ZodDiscriminatedUnion:Ar,ZodIntersection:nn,ZodTuple:Je,ZodRecord:Tr,ZodMap:Ln,ZodSet:On,ZodFunction:Mr,ZodLazy:rn,ZodLiteral:sn,ZodEnum:on,ZodNativeEnum:an,ZodPromise:yt,ZodEffects:Me,ZodTransformer:Me,ZodOptional:Ne,ZodNullable:Qe,ZodDefault:ln,ZodCatch:cn,ZodNaN:En,BRAND:hl,ZodBranded:Xn,ZodPipeline:Zn,ZodReadonly:un,custom:Pi,Schema:Y,ZodSchema:Y,late:gl,get ZodFirstPartyTypeKind(){return j},coerce:Xl,any:Il,array:Pl,bigint:Sl,boolean:Mi,date:_l,discriminatedUnion:Ml,effect:Ci,enum:Gl,function:Bl,instanceof:yl,intersection:bl,lazy:Rl,literal:Fl,map:Vl,nan:xl,nativeEnum:Wl,never:Ol,null:wl,nullable:Hl,number:Ti,object:Jn,oboolean:Yl,onumber:$l,optional:zl,ostring:Kl,pipeline:ql,preprocess:jl,promise:Ul,record:Nl,set:kl,strictObject:Al,string:Ai,symbol:Cl,transformer:Ci,tuple:Dl,undefined:vl,union:Tl,unknown:Ll,void:El,NEVER:Zl,ZodIssueCode:L,quotelessJson:ja,ZodError:Te});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 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 Jl=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:{...Jl(Di({fallback:n})),CANVA_CLI_DOCTOR_ENABLED:process.env.CANVA_CLI_DOCTOR_ENABLED==="true"},emptyStringAsUndefined:!0});var br=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 ba=Si(Ma(),1);import Lr from"crypto";var hs=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 Lr.pbkdf2Sync(t,e,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let e=await this.generateMachineId(),r=Lr.randomBytes(16),i=this.deriveKeyFromMachineId(e,r),s=Lr.randomBytes(12),o=Lr.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=Lr.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=Si(Ba(),1);import Rd from"fs/promises";import Fd from"os";import Gd from"path";var ys=class{constructor(t,e=Rd,r=Gd,i=Fd.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=Ra.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 Wd=Ni({fallback:"prod"}),Ud=new hs,zd=new ys(Ud),Hd=new br(zd,Wd),qf=()=>Hd.generatePreviewResult();export{qf as generatePreviewUrl};