@canva/cli 0.0.1-beta.20 → 0.0.1-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/cli.js +291 -290
- package/lib/cjs/index.cjs +3 -387
- package/lib/esm/index.mjs +3 -387
- package/package.json +1 -1
package/lib/esm/index.mjs
CHANGED
|
@@ -1,388 +1,4 @@
|
|
|
1
1
|
// Copyright 2024 Canva Inc. All Rights Reserved.
|
|
2
|
-
var
|
|
3
|
-
`);
|
|
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
|
-
`).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
|
-
`),$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
|
-
`)}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
|
-
`||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=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
|
-
`);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
|
-
echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;
|
|
15
|
-
echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;
|
|
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=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
|
-
`).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&&Dn("ioreg -c IOPlatformExpertDevice -d 2",function(r,i){if(!r){let s=i.toString().replace(/[<>"]/g,"").split(`
|
|
22
|
-
`),o=v.getAppleModel(v.getValue(s,"model","=",!0));e.manufacturer=v.getValue(s,"manufacturer","=",!0),e.model=o.key,e.type=Qi(o.version),e.version=o.version,e.serial=v.getValue(s,"ioplatformserialnumber","=",!0),e.uuid=v.getValue(s,"ioplatformuuid","=",!0).toLowerCase(),e.sku=v.getValue(s,"board-id","=",!0)||v.getValue(s,"target-sub-type","=",!0)}n&&n(e),t(e)}),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
|
-
`);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",Dn(r,function(i,s){let o=s.toString().split(`
|
|
25
|
-
`);e.vendor=v.getValue(o,"Vendor"),e.version=v.getValue(o,"Version");let a=v.getValue(o,"Release Date");e.releaseDate=v.parseDateTime(a).date,e.revision=v.getValue(o,"BIOS Revision"),e.serial=v.getValue(o,"SerialNumber");let l=v.getValue(o,"Currently Installed Language").split("|")[0];if(l&&(e.language=l),o.length&&s.toString().indexOf("Characteristics:")>=0){let u=[];o.forEach(p=>{if(p.indexOf(" is supported")>=0){let d=p.split(" is supported")[0].trim();u.push(d)}}),e.features=u}let c=`echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;
|
|
26
|
-
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=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
|
-
`),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
|
-
`):[""];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
|
-
echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;
|
|
32
|
-
echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;
|
|
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=bn(a,v.execOptsLinux).toString().split(`
|
|
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
|
-
`):[""],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
|
-
`):[""];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
|
-
`):[""];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)&&Dn(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
|
|
40
|
-
echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
|
|
41
|
-
echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
|
|
42
|
-
echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
|
|
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&&Dn("ioreg -c IOPlatformExpertDevice -d 2",function(i,s){if(!i){let o=s.toString().replace(/[<>"]/g,"").split(`
|
|
45
|
-
`),a=v.getAppleModel(v.getValue(o,"model","=",!0));r.manufacturer=v.getValue(o,"manufacturer","=",!0),r.model=a.key,r.type=Qi(a.model),r.version=a.version,r.serial=v.getValue(o,"ioplatformserialnumber","=",!0),r.assetTag=v.getValue(o,"board-id","=",!0)||v.getValue(o,"target-type","=",!0),r.sku=v.getValue(o,"target-sub-type","=",!0)}n&&n(r),e(r)}),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(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
|
-
`).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
|
-
`),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
|
-
`);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
|
-
`);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)}}})})}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
|
-
`);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
|
-
\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
|
-
`)[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(`
|
|
55
|
-
`)[0]),a()}),{}.hasOwnProperty.call(s.versions,"pm2")&&(l="pm2",Re&&(l+=".cmd"),U(`${l} -v`,function(c,u){if(!c){let p=u.toString().split(`
|
|
56
|
-
`)[0].trim();p.startsWith("[PM2]")||(s.versions.pm2=p)}a()})),{}.hasOwnProperty.call(s.versions,"yarn")&&U("yarn --version",function(c,u){c||(s.versions.yarn=u.toString().split(`
|
|
57
|
-
`)[0]),a()}),{}.hasOwnProperty.call(s.versions,"gulp")&&(l="gulp",Re&&(l+=".cmd"),U(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
58
|
-
`)[0]||"";s.versions.gulp=(p.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"homebrew")&&(l="brew",U(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
59
|
-
`)[0]||"";s.versions.homebrew=(p.toLowerCase().split(" ")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"tsc")&&(l="tsc",Re&&(l+=".cmd"),U(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
60
|
-
`)[0]||"";s.versions.tsc=(p.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"grunt")&&(l="grunt",Re&&(l+=".cmd"),U(`${l} --version`,function(c,u){if(!c){let p=u.toString().split(`
|
|
61
|
-
`)[0]||"";s.versions.grunt=(p.toLowerCase().split("cli v")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"git"))if(Be){let c=ke.existsSync("/usr/local/Cellar/git")||ke.existsSync("/opt/homebrew/bin/git");G.darwinXcodeExists()||c?U("git --version",function(u,p){if(!u){let d=p.toString().split(`
|
|
62
|
-
`)[0]||"";d=(d.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(d.split(" ")[0]||"").trim()}a()}):a()}else U("git --version",function(c,u){if(!c){let p=u.toString().split(`
|
|
63
|
-
`)[0]||"";p=(p.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(p.split(" ")[0]||"").trim()}a()});if({}.hasOwnProperty.call(s.versions,"apache")&&U("apachectl -v 2>&1",function(c,u){if(!c){let p=(u.toString().split(`
|
|
64
|
-
`)[0]||"").split(":");s.versions.apache=p.length>1?p[1].replace("Apache","").replace("/","").split("(")[0].trim():""}a()}),{}.hasOwnProperty.call(s.versions,"nginx")&&U("nginx -v 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
65
|
-
`)[0]||"";s.versions.nginx=(p.toLowerCase().split("/")[1]||"").trim()}a()}),{}.hasOwnProperty.call(s.versions,"mysql")&&U("mysql -V",function(c,u){if(!c){let p=u.toString().split(`
|
|
66
|
-
`)[0]||"";if(p=p.toLowerCase(),p.indexOf(",")>-1){p=(p.split(",")[0]||"").trim();let d=p.split(" ");s.versions.mysql=(d[d.length-1]||"").trim()}else p.indexOf(" ver ")>-1&&(p=p.split(" ver ")[1],s.versions.mysql=p.split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"php")&&U("php -v",function(c,u){if(!c){let d=(u.toString().split(`
|
|
67
|
-
`)[0]||"").split("(");d[0].indexOf("-")&&(d=d[0].split("-")),s.versions.php=d[0].replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"redis")&&U("redis-server --version",function(c,u){if(!c){let d=(u.toString().split(`
|
|
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
|
-
`)[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
|
-
`)||[];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")&&(Nn?U("locate bin/postgres",function(c,u){if(c)U("psql -V",function(p,d){if(!p){let f=d.toString().split(`
|
|
72
|
-
`)[0].split(" ")||[];s.versions.postgresql=f.length?f[f.length-1]:"",s.versions.postgresql=s.versions.postgresql.split("-")[0]}a()});else{let p=u.toString().split(`
|
|
73
|
-
`).sort();p.length?U(p[p.length-1]+" -V",function(d,f){if(!d){let m=f.toString().split(`
|
|
74
|
-
`)[0].split(" ")||[];s.versions.postgresql=m.length?m[m.length-1]:""}a()}):a()}}):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
|
|
75
|
-
`),f=G.getValue(d,"caption",":",!0).toLowerCase();if(f.indexOf("postgresql")>-1){let m=f.split(" server ");m.length>1&&(s.versions.postgresql=m[1])}}}),a()}):U("postgres -V",function(c,u){if(c)U("pg_config --version",function(p,d){if(!p){let f=d.toString().split(`
|
|
76
|
-
`)[0].split(" ")||[];s.versions.postgresql=f.length?f[f.length-1]:""}});else{let p=u.toString().split(`
|
|
77
|
-
`)[0].split(" ")||[];s.versions.postgresql=p.length?p[p.length-1]:""}a()})),{}.hasOwnProperty.call(s.versions,"perl")&&U("perl -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
78
|
-
`)||"";for(;p.length>0&&p[0].trim()==="";)p.shift();p.length>0&&(s.versions.perl=p[0].split("(").pop().split(")")[0].replace("v",""))}a()}),{}.hasOwnProperty.call(s.versions,"python"))if(Be)try{let u=or("sw_vers").toString().split(`
|
|
79
|
-
`),p=G.getValue(u,"ProductVersion",":"),d=ke.existsSync("/usr/local/Cellar/python"),f=ke.existsSync("/opt/homebrew/bin/python");G.darwinXcodeExists()&&G.semverCompare("12.0.1",p)<0||d||f?U(d?"/usr/local/Cellar/python -V 2>&1":f?"/opt/homebrew/bin/python -V 2>&1":"python -V 2>&1",function(g,x){if(!g){let h=x.toString().split(`
|
|
80
|
-
`)[0]||"";s.versions.python=h.toLowerCase().replace("python","").trim()}a()}):a()}catch{a()}else U("python -V 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
81
|
-
`)[0]||"";s.versions.python=p.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"python3"))if(Be){let c=ke.existsSync("/usr/local/Cellar/python3")||ke.existsSync("/opt/homebrew/bin/python3");G.darwinXcodeExists()||c?U("python3 -V 2>&1",function(u,p){if(!u){let d=p.toString().split(`
|
|
82
|
-
`)[0]||"";s.versions.python3=d.toLowerCase().replace("python","").trim()}a()}):a()}else U("python3 -V 2>&1",function(c,u){if(!c){let p=u.toString().split(`
|
|
83
|
-
`)[0]||"";s.versions.python3=p.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"pip"))if(Be){let c=ke.existsSync("/usr/local/Cellar/pip")||ke.existsSync("/opt/homebrew/bin/pip");G.darwinXcodeExists()||c?U("pip -V 2>&1",function(u,p){if(!u){let f=(p.toString().split(`
|
|
84
|
-
`)[0]||"").split(" ");s.versions.pip=f.length>=2?f[1]:""}a()}):a()}else U("pip -V 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
85
|
-
`)[0]||"").split(" ");s.versions.pip=d.length>=2?d[1]:""}a()});if({}.hasOwnProperty.call(s.versions,"pip3"))if(Be){let c=ke.existsSync("/usr/local/Cellar/pip3")||ke.existsSync("/opt/homebrew/bin/pip3");G.darwinXcodeExists()||c?U("pip3 -V 2>&1",function(u,p){if(!u){let f=(p.toString().split(`
|
|
86
|
-
`)[0]||"").split(" ");s.versions.pip3=f.length>=2?f[1]:""}a()}):a()}else U("pip3 -V 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
87
|
-
`)[0]||"").split(" ");s.versions.pip3=d.length>=2?d[1]:""}a()});({}).hasOwnProperty.call(s.versions,"java")&&(Be?U("/usr/libexec/java_home -V 2>&1",function(c,u){!c&&u.toString().toLowerCase().indexOf("no java runtime")===-1?U("java -version 2>&1",function(p,d){if(!p){let m=(d.toString().split(`
|
|
88
|
-
`)[0]||"").split('"');s.versions.java=m.length===3?m[1].trim():""}a()}):a()}):U("java -version 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
89
|
-
`)[0]||"").split('"');s.versions.java=d.length===3?d[1].trim():""}a()})),{}.hasOwnProperty.call(s.versions,"gcc")&&(Be&&G.darwinXcodeExists()||!Be?U("gcc -dumpversion",function(c,u){c||(s.versions.gcc=u.toString().split(`
|
|
90
|
-
`)[0].trim()||""),s.versions.gcc.indexOf(".")>-1?a():U("gcc --version",function(p,d){if(!p){let f=d.toString().split(`
|
|
91
|
-
`)[0].trim();if(f.indexOf("gcc")>-1&&f.indexOf(")")>-1){let m=f.split(")");s.versions.gcc=m[1].trim()||s.versions.gcc}}a()})}):a()),{}.hasOwnProperty.call(s.versions,"virtualbox")&&U(G.getVboxmanage()+" -v 2>&1",function(c,u){if(!c){let d=(u.toString().split(`
|
|
92
|
-
`)[0]||"").split("r");s.versions.virtualbox=d[0]}a()}),{}.hasOwnProperty.call(s.versions,"bash")&&U("bash --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
93
|
-
`)[0].split(" version ");d.length>1&&(s.versions.bash=d[1].split(" ")[0].split("(")[0])}a()}),{}.hasOwnProperty.call(s.versions,"zsh")&&U("zsh --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
94
|
-
`)[0].split("zsh ");d.length>1&&(s.versions.zsh=d[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"fish")&&U("fish --version",function(c,u){if(!c){let d=u.toString().split(`
|
|
95
|
-
`)[0].split(" version ");d.length>1&&(s.versions.fish=d[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"bun")&&U("bun -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
96
|
-
`)[0].trim();s.versions.bun=p}a()}),{}.hasOwnProperty.call(s.versions,"deno")&&U("deno -v",function(c,u){if(!c){let d=u.toString().split(`
|
|
97
|
-
`)[0].trim().split(" ");d.length>1&&(s.versions.deno=d[1])}a()}),{}.hasOwnProperty.call(s.versions,"node")&&U("node -v",function(c,u){if(!c){let p=u.toString().split(`
|
|
98
|
-
`)[0].trim();p.startsWith("v")&&(p=p.slice(1)),s.versions.node=p}a()}),{}.hasOwnProperty.call(s.versions,"powershell")&&(Re?G.powerShell("$PSVersionTable").then(c=>{let u=c.toString().toLowerCase().split(`
|
|
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)}})})}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
|
-
cat /etc/machine-id 2> /dev/null; echo;
|
|
103
|
-
echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,function(s,o){let a=o.toString().split(`
|
|
104
|
-
`);if(e.os=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
|
-
`),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
|
-
`);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
|
-
`);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)})})}})})}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
|
-
`),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
|
-
`),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)}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
|
-
`);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,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
|
-
`);if(s.length===2){let o=s[0].split(`
|
|
119
|
-
`),a=s[1].split(`
|
|
120
|
-
`);for(let l=0;l<o.length;l++){let c=o[l].trim();c.startsWith("acpi")&&a[l]&&e.socket.push(Math.round(parseInt(a[l],10)/100)/10),c.startsWith("pch")&&a[l]&&(e.chipset=Math.round(parseInt(a[l],10)/100)/10)}}}catch{O.noop()}let r='for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';try{Le(r,function(i,s){s=s.toString();let o=s.toLowerCase().indexOf("tdie");o!==-1&&(s=s.substring(o));let a=s.split(`
|
|
121
|
-
`),l=0;if(a.forEach(c=>{let u=c.split("___"),p=u[0],d=u.length>1&&u[1]?u[1]:"0";d&&p&&p.toLowerCase()==="tctl"&&(l=e.main=Math.round(parseInt(d,10)/100)/10),d&&(p===void 0||p&&p.toLowerCase().startsWith("core"))?e.cores.push(Math.round(parseInt(d,10)/100)/10):d&&p&&e.main===null&&(p.toLowerCase().indexOf("package")>=0||p.toLowerCase().indexOf("physical")>=0||p.toLowerCase()==="tccd1")&&(e.main=Math.round(parseInt(d,10)/100)/10)}),l&&e.main===null&&(e.main=l),e.cores.length>0){e.main===null&&(e.main=Math.round(e.cores.reduce((u,p)=>u+p,0)/e.cores.length));let c=Math.max.apply(Math,e.cores);e.max=c>e.main?c:e.main}if(e.main!==null){e.max===null&&(e.max=e.main),n&&n(e),t(e);return}Le("sensors",function(c,u){if(!c){let p=u.toString().split(`
|
|
122
|
-
`),d=null,f=!0,m="";if(p.forEach(function(g){g.trim()===""?f=!0:f&&(g.trim().toLowerCase().startsWith("acpi")&&(m="acpi"),g.trim().toLowerCase().startsWith("pch")&&(m="pch"),g.trim().toLowerCase().startsWith("core")&&(m="core"),f=!1);let x=/[+-]([^°]*)/g,h=g.match(x),y=g.split(":")[0].toUpperCase();m==="acpi"?y.indexOf("TEMP")!==-1&&e.socket.push(parseFloat(h)):m==="pch"&&y.indexOf("TEMP")!==-1&&!e.chipset&&(e.chipset=parseFloat(h)),(y.indexOf("PHYSICAL")!==-1||y.indexOf("PACKAGE")!==-1)&&(e.main=parseFloat(h)),y.indexOf("CORE ")!==-1&&e.cores.push(parseFloat(h)),y.indexOf("TDIE")!==-1&&d===null&&(d=parseFloat(h))}),e.cores.length>0){e.main=Math.round(e.cores.reduce((x,h)=>x+h,0)/e.cores.length);let g=Math.max.apply(Math,e.cores);e.max=g>e.main?g:e.main}else e.main===null&&d!==null&&(e.main=d,e.max=d);if(e.main!==null||e.max!==null){n&&n(e),t(e);return}}jr.stat("/sys/class/thermal/thermal_zone0/temp",function(p){p===null?jr.readFile("/sys/class/thermal/thermal_zone0/temp",function(d,f){if(!d){let m=f.toString().split(`
|
|
123
|
-
`);m.length>0&&(e.main=parseFloat(m[0])/1e3,e.max=e.main)}n&&n(e),t(e)}):Le("/opt/vc/bin/vcgencmd measure_temp",function(d,f){if(!d){let m=f.toString().split(`
|
|
124
|
-
`);m.length>0&&m[0].indexOf("=")&&(e.main=parseFloat(m[0].split("=")[1]),e.max=e.main)}n&&n(e),t(e)})})})})}catch{n&&n(e),t(e)}}if((Yr||Xr||Zr)&&Le("sysctl dev.cpu | grep temp",function(r,i){if(!r){let s=i.toString().split(`
|
|
125
|
-
`),o=0;s.forEach(function(a){let l=a.split(":");if(l.length>1){let c=parseFloat(l[1].replace(",","."));c>e.max&&(e.max=c),o=o+c,e.cores.push(c)}}),e.cores.length&&(e.main=Math.round(o/e.cores.length*100)/100)}n&&n(e),t(e)}),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(Bn)try{Le("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
|
|
127
|
-
`).forEach(function(o){o.split(":")[0].toUpperCase().indexOf("FLAGS")!==-1&&(e=o.split(":")[1].trim().toLowerCase())}),e?(n&&n(e),t(e)):jr.readFile("/proc/cpuinfo",function(s,o){if(!s){let a=o.toString().split(`
|
|
128
|
-
`);e=O.getValue(a,"features",":",!0).toLowerCase()}n&&n(e),t(e)})})}catch{n&&n(e),t(e)}(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
|
-
`):[]).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(Bn)try{Le("export LC_ALL=C; lscpu; unset LC_ALL",function(r,i){r||i.toString().split(`
|
|
131
|
-
`).forEach(function(o){let a=o.split(":");a[0].toUpperCase().indexOf("L1D CACHE")!==-1&&(e.l1d=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L1I CACHE")!==-1&&(e.l1i=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L2 CACHE")!==-1&&(e.l2=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L3 CACHE")!==-1&&(e.l3=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1))}),n&&n(e),t(e)})}catch{n&&n(e),t(e)}if((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
|
-
`),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
|
-
`).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
|
-
`);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,Bn)try{let h=qr("cat /proc/stat 2>/dev/null | grep cpu",O.execOptsLinux).toString().split(`
|
|
136
|
-
`);if(h.length>1&&(h.shift(),h.length===s.length))for(let y=0;y<h.length;y++){let S=h[y].split(" ");if(S.length>=10){let _=parseFloat(S[8])||0,C=parseFloat(S[9])||0;s[y].times.steal=_,s[y].times.guest=C}}}catch{O.noop()}for(let h=0;h<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
|
-
`);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
|
-
`),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(`
|
|
139
|
-
`);e.active=parseInt(o[0].split(":")[1],10)*r,e.buffcache=e.used-e.active,e.available=e.free+e.buffcache}ar("sysctl -n vm.swapusage 2>/dev/null",function(o,a){if(!o){let l=a.toString().split(`
|
|
140
|
-
`);l.length>0&&l[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach(p=>{p.toLowerCase().indexOf("total")!==-1&&(e.swaptotal=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("used")!==-1&&(e.swapused=parseFloat(p.split("=")[1].trim())*1024*1024),p.toLowerCase().indexOf("free")!==-1&&(e.swapfree=parseFloat(p.split("=")[1].trim())*1024*1024)})}n&&n(e),t(e)})})}catch{n&&n(e),t(e)}}if(mo){let r=0,i=0;try{M.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then((s,o)=>{o||s.split(`\r
|
|
141
|
-
`).filter(l=>l.trim()!=="").filter((l,c)=>c>0).forEach(function(l){l!==""&&(l=l.trim().split(/\s\s+/),r=r+(parseInt(l[0],10)||0),i=i+(parseInt(l[1],10)||0))}),e.swaptotal=r*1024*1024,e.swapused=i*1024*1024,e.swapfree=e.swaptotal-e.swapused,n&&n(e),t(e)})}catch{n&&n(e),t(e)}}})})}Ws.mem=hu;function gu(n){function t(r){return{}.hasOwnProperty.call(co,r)?co[r]:r}function e(r){let i=r.replace("0x","").toUpperCase();return i.length===4&&{}.hasOwnProperty.call(uo,i)?uo[i]:r}return new Promise(r=>{process.nextTick(()=>{let i=[];if((po||ho||go||yo)&&ar('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',function(s,o){if(!s){let a=o.toString().split("Memory Device");a.shift(),a.forEach(function(l){let c=l.split(`
|
|
142
|
-
`),u=M.getValue(c,"Size"),p=u.indexOf("GB")>=0?parseInt(u,10)*1024*1024*1024:parseInt(u,10)*1024*1024,d=M.getValue(c,"Bank Locator");if(d.toLowerCase().indexOf("bad")>=0&&(d=""),parseInt(M.getValue(c,"Size"),10)>0){let f=M.toInt(M.getValue(c,"Total Width")),m=M.toInt(M.getValue(c,"Data Width"));i.push({size:p,bank:d,type:M.getValue(c,"Type:"),ecc:m&&f?f>m:!1,clockSpeed:M.getValue(c,"Configured Clock Speed:")?parseInt(M.getValue(c,"Configured Clock Speed:"),10):M.getValue(c,"Speed:")?parseInt(M.getValue(c,"Speed:"),10):null,formFactor:M.getValue(c,"Form Factor:"),manufacturer:e(M.getValue(c,"Manufacturer:")),partNum:M.getValue(c,"Part Number:"),serialNum:M.getValue(c,"Serial Number:"),voltageConfigured:parseFloat(M.getValue(c,"Configured Voltage:"))||null,voltageMin:parseFloat(M.getValue(c,"Minimum Voltage:"))||null,voltageMax:parseFloat(M.getValue(c,"Maximum Voltage:"))||null})}else i.push({size:0,bank:d,type:"Empty",ecc:null,clockSpeed:0,formFactor:M.getValue(c,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){i.push({size:et.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let a=Qr("cat /proc/cpuinfo 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
143
|
-
`),c=M.getValue(l,"revision",":",!0).toLowerCase();if(M.isRaspberry(l)){let u={0:400,1:450,2:450,3:3200,4:4267};i[0].type="LPDDR2",i[0].type=c&&c[2]&&c[2]==="3"?"LPDDR4":i[0].type,i[0].type=c&&c[2]&&c[2]==="4"?"LPDDR4X":i[0].type,i[0].ecc=!1,i[0].clockSpeed=c&&c[2]&&u[c[2]]||400,i[0].clockSpeed=c&&c[4]&&c[4]==="d"?500:i[0].clockSpeed,i[0].formFactor="SoC",a=Qr("vcgencmd get_config sdram_freq 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
144
|
-
`);let p=parseInt(M.getValue(l,"sdram_freq","=",!0),10)||0;p&&(i[0].clockSpeed=p),a=Qr("vcgencmd measure_volts sdram_p 2>/dev/null",M.execOptsLinux),l=a.toString().split(`
|
|
145
|
-
`);let d=parseFloat(M.getValue(l,"volt","=",!0))||0;d&&(i[0].voltageConfigured=d,i[0].voltageMin=d,i[0].voltageMax=d)}}catch{M.noop()}}n&&n(i),r(i)}),fo&&ar("system_profiler SPMemoryDataType",function(s,o){if(!s){let a=o.toString().split(`
|
|
146
|
-
`),l=M.getValue(a,"ecc",":",!0).toLowerCase(),c=o.toString().split(" BANK "),u=!0;c.length===1&&(c=o.toString().split(" DIMM"),u=!1),c.shift(),c.forEach(function(p){let d=p.split(`
|
|
147
|
-
`),f=(u?"BANK ":"DIMM")+d[0].trim().split("/")[0],m=parseInt(M.getValue(d," Size"));m?i.push({size:m*1024*1024*1024,bank:f,type:M.getValue(d," Type:"),ecc:l?l==="enabled":null,clockSpeed:parseInt(M.getValue(d," Speed:"),10),formFactor:"",manufacturer:t(M.getValue(d," Manufacturer:")),partNum:M.getValue(d," Part Number:"),serialNum:M.getValue(d," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):i.push({size:0,bank:f,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){let a=o.toString().split(`
|
|
148
|
-
`),l=parseInt(M.getValue(a," Memory:")),c=M.getValue(a," Type:"),u=M.getValue(a," Manufacturer:");l&&c&&i.push({size:l*1024*1024*1024,bank:"0",type:c,ecc:!1,clockSpeed:null,formFactor:"SOC",manufacturer:t(u),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}n&&n(i),r(i)}),xo&&(n&&n(i),r(i)),mo){let s="Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"),o="Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");try{M.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl").then((a,l)=>{if(!l){let c=a.toString().split(/\n\s*\n/);c.shift(),c.forEach(function(u){let p=u.split(`\r
|
|
149
|
-
`),d=M.toInt(M.getValue(p,"DataWidth",":")),f=M.toInt(M.getValue(p,"TotalWidth",":")),m=parseInt(M.getValue(p,"Capacity",":"),10)||0,g=M.getValue(p,"Tag",":"),x=M.splitByNumber(g);m&&i.push({size:m,bank:M.getValue(p,"BankLabel",":")+(x[1]?"/"+x[1]:""),type:s[parseInt(M.getValue(p,"MemoryType",":"),10)||parseInt(M.getValue(p,"SMBIOSMemoryType",":"),10)],ecc:d&&f?f>d:!1,clockSpeed:parseInt(M.getValue(p,"ConfiguredClockSpeed",":"),10)||parseInt(M.getValue(p,"Speed",":"),10)||0,formFactor:o[parseInt(M.getValue(p,"FormFactor",":"),10)||0],manufacturer:M.getValue(p,"Manufacturer",":"),partNum:M.getValue(p,"PartNumber",":"),serialNum:M.getValue(p,"SerialNumber",":"),voltageConfigured:(parseInt(M.getValue(p,"ConfiguredVoltage",":"),10)||0)/1e3,voltageMin:(parseInt(M.getValue(p,"MinVoltage",":"),10)||0)/1e3,voltageMax:(parseInt(M.getValue(p,"MaxVoltage",":"),10)||0)/1e3})})}n&&n(i),r(i)})}catch{n&&n(i),r(i)}}})})}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
|
-
`);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
|
-
`),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
|
-
`);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
|
-
`).filter(u=>u),c=i.results[2].split(`\r
|
|
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"),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
|
-
`);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&&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
|
-
`);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
|
-
`),y=V.getValue(h,"MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);if(y){let S=parseInt(V.getValue(h,"HardwareInformation.qwMemorySize"));if(!isNaN(S)){let _=y[1].toUpperCase()+"&"+y[2].toUpperCase();y[3]&&(_+="&"+y[3].toUpperCase()),y[4]&&(_+="&"+y[4].toUpperCase()),m[_]=S}}}let g=[];for(let x in d)if({}.hasOwnProperty.call(d,x)&&d[x].trim()!==""){let h=d[x].trim().split(`
|
|
164
|
-
`),y=V.getValue(h,"PNPDeviceID",":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i),S=null,_=null;if(y){if(S=y[3]||"",S&&(S=S.split("_")[1]),_==null&&y[3]&&y[4]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null&&y[3]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null&&y[4]){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}if(_==null){let C=y[1].toUpperCase()+"&"+y[2].toUpperCase();({}).hasOwnProperty.call(m,C)&&(_=m[C])}}g.push({vendor:V.getValue(h,"AdapterCompatibility",":"),model:V.getValue(h,"name",":"),bus:V.getValue(h,"PNPDeviceID",":").startsWith("PCI")?"PCI":"",vram:(_??V.toInt(V.getValue(h,"AdapterRAM",":")))/1024/1024,vramDynamic:V.getValue(h,"VideoMemoryType",":")==="2",subDeviceId:S}),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
|
-
`);y=V.getValue(T,"MonitorManufacturer",":"),S=V.getValue(T,"Name",":"),_=V.getValue(T,"PNPDeviceID",":").replace(/&/g,"&").toLowerCase(),C=V.toInt(V.getValue(T,"ScreenWidth",":")),D=V.toInt(V.getValue(T,"ScreenHeight",":"))}for(let T=0;T<d.length;T++)if(d[T].trim()!==""){d[T]="BitsPerPixel "+d[T],f[T]="Active "+f[T],(g.length===0||g[T]===void 0)&&(g[T]="Unknown");let ee=d[T].split(`
|
|
166
|
-
`),E=f[T].split(`
|
|
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",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
|
-
`);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
|
-
`).filter(p=>!p.startsWith("/")&&p.indexOf(":")>0),Et("mount").toString().split(`
|
|
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
|
-
`).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(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
|
-
`),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
|
-
`);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
|
-
`);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)}}),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
|
-
`),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
|
-
`),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
|
-
`)}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
|
-
`);e=zs(a),e=Ao(e)}n&&n(e),t(e)});else{let s=Hs(i).split(`
|
|
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)}),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
|
-
`),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
|
-
`).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
|
-
"`,{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(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
|
-
`).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
|
-
"`,{maxBuffer:1024*1024},function(l,c){l||(c.toString().split(`
|
|
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(`
|
|
192
|
-
`);u=zs(f).filter(g=>g.type==="disk"&&g.size>0&&(g.model!==null&&g.model!==""||g.mount===""&&g.label===""&&g.fsType===""))}catch{I.noop()}}u.forEach(p=>{let d="",f="/dev/"+p.name,m=p.name;try{d=Et("cat /sys/block/"+m+"/queue/rotational 2>/dev/null",I.execOptsLinux).toString().split(`
|
|
193
|
-
`)[0]}catch{I.noop()}let g=p.tran?p.tran.toUpperCase().trim():"";g==="NVME"&&(d="2",g="PCIe"),i.push({device:f,type:d==="0"?"SSD":d==="1"?"HD":d==="2"?"NVMe":p.model&&p.model.indexOf("SSD")>-1?"SSD":p.model&&p.model.indexOf("NVM")>-1?"NVMe":"HD",name:p.model||"",vendor:t(p.model)||(p.vendor?p.vendor.trim():""),size:p.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:p.rev?p.rev.trim():"",serialNum:p.serial?p.serial.trim():"",interfaceType:g,smartStatus:"unknown",temperature:null,BSDName:f}),s+=`printf "
|
|
194
|
-
${f}|"; smartctl -H ${f} | grep overall;`,o+=`${o?'printf ",";':""}smartctl -a -j ${f};`})}catch{I.noop()}o?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
|
-
"`,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)),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
|
-
`),c=[],u=[],p=[],d="SATA";l.forEach(f=>{f==="NVMExpress:"?d="NVMe":f==="USB:"?d="USB":f==="SATA/SATA Express:"?d="SATA":d==="SATA"?c.push(f):d==="NVMe"?u.push(f):d==="USB"&&p.push(f)});try{let f=c.join(`
|
|
198
|
-
`).split(" Physical Interconnect: ");f.shift(),f.forEach(function(m){m="InterfaceType: "+m;let g=m.split(`
|
|
199
|
-
`),x=I.getValue(g,"Medium Type",":",!0).trim(),h=I.getValue(g,"capacity",":",!0).trim(),y=I.getValue(g,"BSD Name",":",!0).trim();if(h){let S=0;if(h.indexOf("(")>=0&&(S=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),S||(S=parseInt(h)),S){let _=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:x.startsWith("Solid")?"SSD":"HD",name:I.getValue(g,"Model",":",!0).trim(),vendor:t(I.getValue(g,"Model",":",!0).trim())||I.getValue(g,"Manufacturer",":",!0),size:S,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:I.getValue(g,"InterfaceType",":",!0).trim(),smartStatus:_==="verified"?"OK":_||"unknown",temperature:null,BSDName:y}),s=s+`printf "
|
|
200
|
-
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{I.noop()}try{let f=u.join(`
|
|
201
|
-
`).split(`
|
|
202
|
-
|
|
203
|
-
Capacity:`);f.shift(),f.forEach(function(m){m="!Capacity: "+m;let g=m.split(`
|
|
204
|
-
`),x=I.getValue(g,"link width",":",!0).trim(),h=I.getValue(g,"!capacity",":",!0).trim(),y=I.getValue(g,"BSD Name",":",!0).trim();if(h){let S=0;if(h.indexOf("(")>=0&&(S=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),S||(S=parseInt(h)),S){let _=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:"NVMe",name:I.getValue(g,"Model",":",!0).trim(),vendor:t(I.getValue(g,"Model",":",!0).trim()),size:S,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+x).trim(),smartStatus:_==="verified"?"OK":_||"unknown",temperature:null,BSDName:y}),s=s+`printf "
|
|
205
|
-
`+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{I.noop()}try{let f=p.join(`
|
|
206
|
-
`).replaceAll(`Media:
|
|
207
|
-
`,"Model:").split(`
|
|
208
|
-
|
|
209
|
-
Product ID:`);f.shift(),f.forEach(function(m){let g=m.split(`
|
|
210
|
-
`),x=I.getValue(g,"Capacity",":",!0).trim(),h=I.getValue(g,"BSD Name",":",!0).trim();if(x){let y=0;if(x.indexOf("(")>=0&&(y=parseInt(x.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),y||(y=parseInt(x)),y){let S=I.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:h,type:"USB",name:I.getValue(g,"Model",":",!0).trim().replaceAll(":",""),vendor:t(I.getValue(g,"Model",":",!0).trim()),size:y,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:I.getValue(g,"Revision",":",!0).trim(),serialNum:I.getValue(g,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:S==="verified"?"OK":S||"unknown",temperature:null,BSDName:h}),s=s+`printf "
|
|
211
|
-
`+h+'|"; diskutil info /dev/'+h+" | grep SMART;"}}})}catch{I.noop()}if(s)s=s+`printf "
|
|
212
|
-
"`,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)}}}),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
|
-
`),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="",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
|
-
`)[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
|
-
`)[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
|
-
`);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(`
|
|
219
|
-
`);for(let o=0;o<s.length;o++)if(s[o]&&s[o][0]!==" "){if(hn){let a=s[o+1].trim().split(" ");a[0]==="link/ether"&&(n=s[o].split(" ")[1],n=n.slice(0,n.length-1),t=a[1])}else n=s[o].split(" ")[0],t=s[o].split("HWaddr ")[1];n&&t&&(e[n]=t.trim(),n="",t="")}}catch{P.noop()}}if(ct)try{let s=de("/sbin/ifconfig").toString().split(`
|
|
220
|
-
`);for(let o=0;o<s.length;o++)s[o]&&s[o][0]!==" "&&s[o].indexOf(":")>0?n=s[o].split(":")[0]:s[o].indexOf(" ether ")===0&&(t=s[o].split(" ether ")[1],n&&t&&(e[n]=t.trim(),n="",t=""))}catch{P.noop()}return e}function Zu(n){return new Promise(t=>{process.nextTick(()=>{let e=gn();n&&n(e),t(e)})})}yn.networkInterfaceDefault=Zu;function Ju(n,t){let e=[];for(let r in n)try{if({}.hasOwnProperty.call(n,r)&&n[r].trim()!==""){let i=n[r].trim().split(`\r
|
|
221
|
-
`),s=null;try{s=t&&t[r]?t[r].trim().split(`\r
|
|
222
|
-
`):[]}catch{P.noop()}let o=P.getValue(i,"NetEnabled",":"),a=P.getValue(i,"AdapterTypeID",":")==="9"?"wireless":"wired",l=P.getValue(i,"Name",":").replace(/\]/g,")").replace(/\[/g,"("),c=P.getValue(i,"NetConnectionID",":").replace(/\]/g,")").replace(/\[/g,"(");if((l.toLowerCase().indexOf("wi-fi")>=0||l.toLowerCase().indexOf("wireless")>=0)&&(a="wireless"),o!==""){let u=parseInt(P.getValue(i,"speed",":").trim(),10)/1e6;e.push({mac:P.getValue(i,"MACAddress",":").toLowerCase(),dhcp:P.getValue(s,"dhcpEnabled",":").toLowerCase()==="true",name:l,iface:c,netEnabled:o==="TRUE",speed:isNaN(u)?null:u,operstate:P.getValue(i,"NetConnectionStatus",":")==="2"?"up":"down",type:a})}}}catch{P.noop()}return e}function Qu(){return new Promise(n=>{process.nextTick(()=>{let t="Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";t+="Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";try{P.powerShell(t).then(e=>{e=e.split("#-#-#-#");let r=(e[0]||"").split(/\n\s*\n/),i=(e[1]||"").split(/\n\s*\n/);n(Ju(r,i))})}catch{n([])}})})}function ep(){let n={},t={primaryDNS:"",exitCode:0,ifaces:[]};try{return de("ipconfig /all",P.execOptsWin).split(`\r
|
|
223
|
-
\r
|
|
224
|
-
`).forEach((i,s)=>{if(s==1){let o=i.split(`\r
|
|
225
|
-
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);t.primaryDNS=a.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(s>1)if(s%2==0){let o=i.substring(i.lastIndexOf(" ")+1).replace(":","");n.name=o}else{let o=i.split(`\r
|
|
226
|
-
`).filter(l=>l.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);n.dnsSuffix=a.trim(),t.ifaces.push(n),n={}}}),t}catch{return{primaryDNS:"",exitCode:0,ifaces:[]}}}function tp(n,t){let e="",r=t+".";try{let i=n.filter(s=>r.includes(s.name+".")).map(s=>s.dnsSuffix);return i[0]&&(e=i[0]),e||(e=""),e}catch{return"Unknown"}}function np(){try{return de("netsh lan show profiles",P.execOptsWin).split(`\r
|
|
227
|
-
Profile on interface`)}catch(n){return n.status===1&&n.stdout.includes("AutoConfig")?"Disabled":[]}}function rp(n){try{return de(`netsh wlan show interface name="${n}" | findstr "SSID"`,P.execOptsWin).split(`\r
|
|
228
|
-
`).shift().split(":").pop().trim()}catch{return"Unknown"}}function sp(n,t,e){let r={state:"Unknown",protocol:"Unknown"};if(e==="Disabled")return r.state="Disabled",r.protocol="Not defined",r;if(n=="wired"&&e.length>0)try{let s=e.find(a=>a.includes(t+`\r
|
|
229
|
-
`)).split(`\r
|
|
230
|
-
`),o=s.find(a=>a.includes("802.1x"));if(o.includes("Disabled"))r.state="Disabled",r.protocol="Not defined";else if(o.includes("Enabled")){let a=s.find(l=>l.includes("EAP"));r.protocol=a.split(":").pop(),r.state="Enabled"}}catch{return r}else if(n=="wireless"){let i="",s="";try{let o=rp(t);if(o!=="Unknown"){let a="",l=P.isPrototypePolluted()?"---":P.sanitizeShellString(o),c=P.mathMin(l.length,32);for(let u=0;u<=c;u++)l[u]!==void 0&&(a=a+l[u]);i=de(`netsh wlan show profiles "${a}" | findstr "802.1X"`,P.execOptsWin),s=de(`netsh wlan show profiles "${a}" | findstr "EAP"`,P.execOptsWin)}i.includes(":")&&s.includes(":")&&(r.state=i.split(":").pop(),r.protocol=s.split(":").pop())}catch(o){return o.status===1&&o.stdout.includes("AutoConfig")&&(r.state="Disabled",r.protocol="Not defined"),r}}return r}function Bo(n){let t=[],e=[];return n.forEach(function(r){!r.startsWith(" ")&&!r.startsWith(" ")&&e.length&&(t.push(e),e=[]),e.push(r)}),e.length&&t.push(e),t}function ip(n){let t=[];return n.forEach(e=>{let r={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1},i=e[0];r.iface=i.split(":")[0].trim();let s=i.split("> mtu");r.mtu=s.length>1?parseInt(s[1],10):null,isNaN(r.mtu)&&(r.mtu=null),r.internal=s[0].toLowerCase().indexOf("loopback")>-1,e.forEach(l=>{l.trim().startsWith("ether ")&&(r.mac=l.split("ether ")[1].toLowerCase().trim()),l.trim().startsWith("inet6 ")&&!r.ip6&&(r.ip6=l.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),l.trim().startsWith("inet ")&&!r.ip4&&(r.ip4=l.split("inet ")[1].toLowerCase().split(" ")[0])});let o=P.getValue(e,"link rate");r.speed=o?parseFloat(o):null,r.speed===null?(o=P.getValue(e,"uplink rate"),r.speed=o?parseFloat(o):null,r.speed!==null&&o.toLowerCase().indexOf("gbps")>=0&&(r.speed=r.speed*1e3)):o.toLowerCase().indexOf("gbps")>=0&&(r.speed=r.speed*1e3),r.type=P.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired";let a=P.getValue(e,"status").toLowerCase();r.operstate=a==="active"?"up":a==="inactive"?"down":"unknown",r.duplex=P.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(r.ip6||r.ip4||r.mac)&&t.push(r)}),t}function op(){let n="/sbin/ifconfig -v";try{let t=de(n,{maxBuffer:2048e4}).toString().split(`
|
|
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
|
-
`).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
|
-
`),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(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
|
-
echo -n "address: "; cat /sys/class/net/${z}/address 2>/dev/null; echo;
|
|
236
|
-
echo -n "addr_len: "; cat /sys/class/net/${z}/addr_len 2>/dev/null; echo;
|
|
237
|
-
echo -n "broadcast: "; cat /sys/class/net/${z}/broadcast 2>/dev/null; echo;
|
|
238
|
-
echo -n "carrier: "; cat /sys/class/net/${z}/carrier 2>/dev/null; echo;
|
|
239
|
-
echo -n "carrier_changes: "; cat /sys/class/net/${z}/carrier_changes 2>/dev/null; echo;
|
|
240
|
-
echo -n "dev_id: "; cat /sys/class/net/${z}/dev_id 2>/dev/null; echo;
|
|
241
|
-
echo -n "dev_port: "; cat /sys/class/net/${z}/dev_port 2>/dev/null; echo;
|
|
242
|
-
echo -n "dormant: "; cat /sys/class/net/${z}/dormant 2>/dev/null; echo;
|
|
243
|
-
echo -n "duplex: "; cat /sys/class/net/${z}/duplex 2>/dev/null; echo;
|
|
244
|
-
echo -n "flags: "; cat /sys/class/net/${z}/flags 2>/dev/null; echo;
|
|
245
|
-
echo -n "gro_flush_timeout: "; cat /sys/class/net/${z}/gro_flush_timeout 2>/dev/null; echo;
|
|
246
|
-
echo -n "ifalias: "; cat /sys/class/net/${z}/ifalias 2>/dev/null; echo;
|
|
247
|
-
echo -n "ifindex: "; cat /sys/class/net/${z}/ifindex 2>/dev/null; echo;
|
|
248
|
-
echo -n "iflink: "; cat /sys/class/net/${z}/iflink 2>/dev/null; echo;
|
|
249
|
-
echo -n "link_mode: "; cat /sys/class/net/${z}/link_mode 2>/dev/null; echo;
|
|
250
|
-
echo -n "mtu: "; cat /sys/class/net/${z}/mtu 2>/dev/null; echo;
|
|
251
|
-
echo -n "netdev_group: "; cat /sys/class/net/${z}/netdev_group 2>/dev/null; echo;
|
|
252
|
-
echo -n "operstate: "; cat /sys/class/net/${z}/operstate 2>/dev/null; echo;
|
|
253
|
-
echo -n "proto_down: "; cat /sys/class/net/${z}/proto_down 2>/dev/null; echo;
|
|
254
|
-
echo -n "speed: "; cat /sys/class/net/${z}/speed 2>/dev/null; echo;
|
|
255
|
-
echo -n "tx_queue_len: "; cat /sys/class/net/${z}/tx_queue_len 2>/dev/null; echo;
|
|
256
|
-
echo -n "type: "; cat /sys/class/net/${z}/type 2>/dev/null; echo;
|
|
257
|
-
echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${z}; echo;
|
|
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})}}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
|
-
`);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
|
-
`),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
|
-
`);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(`
|
|
263
|
-
`),g.length>1&&g[1].trim()!=="")){x=g[1].replace(/ +/g," ").split(" ");let C=x.length>11?1:0;l=parseInt(x[C+5]),u=parseInt(x[C+10]),p=parseInt(x[C+4]),c=parseInt(x[C+8]),d=parseInt(x[C+10]),f=parseInt(x[C+7]),o=ss(r,l,c,o.operstate,u,p,d,f)}e(o)})})),pr){let h=[],y=r;P.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then((S,_)=>{if(!_){let C=S.toString().split(/\n\s*\n/);h=t(C)}qs(!1).then(C=>{l=0,c=0,h.forEach(D=>{C.forEach(T=>{(T.iface.toLowerCase()===r.toLowerCase()||T.mac.toLowerCase()===r.toLowerCase()||T.ip4.toLowerCase()===r.toLowerCase()||T.ip6.toLowerCase()===r.toLowerCase()||T.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===r.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase())&&T.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===D.name&&(y=T.iface,l=D.rx_bytes,u=D.rx_dropped,p=D.rx_errors,c=D.tx_bytes,d=D.tx_dropped,f=D.tx_errors,a=T.operstate)})}),l&&c&&(o=ss(y,parseInt(l),parseInt(c),a,u,p,d,f)),e(o)})})}}else o.rx_bytes=te[r].rx_bytes,o.tx_bytes=te[r].tx_bytes,o.rx_sec=te[r].rx_sec,o.tx_sec=te[r].tx_sec,o.ms=te[r].last_ms,o.operstate=te[r].operstate,e(o)})})}yn.networkStats=Fo;function gp(n,t){let e="";return n.forEach(r=>{let i=r.split(" ");(parseInt(i[0],10)||-1)===t&&(i.shift(),e=i.join(" ").split(":")[0])}),e=e.split(" -")[0],e=e.split(" /")[0],e}function yp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(lt||Mt||bt||Dt){let r='export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';(Mt||bt||Dt)&&(r='export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'),be(r,{maxBuffer:1024*2e4},function(i,s){let o=s.toString().split(`
|
|
264
|
-
`);!i&&(o.length>1||o[0]!="")?(o.forEach(function(a){if(a=a.replace(/ +/g," ").split(" "),a.length>=7){let l=a[3],c="",u=a[3].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":"));let p=a[4],d="",f=a[4].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":"));let m=a[5],g=a[6].split("/");m&&e.push({protocol:a[0],localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:m,pid:g[0]&&g[0]!=="-"?parseInt(g[0],10):null,process:g[1]?g[1].split(" ")[0].split(":")[0]:""})}}),n&&n(e),t(e)):(r='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',be(r,{maxBuffer:1024*2e4},function(a,l){a||l.toString().split(`
|
|
265
|
-
`).forEach(function(u){if(u=u.replace(/ +/g," ").split(" "),u.length>=6){let p=u[4],d="",f=u[4].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":"));let m=u[5],g="",x=u[5].split(":");x.length>1&&(g=x[x.length-1],x.pop(),m=x.join(":"));let h=u[1];h==="ESTAB"&&(h="ESTABLISHED"),h==="TIME-WAIT"&&(h="TIME_WAIT");let y=null,S="";if(u.length>=7&&u[6].indexOf("users:")>-1){let _=u[6].replace('users:(("',"").replace(/"/g,"").split(",");_.length>2&&(S=_[0].split(" ")[0].split(":")[0],y=parseInt(_[1],10))}h&&e.push({protocol:u[0],localAddress:p,localPort:d,peerAddress:m,peerPort:g,state:h,pid:y,process:S})}}),n&&n(e),t(e)}))})}if(ct){let r='netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"',i="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN".split("|");be(r,{maxBuffer:1024*2e4},function(s,o){s||be("ps -axo pid,command",{maxBuffer:1024*2e4},function(a,l){let c=l.toString().split(`
|
|
266
|
-
`);c=c.map(d=>d.trim().replace(/ +/g," "));let u=o.toString().split(`
|
|
267
|
-
`);u.shift();let p=8;u.length>1&&u[0].indexOf("pid")>0&&(p=(u.shift()||"").replace(/ Address/g,"_Address").replace(/ +/g," ").split(" ").indexOf("pid")),u.forEach(function(d){if(d=d.replace(/ +/g," ").split(" "),d.length>=8){let f=d[3],m="",g=d[3].split(".");g.length>1&&(m=g[g.length-1],g.pop(),f=g.join("."));let x=d[4],h="",y=d[4].split(".");y.length>1&&(h=y[y.length-1],y.pop(),x=y.join("."));let S=i.indexOf(d[5])>=0,_=S?d[5]:"UNKNOWN",C=parseInt(d[p+(S?0:-1)],10);_&&e.push({protocol:d[0],localAddress:f,localPort:m,peerAddress:x,peerPort:h,state:_,pid:C,process:gp(c,C)})}}),n&&n(e),t(e)})})}if(pr){let r="netstat -nao";try{be(r,P.execOptsWin,function(i,s){i||(s.toString().split(`\r
|
|
268
|
-
`).forEach(function(a){if(a=a.trim().replace(/ +/g," ").split(" "),a.length>=4){let l=a[1],c="",u=a[1].split(":");u.length>1&&(c=u[u.length-1],u.pop(),l=u.join(":")),l=l.replace(/\[/g,"").replace(/\]/g,"");let p=a[2],d="",f=a[2].split(":");f.length>1&&(d=f[f.length-1],f.pop(),p=f.join(":")),p=p.replace(/\[/g,"").replace(/\]/g,"");let m=P.toInt(a[4]),g=a[3];g==="HERGESTELLT"&&(g="ESTABLISHED"),g.startsWith("ABH")&&(g="LISTEN"),g==="SCHLIESSEN_WARTEN"&&(g="CLOSE_WAIT"),g==="WARTEND"&&(g="TIME_WAIT"),g==="SYN_GESENDET"&&(g="SYN_SENT"),g==="LISTENING"&&(g="LISTEN"),g==="SYN_RECEIVED"&&(g="SYN_RECV"),g==="FIN_WAIT_1"&&(g="FIN_WAIT1"),g==="FIN_WAIT_2"&&(g="FIN_WAIT2"),a[0].toLowerCase()!=="udp"&&g?e.push({protocol:a[0].toLowerCase(),localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:g,pid:m,process:""}):a[0].toLowerCase()==="udp"&&e.push({protocol:a[0].toLowerCase(),localAddress:l,localPort:c,peerAddress:p,peerPort:d,state:"",pid:parseInt(a[3],10),process:""})}}),n&&n(e),t(e))})}catch{n&&n(e),t(e)}}})})}yn.networkConnections=yp;function xp(n){return new Promise(t=>{process.nextTick(()=>{let e="";if(lt||Mt||bt||Dt){let r="ip route get 1";try{be(r,{maxBuffer:1024*2e4},function(i,s){if(i)n&&n(e),t(e);else{let o=s.toString().split(`
|
|
269
|
-
`),l=(o&&o[0]?o[0]:"").split(" via ");l&&l[1]&&(l=l[1].split(" "),e=l[0]),n&&n(e),t(e)}})}catch{n&&n(e),t(e)}}if(ct){let r="route -n get default";try{be(r,{maxBuffer:1024*2e4},function(i,s){if(!i){let o=s.toString().split(`
|
|
270
|
-
`).map(a=>a.trim());e=P.getValue(o,"gateway")}e?(n&&n(e),t(e)):(r="netstat -rn | awk '/default/ {print $2}'",be(r,{maxBuffer:1024*2e4},function(o,a){e=a.toString().split(`
|
|
271
|
-
`).map(c=>c.trim()).find(c=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(c)),n&&n(e),t(e)}))})}catch{n&&n(e),t(e)}}if(pr)try{be("netstat -r",P.execOptsWin,function(r,i){i.toString().split(is.EOL).forEach(o=>{if(o=o.replace(/\s+/g," ").trim(),o.indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(o)){let a=o.split(" ");a.length>=5&&a[a.length-3].indexOf(".")>-1&&(e=a[a.length-3])}}),e?(n&&n(e),t(e)):P.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then(o=>{let a=o.toString().split(`\r
|
|
272
|
-
`);a.length>1&&!e&&(e=P.getValue(a,"NextHop"),n&&n(e),t(e))})})}catch{n&&n(e),t(e)}})})}yn.networkGatewayDefault=xp});var jo=ae(ls=>{"use strict";var dr=k("os"),Ks=k("child_process").exec,Nt=k("child_process").execSync,A=pe(),os=process.platform,$s=os==="linux"||os==="android",Ys=os==="darwin",Xs=os==="win32";function Zs(n){let t=parseFloat(n);return t<0?0:t>=100?-50:t/2-100}function as(n){let t=2*(parseFloat(n)+100);return t<=100?t:100}var fr={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484,32:5160,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,50:5250,52:5260,54:5270,56:5280,58:5290,60:5300,62:5310,64:5320,68:5340,96:5480,100:5500,102:5510,104:5520,106:5530,108:5540,110:5550,112:5560,114:5570,116:5580,118:5590,120:5600,122:5610,124:5620,126:5630,128:5640,132:5660,134:5670,136:5680,138:5690,140:5700,142:5710,144:5720,149:5745,151:5755,153:5765,155:5775,157:5785,159:5795,161:5805,165:5825,169:5845,173:5865,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};function mr(n){return{}.hasOwnProperty.call(fr,n)?fr[n]:null}function Sp(n){let t=0;for(let e in fr)({}).hasOwnProperty.call(fr,e)&&fr[e]===n&&(t=A.toInt(e));return t}function Uo(){let n=[],t="iw dev 2>/dev/null";try{let r=Nt(t,A.execOptsLinux).toString().split(`
|
|
273
|
-
`).map(i=>i.trim()).join(`
|
|
274
|
-
`).split(`
|
|
275
|
-
Interface `);return r.shift(),r.forEach(i=>{let s=i.split(`
|
|
276
|
-
`),o=s[0],a=A.toInt(A.getValue(s,"ifindex"," ")),l=A.getValue(s,"addr"," "),c=A.toInt(A.getValue(s,"channel"," "));n.push({id:a,iface:o,mac:l,channel:c})}),n}catch{try{let i=Nt("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null",A.execOptsLinux).toString().split(`
|
|
277
|
-
|
|
278
|
-
`),s=1;return i.forEach(o=>{let a=o.split(`
|
|
279
|
-
`),l=A.getValue(a,"GENERAL.DEVICE"),c=A.getValue(a,"GENERAL.TYPE"),u=s++,p=A.getValue(a,"GENERAL.HWADDR");c.toLowerCase()==="wifi"&&n.push({id:u,iface:l,mac:p,channel:""})}),n}catch{return[]}}}function zo(n){let t=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${n} 2> /dev/null`;try{let e=Nt(t,A.execOptsLinux).toString().split(`
|
|
280
|
-
`),r=A.getValue(e,"GENERAL.CONNECTION");return{iface:n,type:A.getValue(e,"GENERAL.TYPE"),vendor:A.getValue(e,"GENERAL.VENDOR"),product:A.getValue(e,"GENERAL.PRODUCT"),mac:A.getValue(e,"GENERAL.HWADDR").toLowerCase(),ssid:r!=="--"?r:null}}catch{return{}}}function _p(n){let t=`nmcli -t --show-secrets connection show ${n} 2>/dev/null`;try{let e=Nt(t,A.execOptsLinux).toString().split(`
|
|
281
|
-
`),r=A.getValue(e,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:n!=="--"?n:null,uuid:A.getValue(e,"connection.uuid"),type:A.getValue(e,"connection.type"),autoconnect:A.getValue(e,"connection.autoconnect")==="yes",security:A.getValue(e,"802-11-wireless-security.key-mgmt"),bssid:r!=="--"?r:null}}catch{return{}}}function Cp(n){if(!n)return{};let t=`wpa_cli -i ${n} status 2>&1`;try{let e=Nt(t,A.execOptsLinux).toString().split(`
|
|
282
|
-
`),r=A.toInt(A.getValue(e,"freq","="));return{ssid:A.getValue(e,"ssid","="),uuid:A.getValue(e,"uuid","="),security:A.getValue(e,"key_mgmt","="),freq:r,channel:Sp(r),bssid:A.getValue(e,"bssid","=").toLowerCase()}}catch{return{}}}function Ho(){let n=[],t="nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null";try{let r=Nt(t,A.execOptsLinux).toString().split("ACTIVE:");return r.shift(),r.forEach(i=>{i="ACTIVE:"+i;let s=i.split(dr.EOL),o=A.getValue(s,"CHAN"),a=A.getValue(s,"FREQ").toLowerCase().replace("mhz","").trim(),l=A.getValue(s,"SECURITY").replace("(","").replace(")",""),c=A.getValue(s,"WPA-FLAGS").replace("(","").replace(")",""),u=A.getValue(s,"RSN-FLAGS").replace("(","").replace(")",""),p=A.getValue(s,"SIGNAL");n.push({ssid:A.getValue(s,"SSID"),bssid:A.getValue(s,"BSSID").toLowerCase(),mode:A.getValue(s,"MODE"),channel:o?parseInt(o,10):null,frequency:a?parseInt(a,10):null,signalLevel:Zs(p),quality:p?parseInt(p,10):null,security:l&&l!=="none"?l.split(" "):[],wpaFlags:c&&c!=="none"?c.split(" "):[],rsnFlags:u&&u!=="none"?u.split(" "):[]})}),n}catch{return[]}}function Wo(n){let t=[];try{let e=Nt(`export LC_ALL=C; iwlist ${n} scan 2>&1; unset LC_ALL`,A.execOptsLinux).toString().split(" Cell ");return e[0].indexOf("resource busy")>=0?-1:(e.length>1&&(e.shift(),e.forEach(r=>{let i=r.split(`
|
|
283
|
-
`),s=A.getValue(i,"channel",":",!0),o=i&&i.length&&i[0].indexOf("Address:")>=0?i[0].split("Address:")[1].trim().toLowerCase():"",a=A.getValue(i,"mode",":",!0),l=A.getValue(i,"frequency",":",!0),u=A.getValue(i,"Quality","=",!0).toLowerCase().split("signal level="),p=u.length>1?A.toInt(u[1]):0,d=p?as(p):0,f=A.getValue(i,"essid",":",!0),m=r.indexOf(" WPA ")>=0,g=r.indexOf("WPA2 ")>=0,x=[];m&&x.push("WPA"),g&&x.push("WPA2");let h=[],y="";i.forEach(function(S){let _=S.trim().toLowerCase();if(_.indexOf("group cipher")>=0){y&&h.push(y);let C=_.split(":");C.length>1&&(y=C[1].trim().toUpperCase())}if(_.indexOf("pairwise cipher")>=0){let C=_.split(":");C.length>1&&(C[1].indexOf("tkip")?y=y?"TKIP/"+y:"TKIP":C[1].indexOf("ccmp")?y=y?"CCMP/"+y:"CCMP":C[1].indexOf("proprietary")&&(y=y?"PROP/"+y:"PROP"))}if(_.indexOf("authentication suites")>=0){let C=_.split(":");C.length>1&&(C[1].indexOf("802.1x")?y=y?"802.1x/"+y:"802.1x":C[1].indexOf("psk")&&(y=y?"PSK/"+y:"PSK"))}}),y&&h.push(y),t.push({ssid:f,bssid:o,mode:a,channel:s?A.toInt(s):null,frequency:l?A.toInt(l.replace(".","")):null,signalLevel:p,quality:d,security:x,wpaFlags:h,rsnFlags:[]})})),t)}catch{return-1}}function vp(n){let t=[];try{let e=JSON.parse(n);return e=e.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_airport_other_local_wireless_networks,e.forEach(function(r){let i=[],s=r.spairport_security_mode;s==="spairport_security_mode_wep"?i.push("WEP"):s==="spairport_security_mode_wpa2_personal"?i.push("WPA2"):s.startsWith("spairport_security_mode_wpa2_enterprise")?i.push("WPA2 EAP"):s.startsWith("pairport_security_mode_wpa3_transition")?i.push("WPA2/WPA3"):s.startsWith("pairport_security_mode_wpa3")&&i.push("WPA3");let o=parseInt((""+r.spairport_network_channel).split(" ")[0])||0,a=r.spairport_signal_noise||null;t.push({ssid:r._name||"",bssid:r.spairport_network_bssid||null,mode:r.spairport_network_phymode,channel:o,frequency:mr(o),signalLevel:a?parseInt(a,10):null,quality:as(a),security:i,wpaFlags:[],rsnFlags:[]})}),t}catch{return t}}function wp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if($s)if(e=Ho(),e.length===0)try{let r=Nt("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL",A.execOptsLinux).toString().split(`
|
|
284
|
-
|
|
285
|
-
`),i="";if(r.forEach(s=>{s.indexOf("no wireless")===-1&&s.trim()!==""&&(i=s.split(" ")[0])}),i){let s="",o=A.isPrototypePolluted()?"---":A.sanitizeShellString(i,!0),a=A.mathMin(o.length,2e3);for(let c=0;c<=a;c++)o[c]!==void 0&&(s=s+o[c]);let l=Wo(s);l===-1?setTimeout(function(c){let u=Wo(c);u!=-1&&(e=u),n&&n(e),t(e)},4e3):(e=l,n&&n(e),t(e))}else n&&n(e),t(e)}catch{n&&n(e),t(e)}else n&&n(e),t(e);else Ys?Ks("system_profiler SPAirPortDataType -json 2>/dev/null",{maxBuffer:1024*4e4},function(i,s){e=vp(s.toString()),n&&n(e),t(e)}):Xs?A.powerShell("netsh wlan show networks mode=Bssid").then(i=>{let s=i.toString("utf8").split(dr.EOL+dr.EOL+"SSID ");s.shift(),s.forEach(o=>{let a=o.split(dr.EOL);if(a&&a.length>=8&&a[0].indexOf(":")>=0){let l=o.split(" BSSID");l.shift(),l.forEach(c=>{let u=c.split(dr.EOL),p=u[0].split(":");p.shift();let d=p.join(":").trim().toLowerCase(),f=u[3].split(":").pop().trim(),m=u[1].split(":").pop().trim();e.push({ssid:a[0].split(":").pop().trim(),bssid:d,mode:"",channel:f?parseInt(f,10):null,frequency:mr(f),signalLevel:Zs(m),quality:m?parseInt(m,10):null,security:[a[2].split(":").pop().trim()],wpaFlags:[a[3].split(":").pop().trim()],rsnFlags:[]})})}}),n&&n(e),t(e)}):(n&&n(e),t(e))})})}ls.wifiNetworks=wp;function Ip(n){n=n.toLowerCase();let t="";return n.indexOf("intel")>=0?t="Intel":n.indexOf("realtek")>=0?t="Realtek":n.indexOf("qualcom")>=0?t="Qualcom":n.indexOf("broadcom")>=0?t="Broadcom":n.indexOf("cavium")>=0?t="Cavium":n.indexOf("cisco")>=0?t="Cisco":n.indexOf("marvel")>=0?t="Marvel":n.indexOf("zyxel")>=0?t="Zyxel":n.indexOf("melanox")>=0?t="Melanox":n.indexOf("d-link")>=0?t="D-Link":n.indexOf("tp-link")>=0?t="TP-Link":n.indexOf("asus")>=0?t="Asus":n.indexOf("linksys")>=0&&(t="Linksys"),t}function Lp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if($s){let r=Uo(),i=Ho();r.forEach(s=>{let o="",a=A.isPrototypePolluted()?"---":A.sanitizeShellString(s.iface,!0),l=A.mathMin(a.length,2e3);for(let _=0;_<=l;_++)a[_]!==void 0&&(o=o+a[_]);let c=zo(o),u=Cp(o),p=c.ssid||u.ssid,d=i.filter(_=>_.ssid===p),f="",m=A.isPrototypePolluted()?"---":A.sanitizeShellString(p,!0),g=A.mathMin(m.length,32);for(let _=0;_<=g;_++)m[_]!==void 0&&(f=f+m[_]);let x=_p(f),h=d&&d.length&&d[0].channel?d[0].channel:u.channel?u.channel:null,y=d&&d.length&&d[0].bssid?d[0].bssid:u.bssid?u.bssid:null,S=d&&d.length&&d[0].signalLevel?d[0].signalLevel:null;p&&y&&e.push({id:s.id,iface:s.iface,model:c.product,ssid:p,bssid:d&&d.length&&d[0].bssid?d[0].bssid:u.bssid?u.bssid:null,channel:h,frequency:h?mr(h):null,type:x.type?x.type:"802.11",security:x.security?x.security:u.security?u.security:null,signalLevel:S,quality:as(S),txRate:null})}),n&&n(e),t(e)}else Ys?Ks('system_profiler SPNetworkDataType SPAirPortDataType -xml 2>/dev/null; echo "######" ; ioreg -n AppleBCMWLANSkywalkInterface -r 2>/dev/null',function(i,s){try{let o=s.toString().split("######"),a=A.plistParser(o[0]),l=a[0]._SPCommandLineArguments.indexOf("SPNetworkDataType")>=0?a[0]._items:a[1]._items,c=a[0]._SPCommandLineArguments.indexOf("SPAirPortDataType")>=0?a[0]._items[0].spairport_airport_interfaces:a[1]._items[0].spairport_airport_interfaces,u=[];o[1].indexOf(" | {")>0&&o[1].indexOf(" | }")>o[1].indexOf(" | {")&&(u=o[1].split(" | {")[1].split(" | }")[0].replace(/ \| /g,"").replace(/"/g,"").split(`
|
|
286
|
-
`));let p=l.find(h=>h._name==="Wi-Fi"),d=c[0].spairport_current_network_information,f=parseInt((""+d.spairport_network_channel).split(" ")[0])||0,m=d.spairport_signal_noise||null,g=[],x=d.spairport_security_mode;x==="spairport_security_mode_wep"?g.push("WEP"):x==="spairport_security_mode_wpa2_personal"?g.push("WPA2"):x.startsWith("spairport_security_mode_wpa2_enterprise")?g.push("WPA2 EAP"):x.startsWith("pairport_security_mode_wpa3_transition")?g.push("WPA2/WPA3"):x.startsWith("pairport_security_mode_wpa3")&&g.push("WPA3"),e.push({id:p._name||"Wi-Fi",iface:p.interface||"",model:p.hardware||"",ssid:d._name||"",bssid:d.spairport_network_bssid||"",channel:f,frequency:f?mr(f):null,type:d.spairport_network_phymode||"802.11",security:g,signalLevel:m?parseInt(m,10):null,quality:as(m),txRate:d.spairport_network_rate||null})}catch{A.noop()}n&&n(e),t(e)}):Xs?A.powerShell("netsh wlan show interfaces").then(function(i){let s=i.toString().split(`\r
|
|
287
|
-
`);for(let a=0;a<s.length;a++)s[a]=s[a].trim();let o=s.join(`\r
|
|
288
|
-
`).split(`:\r
|
|
289
|
-
\r
|
|
290
|
-
`);o.shift(),o.forEach(a=>{let l=a.split(`\r
|
|
291
|
-
`);if(l.length>=5){let c=l[0].indexOf(":")>=0?l[0].split(":")[1].trim():"",u=l[1].indexOf(":")>=0?l[1].split(":")[1].trim():"",p=l[2].indexOf(":")>=0?l[2].split(":")[1].trim():"",d=A.getValue(l,"SSID",":",!0),f=A.getValue(l,"BSSID",":",!0)||A.getValue(l,"AP BSSID",":",!0),m=A.getValue(l,"Signal",":",!0),g=Zs(m),x=A.getValue(l,"Radio type",":",!0)||A.getValue(l,"Type de radio",":",!0)||A.getValue(l,"Funktyp",":",!0)||null,h=A.getValue(l,"authentication",":",!0)||A.getValue(l,"Authentification",":",!0)||A.getValue(l,"Authentifizierung",":",!0)||null,y=A.getValue(l,"Channel",":",!0)||A.getValue(l,"Canal",":",!0)||A.getValue(l,"Kanal",":",!0)||null,S=A.getValue(l,"Transmit rate (mbps)",":",!0)||A.getValue(l,"Transmission (mbit/s)",":",!0)||A.getValue(l,"Empfangsrate (MBit/s)",":",!0)||null;u&&p&&d&&f&&e.push({id:p,iface:c,model:u,ssid:d,bssid:f,channel:A.toInt(y),frequency:y?mr(y):null,type:x,security:h,signalLevel:g,quality:m?parseInt(m,10):null,txRate:A.toInt(S)||null})}}),n&&n(e),t(e)}):(n&&n(e),t(e))})})}ls.wifiConnections=Lp;function Op(n){return new Promise(t=>{process.nextTick(()=>{let e=[];$s?(Uo().forEach(i=>{let s=zo(i.iface);e.push({id:i.id,iface:i.iface,model:s.product?s.product:null,vendor:s.vendor?s.vendor:null,mac:i.mac})}),n&&n(e),t(e)):Ys?Ks("system_profiler SPNetworkDataType",function(i,s){let o=s.toString().split(`
|
|
292
|
-
|
|
293
|
-
Wi-Fi:
|
|
294
|
-
|
|
295
|
-
`);if(o.length>1){let a=o[1].split(`
|
|
296
|
-
|
|
297
|
-
`)[0].split(`
|
|
298
|
-
`),l=A.getValue(a,"BSD Device Name",":",!0),c=A.getValue(a,"MAC Address",":",!0),u=A.getValue(a,"hardware",":",!0);e.push({id:"Wi-Fi",iface:l,model:u,vendor:"",mac:c})}n&&n(e),t(e)}):Xs?A.powerShell("netsh wlan show interfaces").then(function(i){let s=i.toString().split(`\r
|
|
299
|
-
`);for(let a=0;a<s.length;a++)s[a]=s[a].trim();let o=s.join(`\r
|
|
300
|
-
`).split(`:\r
|
|
301
|
-
\r
|
|
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:{}},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
|
-
`);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
|
-
`);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
|
-
`).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
|
-
`);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,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
|
-
`);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
|
-
`),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
|
-
`)).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(`
|
|
312
|
-
`),m=ei(f.shift()),g={},x={};f.forEach(h=>{if(x=ti(h,m,ye),x.pid){let y=a.list.map(function(S){return S.pid}).indexOf(x.pid);y>=0&&(a.list[y].cpu=x.cpuu+x.cpus,a.list[y].cpuu=x.cpuu,a.list[y].cpus=x.cpus),g[x.pid]={cpuu:x.cpuu,cpus:x.cpus,utime:x.utime,stime:x.stime,cutime:x.cutime,cstime:x.cstime}}}),ye.all=m,ye.list=Object.assign({},g),ye.ms=Date.now()-ye.ms,ye.result=Object.assign({},a),n&&n(a),o(a)})):(n&&n(a),o(a))):(l="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",cs&&(l="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),hr(l,{maxBuffer:1024*2e4},function(p,d){if(p)n&&n(a),o(a);else{let f=d.toString().split(`
|
|
313
|
-
`);f.shift(),a.list=s(f).slice(),a.all=a.list.length,a.running=a.list.filter(function(m){return m.state==="running"}).length,a.blocked=a.list.filter(function(m){return m.state==="blocked"}).length,a.sleeping=a.list.filter(function(m){return m.state==="sleeping"}).length,n&&n(a),o(a)}}))});else if(Qs)try{F.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then((c,u)=>{if(!u){let p=c.split(/\n\s*\n/),d=[],f=[],m={},g=0,x=0;p.forEach(h=>{if(h.trim()!==""){let y=h.trim().split(`\r
|
|
314
|
-
`),S=parseInt(F.getValue(y,"ProcessId",":",!0),10),_=parseInt(F.getValue(y,"ParentProcessId",":",!0),10),C=F.getValue(y,"ExecutionState",":"),D=F.getValue(y,"Caption",":",!0),T=F.getValue(y,"CommandLine",":",!0),ee=!1;y.forEach(me=>{ee&&me.toLowerCase().startsWith(" ")?T+=" "+me.trim():ee=!1,me.toLowerCase().startsWith("commandline")&&(ee=!0)});let E=F.getValue(y,"ExecutablePath",":",!0),Q=parseInt(F.getValue(y,"UserModeTime",":",!0),10),z=parseInt(F.getValue(y,"KernelModeTime",":",!0),10),ue=parseInt(F.getValue(y,"WorkingSetSize",":",!0),10);g=g+Q,x=x+z,a.all++,C||a.unknown++,C==="3"&&a.running++,(C==="4"||C==="5")&&a.blocked++,f.push({pid:S,utime:Q,stime:z,cpu:0,cpuu:0,cpus:0}),d.push({pid:S,parentPid:_,name:D,cpu:0,cpuu:0,cpus:0,mem:ue/us.totalmem()*100,priority:parseInt(F.getValue(y,"Priority",":",!0),10),memVsz:parseInt(F.getValue(y,"PageFileUsage",":",!0),10),memRss:Math.floor(parseInt(F.getValue(y,"WorkingSetSize",":",!0),10)/1024),nice:0,started:F.getValue(y,"CreationDate",":",!0),state:C?qo[C]:qo[0],tty:"",user:"",command:T||D,path:E,params:""})}}),a.sleeping=a.all-a.running-a.blocked-a.unknown,a.list=d,f.forEach(h=>{let y=Ko(h,g+x,ye),S=a.list.map(function(_){return _.pid}).indexOf(y.pid);S>=0&&(a.list[S].cpu=y.cpuu+y.cpus,a.list[S].cpuu=y.cpuu,a.list[S].cpus=y.cpus),m[y.pid]={cpuu:y.cpuu,cpus:y.cpus,utime:y.utime,stime:y.stime}}),ye.all=g+x,ye.all_utime=g,ye.all_stime=x,ye.list=Object.assign({},m),ye.ms=Date.now()-ye.ms,ye.result=Object.assign({},a)}n&&n(a),o(a)})}catch{n&&n(a),o(a)}else n&&n(a),o(a);else n&&n(ye.result),o(ye.result)})})}ps.processes=bp;function Dp(n,t){return F.isFunction(n)&&!t&&(t=n,n=""),new Promise(e=>{process.nextTick(()=>{if(n=n||"",typeof n!="string")return t&&t([]),e([]);let r="";try{r.__proto__.toLowerCase=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=[];if((F.isPrototypePolluted()?"":F.sanitizeShellString(n)||"*")&&o.length&&o[0]!=="------"){if(Qs)try{F.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then((c,u)=>{if(!u){let p=c.split(/\n\s*\n/),d=[],f={},m=0,g=0;p.forEach(x=>{if(x.trim()!==""){let h=x.trim().split(`\r
|
|
315
|
-
`),y=parseInt(F.getValue(h,"ProcessId",":",!0),10),S=F.getValue(h,"Caption",":",!0),_=parseInt(F.getValue(h,"UserModeTime",":",!0),10),C=parseInt(F.getValue(h,"KernelModeTime",":",!0),10),D=parseInt(F.getValue(h,"WorkingSetSize",":",!0),10);m=m+_,g=g+C,d.push({pid:y,name:S,utime:_,stime:C,cpu:0,cpuu:0,cpus:0,mem:D});let T="",ee=!1;if(o.forEach(function(E){S.toLowerCase().indexOf(E.toLowerCase())>=0&&!ee&&(ee=!0,T=E)}),r==="*"||ee){let E=!1;a.forEach(function(Q){Q.proc.toLowerCase()===T.toLowerCase()&&(Q.pids.push(y),Q.mem+=D/us.totalmem()*100,E=!0)}),E||a.push({proc:T,pid:y,pids:[y],cpu:0,mem:D/us.totalmem()*100})}}}),r!=="*"&&o.filter(function(h){return d.filter(function(y){return y.name.toLowerCase().indexOf(h)>=0}).length===0}).forEach(function(h){a.push({proc:h,pid:null,pids:[],cpu:0,mem:0})}),d.forEach(x=>{let h=Ko(x,m+g,Pe),y=-1;for(let S=0;S<a.length;S++)(a[S].pid===h.pid||a[S].pids.indexOf(h.pid)>=0)&&(y=S);y>=0&&(a[y].cpu+=h.cpuu+h.cpus),f[h.pid]={cpuu:h.cpuu,cpus:h.cpus,utime:h.utime,stime:h.stime}}),Pe.all=m+g,Pe.all_utime=m,Pe.all_stime=g,Pe.list=Object.assign({},f),Pe.ms=Date.now()-Pe.ms,Pe.result=JSON.parse(JSON.stringify(a)),t&&t(a),e(a)}})}catch{t&&t(a),e(a)}if(xn||tt||gr||yr||xr){let c=["-axo","pid,ppid,pcpu,pmem,comm"];F.execSafe("ps",c).then(u=>{if(u){let p=[],d=u.toString().split(`
|
|
316
|
-
`).filter(function(f){if(r==="*")return!0;if(f.toLowerCase().indexOf("grep")!==-1)return!1;let m=!1;return o.forEach(function(g){m=m||f.toLowerCase().indexOf(g.toLowerCase())>=0}),m});if(d.shift(),d.forEach(function(f){let m=f.trim().replace(/ +/g," ").split(" ");if(m.length>4){let g=m[4].indexOf("/")>=0?m[4].substring(0,m[4].indexOf("/")):m[4],x=tt?g:m[4].substring(m[4].lastIndexOf("/")+1);p.push({name:x,pid:parseInt(m[0])||0,ppid:parseInt(m[1])||0,cpu:parseFloat(m[2].replace(",",".")),mem:parseFloat(m[3].replace(",","."))})}}),p.forEach(function(f){let m=-1,g=!1,x=f.name;for(let h=0;h<a.length;h++)f.name.toLowerCase().indexOf(a[h].proc.toLowerCase())>=0&&(m=h);o.forEach(function(h){f.name.toLowerCase().indexOf(h.toLowerCase())>=0&&!g&&(g=!0,x=h)}),(r==="*"||g)&&(m<0?x&&a.push({proc:x,pid:f.pid,pids:[f.pid],cpu:f.cpu,mem:f.mem}):(f.ppid<10&&(a[m].pid=f.pid),a[m].pids.push(f.pid),a[m].cpu+=f.cpu,a[m].mem+=f.mem))}),r!=="*"&&o.filter(function(m){return p.filter(function(g){return g.name.toLowerCase().indexOf(m)>=0}).length===0}).forEach(function(m){a.push({proc:m,pid:null,pids:[],cpu:0,mem:0})}),tt){a.forEach(function(m){m.cpu=0});let f='cat /proc/stat | grep "cpu "';for(let m in a)for(let g in a[m].pids)f+=";cat /proc/"+a[m].pids[g]+"/stat";hr(f,{maxBuffer:1024*2e4},function(m,g){let x=g.toString().split(`
|
|
317
|
-
`),h=ei(x.shift()),y={},S={};x.forEach(_=>{if(S=ti(_,h,Pe),S.pid){let C=-1;for(let D in a)a[D].pids.indexOf(S.pid)>=0&&(C=D);C>=0&&(a[C].cpu+=S.cpuu+S.cpus),y[S.pid]={cpuu:S.cpuu,cpus:S.cpus,utime:S.utime,stime:S.stime,cutime:S.cutime,cstime:S.cstime}}}),a.forEach(function(_){_.cpu=Math.round(_.cpu*100)/100}),Pe.all=h,Pe.list=Object.assign({},y),Pe.ms=Date.now()-Pe.ms,Pe.result=Object.assign({},a),t&&t(a),e(a)})}else t&&t(a),e(a)}else t&&t(a),e(a)})}}})})}ps.processLoad=Dp});var Zo=ae(Xo=>{"use strict";var Sr=k("child_process").exec,ut=pe(),kt=process.platform,Np=kt==="linux"||kt==="android",Vp=kt==="darwin",kp=kt==="win32",Bp=kt==="freebsd",Rp=kt==="openbsd",Fp=kt==="netbsd",Gp=kt==="sunos";function Yo(n,t){let e=[],r=[],i={},s=!0,o=[],a=[],l={},c=!0;return n.forEach(function(u){if(u==="---")c=!1;else{let p=u.replace(/ +/g," ").split(" ");c?r.push({user:p[0],tty:p[1],date:p[2],time:p[3],ip:p&&p.length>4?p[4].replace(/\(/g,"").replace(/\)/g,""):""}):s?(o=p,o.forEach(function(d){a.push(u.indexOf(d))}),s=!1):(i.user=u.substring(a[0],a[1]-1).trim(),i.tty=u.substring(a[1],a[2]-1).trim(),i.ip=u.substring(a[2],a[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=u.substring(a[7],1e3).trim(),l=r.filter(function(d){return d.user.substring(0,8).trim()===i.user&&d.tty===i.tty}),l.length===1&&e.push({user:l[0].user,tty:l[0].tty,date:l[0].date,time:l[0].time,ip:l[0].ip,command:i.command}))}}),e.length===0&&t===2?r:e}function ni(n){let t=[],e=[],r={},i={},s=!0;return n.forEach(function(o){if(o==="---")s=!1;else{let a=o.replace(/ +/g," ").split(" ");if(s){let l=""+new Date().getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2);try{new Date(l)>new Date&&(l=""+(new Date().getFullYear()-1)+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2))}catch{ut.noop()}e.push({user:a[0],tty:a[1],date:l,time:a[4]})}else r.user=a[0],r.tty=a[1],r.ip=a[2]!=="-"?a[2]:"",r.command=a.slice(5,1e3).join(" "),i=e.filter(function(l){return l.user.substring(0,10)===r.user.substring(0,10)&&(l.tty.substring(3,1e3)===r.tty||l.tty===r.tty)}),i.length===1&&t.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:r.ip,command:r.command})}}),t}function Wp(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(Np&&Sr('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2',function(r,i){if(r)n&&n(e),t(e);else{let s=i.toString().split(`
|
|
318
|
-
`);e=Yo(s,1),e.length===0?Sr('who; echo "---"; w | tail -n +2',function(o,a){o||(s=a.toString().split(`
|
|
319
|
-
`),e=Yo(s,2)),n&&n(e),t(e)}):(n&&n(e),t(e))}}),(Bp||Rp||Fp)&&Sr('who; echo "---"; w -ih',function(r,i){if(!r){let s=i.toString().split(`
|
|
320
|
-
`);e=ni(s)}n&&n(e),t(e)}),Gp&&Sr('who; echo "---"; w -h',function(r,i){if(!r){let s=i.toString().split(`
|
|
321
|
-
`);e=ni(s)}n&&n(e),t(e)}),Vp&&Sr('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL',function(r,i){if(!r){let s=i.toString().split(`
|
|
322
|
-
`);e=ni(s)}n&&n(e),t(e)}),kp)try{let r=`Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo '#-#-#-#';`;r+="Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';",r+=`$process = (Get-CimInstance Win32_Process -Filter "name = 'explorer.exe'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';`,r+="query user",ut.powerShell(r).then(i=>{if(i){i=i.split("#-#-#-#");let s=Up((i[0]||"").split(/\n\s*\n/)),o=jp((i[1]||"").split(/\n\s*\n/)),a=qp((i[3]||"").split(`\r
|
|
323
|
-
`)),l=Hp((i[2]||"").split(/\n\s*\n/),a);for(let c in o)({}).hasOwnProperty.call(o,c)&&(o[c].dateTime={}.hasOwnProperty.call(s,c)?s[c]:"");l.forEach(c=>{let u="";for(let p in o)({}).hasOwnProperty.call(o,p)&&o[p].user===c.user&&(!u||u<o[p].dateTime)&&(u=o[p].dateTime);e.push({user:c.user,tty:c.tty,date:`${u.substring(0,10)}`,time:`${u.substring(11,19)}`,ip:"",command:""})})}n&&n(e),t(e)})}catch{n&&n(e),t(e)}})})}function Up(n){let t={};return n.forEach(e=>{let r=e.split(`\r
|
|
324
|
-
`),i=ut.getValue(r,"LogonId"),s=ut.getValue(r,"starttime");i&&(t[i]=s)}),t}function zp(n,t){n=n.toLowerCase(),t=t.toLowerCase();let e=0,r=n.length;t.length>r&&(r=t.length);for(let i=0;i<r;i++){let s=n[i]||"",o=t[i]||"";s===o&&e++}return r>10?e/r>.9:r>0?e/r>.8:!1}function Hp(n,t){let e=[];return n.forEach(r=>{let i=r.split(`\r
|
|
325
|
-
`),s=ut.getValue(i,"domain",":",!0),o=ut.getValue(i,"user",":",!0),a=ut.getValue(i,"sessionid",":",!0);if(o){let l=t.filter(c=>zp(c.user,o));e.push({domain:s,user:o,tty:l&&l[0]&&l[0].tty?l[0].tty:a})}}),e}function jp(n){let t={};return n.forEach(e=>{let r=e.split(`\r
|
|
326
|
-
`),s=ut.getValue(r,"antecedent",":",!0).split("="),o=s.length>2?s[1].split(",")[0].replace(/"/g,"").trim():"",a=s.length>2?s[2].replace(/"/g,"").replace(/\)/g,"").trim():"";s=ut.getValue(r,"dependent",":",!0).split("=");let c=s.length>1?s[1].replace(/"/g,"").replace(/\)/g,"").trim():"";c&&(t[c]={domain:a,user:o})}),t}function qp(n){n=n.filter(i=>i);let t=[],e=n[0],r=[];if(e){let i=e[0]===" "?1:0;r.push(i-1);let s=0;for(let o=i+1;o<e.length;o++)e[o]===" "&&(e[o-1]===" "||e[o-1]===".")?s=o:s&&(r.push(s),s=0);for(let o=1;o<n.length;o++)if(n[o].trim()){let a=n[o].substring(r[0]+1,r[1]).trim()||"",l=n[o].substring(r[1]+1,r[2]-2).trim()||"";t.push({user:a,tty:l})}}return t}Xo.users=Wp});var ra=ae(ri=>{"use strict";var fe=pe(),Bt=process.platform,Jo=Bt==="linux"||Bt==="android",Qo=Bt==="darwin",Kp=Bt==="win32",ea=Bt==="freebsd",ta=Bt==="openbsd",na=Bt==="netbsd",$p=Bt==="sunos";function Yp(n,t){return new Promise(e=>{process.nextTick(()=>{let r={url:n,ok:!1,status:404,ms:null};if(typeof n!="string")return t&&t(r),e(r);let i="",s=fe.sanitizeShellString(n,!0),o=fe.mathMin(s.length,2e3);for(let a=0;a<=o;a++)if(s[a]!==void 0){try{s[a].__proto__.toLowerCase=fe.stringToLower}catch{Object.setPrototypeOf(s[a],fe.stringObj)}let l=s[a].toLowerCase();l&&l[0]&&!l[1]&&l[0].length===1&&(i=i+l[0])}r.url=i;try{if(i&&!fe.isPrototypePolluted()){try{i.__proto__.startsWith=fe.stringStartWith}catch{Object.setPrototypeOf(i,fe.stringObj)}if(i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return t&&t(r),e(r);fe.checkWebsite(i).then(a=>{r.status=a.statusCode,r.ok=a.statusCode>=200&&a.statusCode<=399,r.ms=r.ok?a.time:null,t&&t(r),e(r)})}else t&&t(r),e(r)}catch{t&&t(r),e(r)}})})}ri.inetChecksite=Yp;function Xp(n,t){return fe.isFunction(n)&&!t&&(t=n,n=""),n=n||"8.8.8.8",new Promise(e=>{process.nextTick(()=>{if(typeof n!="string")return t&&t(null),e(null);let r="",i=(fe.isPrototypePolluted()?"8.8.8.8":fe.sanitizeShellString(n,!0)).trim(),s=fe.mathMin(i.length,2e3);for(let a=0;a<=s;a++)if(i[a]!==void 0){try{i[a].__proto__.toLowerCase=fe.stringToLower}catch{Object.setPrototypeOf(i[a],fe.stringObj)}let l=i[a].toLowerCase();l&&l[0]&&!l[1]&&(r=r+l[0])}try{r.__proto__.startsWith=fe.stringStartWith}catch{Object.setPrototypeOf(r,fe.stringObj)}if(r.startsWith("file:")||r.startsWith("gopher:")||r.startsWith("telnet:")||r.startsWith("mailto:")||r.startsWith("news:")||r.startsWith("nntp:"))return t&&t(null),e(null);let o;if((Jo||ea||ta||na||Qo)&&(Jo&&(o=["-c","2","-w","3",r]),(ea||ta||na)&&(o=["-c","2","-t","3",r]),Qo&&(o=["-c2","-t3",r]),fe.execSafe("ping",o).then(a=>{let l=null;if(a){let u=a.split(`
|
|
327
|
-
`).filter(p=>p.indexOf("rtt")>=0||p.indexOf("round-trip")>=0||p.indexOf("avg")>=0).join(`
|
|
328
|
-
`).split("=");if(u.length>1){let p=u[1].split("/");p.length>1&&(l=parseFloat(p[1]))}}t&&t(l),e(l)})),$p){let a=["-s","-a",r,"56","2"],l="avg";fe.execSafe("ping",a,{timeout:3e3}).then(c=>{let u=null;if(c){let d=c.split(`
|
|
329
|
-
`).filter(f=>f.indexOf(l)>=0).join(`
|
|
330
|
-
`).split("=");if(d.length>1){let f=d[1].split("/");f.length>1&&(u=parseFloat(f[1].replace(",",".")))}}t&&t(u),e(u)})}if(Kp){let a=null;try{let l=[r,"-n","1"];fe.execSafe("ping",l,fe.execOptsWin).then(c=>{if(c){let u=c.split(`\r
|
|
331
|
-
`);u.shift(),u.forEach(function(p){if((p.toLowerCase().match(/ms/g)||[]).length===3){let d=p.replace(/ +/g," ").split(" ");d.length>6&&(a=parseFloat(d[d.length-1]))}})}t&&t(a),e(a)})}catch{t&&t(a),e(a)}}})})}ri.inetLatency=Xp});var ia=ae((Cf,sa)=>{"use strict";var Rt=k("net"),Zp=k("os").type()==="Windows_NT",Ft=Zp?"//./pipe/docker_engine":"/var/run/docker.sock",si=class{getInfo(t){try{let e=Rt.createConnection({path:Ft}),r="",i;e.on("connect",()=>{e.write(`GET http:/info HTTP/1.0\r
|
|
332
|
-
\r
|
|
333
|
-
`)}),e.on("data",s=>{r=r+s.toString()}),e.on("error",()=>{e=!1,t({})}),e.on("end",()=>{let s=r.indexOf(`\r
|
|
334
|
-
\r
|
|
335
|
-
`);r=r.substring(s+4),e=!1;try{i=JSON.parse(r),t(i)}catch{t({})}})}catch{t({})}}listImages(t,e){try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/images/json"+(t?"?all=1":"")+` HTTP/1.0\r
|
|
336
|
-
\r
|
|
337
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
338
|
-
\r
|
|
339
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}inspectImage(t,e){if(t=t||"",t)try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/images/"+t+`/json?stream=0 HTTP/1.0\r
|
|
340
|
-
\r
|
|
341
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
342
|
-
\r
|
|
343
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listContainers(t,e){try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/json"+(t?"?all=1":"")+` HTTP/1.0\r
|
|
344
|
-
\r
|
|
345
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
346
|
-
\r
|
|
347
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}getStats(t,e){if(t=t||"",t)try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/stats?stream=0 HTTP/1.0\r
|
|
348
|
-
\r
|
|
349
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
350
|
-
\r
|
|
351
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getInspect(t,e){if(t=t||"",t)try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/json?stream=0 HTTP/1.0\r
|
|
352
|
-
\r
|
|
353
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
354
|
-
\r
|
|
355
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getProcesses(t,e){if(t=t||"",t)try{let r=Rt.createConnection({path:Ft}),i="",s;r.on("connect",()=>{r.write("GET http:/containers/"+t+`/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r
|
|
356
|
-
\r
|
|
357
|
-
`)}),r.on("data",o=>{i=i+o.toString()}),r.on("error",()=>{r=!1,e({})}),r.on("end",()=>{let o=i.indexOf(`\r
|
|
358
|
-
\r
|
|
359
|
-
`);i=i.substring(o+4),r=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listVolumes(t){try{let e=Rt.createConnection({path:Ft}),r="",i;e.on("connect",()=>{e.write(`GET http:/volumes HTTP/1.0\r
|
|
360
|
-
\r
|
|
361
|
-
`)}),e.on("data",s=>{r=r+s.toString()}),e.on("error",()=>{e=!1,t({})}),e.on("end",()=>{let s=r.indexOf(`\r
|
|
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",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
|
-
`));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
|
-
`+a.toString()).split(`
|
|
366
|
-
printer `);for(let c=1;c<l.length;c++){let u=_0(l[c].split(`
|
|
367
|
-
`),c);e.push(u)}}),n&&n(e),t(e)):(n&&n(e),t(e))})}d0&&ci("system_profiler SPPrintersDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPPrintersDataType&&o.SPPrintersDataType.length)for(let a=0;a<o.SPPrintersDataType.length;a++){let l=C0(o.SPPrintersDataType[a],a);e.push(l)}}catch{Se.noop()}n&&n(e),t(e)}),f0&&Se.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then((r,i)=>{if(!i){let s=r.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){let a=v0(s[o].split(`
|
|
368
|
-
`),o);(a.name||a.model)&&e.push(a)}}n&&n(e),t(e)}),y0&&t(null)})})}da.printer=w0});var ga=ae(ha=>{"use strict";var ma=k("child_process").exec,He=pe(),zt=process.platform,I0=zt==="linux"||zt==="android",L0=zt==="darwin",O0=zt==="win32",E0=zt==="freebsd",P0=zt==="openbsd",A0=zt==="netbsd",T0=zt==="sunos";function M0(n,t){let e=n,r=(t+" "+n).toLowerCase();return r.indexOf("camera")>=0?e="Camera":r.indexOf("hub")>=0?e="Hub":r.indexOf("keybrd")>=0||r.indexOf("keyboard")>=0?e="Keyboard":r.indexOf("mouse")>=0?e="Mouse":r.indexOf("stora")>=0?e="Storage":r.indexOf("microp")>=0?e="Microphone":(r.indexOf("headset")>=0||r.indexOf("audio")>=0)&&(e="Audio"),e}function b0(n){let t={},e=n.split(`
|
|
369
|
-
`);if(e&&e.length&&e[0].indexOf("Device")>=0){let y=e[0].split(" ");t.bus=parseInt(y[0],10),y[2]?t.deviceId=parseInt(y[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;let r=He.getValue(e,"idVendor"," ",!0).trim(),i=r.split(" ");i.shift();let s=i.join(" "),o=He.getValue(e,"idProduct"," ",!0).trim(),a=o.split(" ");a.shift();let l=a.join(" "),u=He.getValue(e,"bInterfaceClass"," ",!0).trim().split(" ");u.shift();let p=u.join(" "),f=He.getValue(e,"iManufacturer"," ",!0).trim().split(" ");f.shift();let m=f.join(" "),x=He.getValue(e,"iSerial"," ",!0).trim().split(" ");x.shift();let h=x.join(" ");return t.id=(r.startsWith("0x")?r.split(" ")[0].substr(2,10):"")+":"+(o.startsWith("0x")?o.split(" ")[0].substr(2,10):""),t.name=l,t.type=M0(p,l),t.removable=null,t.vendor=s,t.manufacturer=m,t.maxPower=He.getValue(e,"MaxPower"," ",!0),t.serialNumber=h,t}function D0(n){let t="";return n.indexOf("camera")>=0?t="Camera":n.indexOf("touch bar")>=0?t="Touch Bar":n.indexOf("controller")>=0?t="Controller":n.indexOf("headset")>=0?t="Audio":n.indexOf("keyboard")>=0?t="Keyboard":n.indexOf("trackpad")>=0?t="Trackpad":n.indexOf("sensor")>=0?t="Sensor":n.indexOf("bthusb")>=0||n.indexOf("bth")>=0||n.indexOf("rfcomm")>=0?t="Bluetooth":n.indexOf("usbhub")>=0||n.indexOf(" hub")>=0?t="Hub":n.indexOf("mouse")>=0?t="Mouse":n.indexOf("microp")>=0?t="Microphone":n.indexOf("removable")>=0&&(t="Storage"),t}function N0(n,t){let e={};e.id=t,n=n.replace(/ \|/g,""),n=n.trim();let r=n.split(`
|
|
370
|
-
`);r.shift();try{for(let o=0;o<r.length;o++){r[o]=r[o].trim(),r[o]=r[o].replace(/=/g,":"),r[o]!=="{"&&r[o]!=="}"&&r[o+1]&&r[o+1].trim()!=="}"&&(r[o]=r[o]+","),r[o]=r[o].replace(":Yes,",':"Yes",'),r[o]=r[o].replace(": Yes,",': "Yes",'),r[o]=r[o].replace(": Yes",': "Yes"'),r[o]=r[o].replace(":No,",':"No",'),r[o]=r[o].replace(": No,",': "No",'),r[o]=r[o].replace(": No",': "No"'),r[o]=r[o].replace("((","").replace("))","");let a=/<(\w+)>/.exec(r[o]);if(a){let l=a[0];r[o]=r[o].replace(l,`"${l}"`)}}let i=JSON.parse(r.join(`
|
|
371
|
-
`)),s=(i["Built-In"]?i["Built-In"].toLowerCase()!=="yes":!0)&&(i["non-removable"]?i["non-removable"].toLowerCase()==="no":!0);return e.bus=null,e.deviceId=null,e.id=i["USB Address"]||null,e.name=i.kUSBProductString||i["USB Product Name"]||null,e.type=D0((i.kUSBProductString||i["USB Product Name"]||"").toLowerCase()+(s?" removable":"")),e.removable=i["non-removable"]?i["non-removable"].toLowerCase()||!1:!0,e.vendor=i.kUSBVendorString||i["USB Vendor Name"]||null,e.manufacturer=i.kUSBVendorString||i["USB Vendor Name"]||null,e.maxPower=null,e.serialNumber=i.kUSBSerialNumberString||null,e.name?e:null}catch{return null}}function V0(n,t){let e="";return t.indexOf("storage")>=0||t.indexOf("speicher")>=0?e="Storage":n.indexOf("usbhub")>=0?e="Hub":n.indexOf("storage")>=0?e="Storage":n.indexOf("usbcontroller")>=0?e="Controller":n.indexOf("keyboard")>=0?e="Keyboard":n.indexOf("pointing")>=0?e="Mouse":n.indexOf("microp")>=0?e="Microphone":n.indexOf("disk")>=0&&(e="Storage"),e}function k0(n,t){let e=V0(He.getValue(n,"CreationClassName",":").toLowerCase(),He.getValue(n,"name",":").toLowerCase());if(e){let r={};return r.bus=null,r.deviceId=He.getValue(n,"deviceid",":"),r.id=t,r.name=He.getValue(n,"name",":"),r.type=e,r.removable=null,r.vendor=null,r.manufacturer=He.getValue(n,"Manufacturer",":"),r.maxPower=null,r.serialNumber=null,r}else return null}function B0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];I0&&ma("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:1024*1024*128},function(i,s){if(!i){let o=(`
|
|
372
|
-
|
|
373
|
-
`+s.toString()).split(`
|
|
374
|
-
|
|
375
|
-
Bus `);for(let a=1;a<o.length;a++){let l=b0(o[a]);e.push(l)}}n&&n(e),t(e)}),L0&&ma("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l",{maxBuffer:1024*1024*128},function(i,s){if(!i){let o=s.toString().split(" +-o ");for(let a=1;a<o.length;a++){let l=N0(o[a]);l&&e.push(l)}n&&n(e),t(e)}n&&n(e),t(e)}),O0&&He.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((r,i)=>{if(!i){let s=r.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){let a=k0(s[o].split(`
|
|
376
|
-
`),o);a&&e.filter(l=>l.deviceId===a.deviceId).length===0&&e.push(a)}}n&&n(e),t(e)}),(T0||E0||P0||A0)&&t(null)})})}ha.usb=B0});var Sa=ae(xa=>{"use strict";var ya=k("child_process").exec,R0=k("child_process").execSync,Oe=pe(),Ht=process.platform,F0=Ht==="linux"||Ht==="android",G0=Ht==="darwin",W0=Ht==="win32",U0=Ht==="freebsd",z0=Ht==="openbsd",H0=Ht==="netbsd",j0=Ht==="sunos";function ui(n,t,e){n=n.toLowerCase();let r="";return n.indexOf("input")>=0&&(r="Microphone"),n.indexOf("display audio")>=0&&(r="Speaker"),n.indexOf("speak")>=0&&(r="Speaker"),n.indexOf("laut")>=0&&(r="Speaker"),n.indexOf("loud")>=0&&(r="Speaker"),n.indexOf("head")>=0&&(r="Headset"),n.indexOf("mic")>=0&&(r="Microphone"),n.indexOf("mikr")>=0&&(r="Microphone"),n.indexOf("phone")>=0&&(r="Phone"),n.indexOf("controll")>=0&&(r="Controller"),n.indexOf("line o")>=0&&(r="Line Out"),n.indexOf("digital o")>=0&&(r="Digital Out"),n.indexOf("smart sound technology")>=0&&(r="Digital Signal Processor"),n.indexOf("high definition audio")>=0&&(r="Sound Driver"),!r&&e?r="Speaker":!r&&t&&(r="Microphone"),r}function q0(){let n="lspci -v 2>/dev/null",t=[];try{return R0(n,Oe.execOptsLinux).toString().split(`
|
|
377
|
-
|
|
378
|
-
`).forEach(r=>{let i=r.split(`
|
|
379
|
-
`);if(i&&i.length&&i[0].toLowerCase().indexOf("audio")>=0){let s={};s.slotId=i[0].split(" ")[0],s.driver=Oe.getValue(i,"Kernel driver in use",":",!0)||Oe.getValue(i,"Kernel modules",":",!0),t.push(s)}}),t}catch{return t}}function K0(n,t){let e={},r=Oe.getValue(n,"Slot"),i=t.filter(function(s){return s.slotId===r});return e.id=r,e.name=Oe.getValue(n,"SDevice"),e.manufacturer=Oe.getValue(n,"SVendor"),e.revision=Oe.getValue(n,"Rev"),e.driver=i&&i.length===1&&i[0].driver?i[0].driver:"",e.default=null,e.channel="PCIe",e.type=ui(e.name,null,null),e.in=null,e.out=null,e.status="online",e}function $0(n){let t="";return n.indexOf("builtin")>=0&&(t="Built-In"),n.indexOf("extern")>=0&&(t="Audio-Jack"),n.indexOf("hdmi")>=0&&(t="HDMI"),n.indexOf("displayport")>=0&&(t="Display-Port"),n.indexOf("usb")>=0&&(t="USB"),n.indexOf("pci")>=0&&(t="PCIe"),t}function Y0(n,t){let e={},r=((n.coreaudio_device_transport||"")+" "+(n._name||"")).toLowerCase();return e.id=t,e.name=n._name,e.manufacturer=n.coreaudio_device_manufacturer,e.revision=null,e.driver=null,e.default=!!n.coreaudio_default_audio_input_device||!!n.coreaudio_default_audio_output_device,e.channel=$0(r),e.type=ui(e.name,!!n.coreaudio_device_input,!!n.coreaudio_device_output),e.in=!!n.coreaudio_device_input,e.out=!!n.coreaudio_device_output,e.status="online",e}function X0(n){let t={},e=Oe.getValue(n,"StatusInfo",":");return t.id=Oe.getValue(n,"DeviceID",":"),t.name=Oe.getValue(n,"name",":"),t.manufacturer=Oe.getValue(n,"manufacturer",":"),t.revision=null,t.driver=null,t.default=null,t.channel=null,t.type=ui(t.name,null,null),t.in=null,t.out=null,t.status=e,t}function Z0(n){return new Promise(t=>{process.nextTick(()=>{let e=[];(F0||U0||z0||H0)&&ya("lspci -vmm 2>/dev/null",function(i,s){if(!i){let o=q0();s.toString().split(`
|
|
380
|
-
|
|
381
|
-
`).forEach(l=>{let c=l.split(`
|
|
382
|
-
`);if(Oe.getValue(c,"class",":",!0).toLowerCase().indexOf("audio")>=0){let u=K0(c,o);e.push(u)}})}n&&n(e),t(e)}),G0&&ya("system_profiler SPAudioDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPAudioDataType&&o.SPAudioDataType.length&&o.SPAudioDataType[0]&&o.SPAudioDataType[0]._items&&o.SPAudioDataType[0]._items.length)for(let a=0;a<o.SPAudioDataType[0]._items.length;a++){let l=Y0(o.SPAudioDataType[0]._items[a],a);e.push(l)}}catch{Oe.noop()}n&&n(e),t(e)}),W0&&Oe.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then((r,i)=>{i||r.toString().split(/\n\s*\n/).forEach(o=>{let a=o.split(`
|
|
383
|
-
`);Oe.getValue(a,"name",":")&&e.push(X0(a))}),n&&n(e),t(e)}),j0&&t(null)})})}xa.audio=Z0});var Ca=ae((Ef,_a)=>{"use strict";_a.exports={0:"Ericsson Technology Licensing",1:"Nokia Mobile Phones",2:"Intel Corp.",3:"IBM Corp.",4:"Toshiba Corp.",5:"3Com",6:"Microsoft",7:"Lucent",8:"Motorola",9:"Infineon Technologies AG",10:"Cambridge Silicon Radio",11:"Silicon Wave",12:"Digianswer A/S",13:"Texas Instruments Inc.",14:"Ceva, Inc. (formerly Parthus Technologies, Inc.)",15:"Broadcom Corporation",16:"Mitel Semiconductor",17:"Widcomm, Inc",18:"Zeevo, Inc.",19:"Atmel Corporation",20:"Mitsubishi Electric Corporation",21:"RTX Telecom A/S",22:"KC Technology Inc.",23:"NewLogic",24:"Transilica, Inc.",25:"Rohde & Schwarz GmbH & Co. KG",26:"TTPCom Limited",27:"Signia Technologies, Inc.",28:"Conexant Systems Inc.",29:"Qualcomm",30:"Inventel",31:"AVM Berlin",32:"BandSpeed, Inc.",33:"Mansella Ltd",34:"NEC Corporation",35:"WavePlus Technology Co., Ltd.",36:"Alcatel",37:"NXP Semiconductors (formerly Philips Semiconductors)",38:"C Technologies",39:"Open Interface",40:"R F Micro Devices",41:"Hitachi Ltd",42:"Symbol Technologies, Inc.",43:"Tenovis",44:"Macronix International Co. Ltd.",45:"GCT Semiconductor",46:"Norwood Systems",47:"MewTel Technology Inc.",48:"ST Microelectronics",49:"Synopsis",50:"Red-M (Communications) Ltd",51:"Commil Ltd",52:"Computer Access Technology Corporation (CATC)",53:"Eclipse (HQ Espana) S.L.",54:"Renesas Electronics Corporation",55:"Mobilian Corporation",56:"Terax",57:"Integrated System Solution Corp.",58:"Matsushita Electric Industrial Co., Ltd.",59:"Gennum Corporation",60:"BlackBerry Limited (formerly Research In Motion)",61:"IPextreme, Inc.",62:"Systems and Chips, Inc.",63:"Bluetooth SIG, Inc.",64:"Seiko Epson Corporation",65:"Integrated Silicon Solution Taiwan, Inc.",66:"CONWISE Technology Corporation Ltd",67:"PARROT SA",68:"Socket Mobile",69:"Atheros Communications, Inc.",70:"MediaTek, Inc.",71:"Bluegiga",72:"Marvell Technology Group Ltd.",73:"3DSP Corporation",74:"Accel Semiconductor Ltd.",75:"Continental Automotive Systems",76:"Apple, Inc.",77:"Staccato Communications, Inc.",78:"Avago Technologies",79:"APT Licensing Ltd.",80:"SiRF Technology",81:"Tzero Technologies, Inc.",82:"J&M Corporation",83:"Free2move AB",84:"3DiJoy Corporation",85:"Plantronics, Inc.",86:"Sony Ericsson Mobile Communications",87:"Harman International Industries, Inc.",88:"Vizio, Inc.",89:"Nordic Semiconductor ASA",90:"EM Microelectronic-Marin SA",91:"Ralink Technology Corporation",92:"Belkin International, Inc.",93:"Realtek Semiconductor Corporation",94:"Stonestreet One, LLC",95:"Wicentric, Inc.",96:"RivieraWaves S.A.S",97:"RDA Microelectronics",98:"Gibson Guitars",99:"MiCommand Inc.",100:"Band XI International, LLC",101:"Hewlett-Packard Company",102:"9Solutions Oy",103:"GN Netcom A/S",104:"General Motors",105:"A&D Engineering, Inc.",106:"MindTree Ltd.",107:"Polar Electro OY",108:"Beautiful Enterprise Co., Ltd.",109:"BriarTek, Inc.",110:"Summit Data Communications, Inc.",111:"Sound ID",112:"Monster, LLC",113:"connectBlue AB",114:"ShangHai Super Smart Electronics Co. Ltd.",115:"Group Sense Ltd.",116:"Zomm, LLC",117:"Samsung Electronics Co. Ltd.",118:"Creative Technology Ltd.",119:"Laird Technologies",120:"Nike, Inc.",121:"lesswire AG",122:"MStar Semiconductor, Inc.",123:"Hanlynn Technologies",124:"A & R Cambridge",125:"Seers Technology Co. Ltd",126:"Sports Tracking Technologies Ltd.",127:"Autonet Mobile",128:"DeLorme Publishing Company, Inc.",129:"WuXi Vimicro",130:"Sennheiser Communications A/S",131:"TimeKeeping Systems, Inc.",132:"Ludus Helsinki Ltd.",133:"BlueRadios, Inc.",134:"equinox AG",135:"Garmin International, Inc.",136:"Ecotest",137:"GN ReSound A/S",138:"Jawbone",139:"Topcorn Positioning Systems, LLC",140:"Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)",141:"Zscan Software",142:"Quintic Corp.",143:"Stollman E+V GmbH",144:"Funai Electric Co., Ltd.",145:"Advanced PANMOBIL Systems GmbH & Co. KG",146:"ThinkOptics, Inc.",147:"Universal Electronics, Inc.",148:"Airoha Technology Corp.",149:"NEC Lighting, Ltd.",150:"ODM Technology, Inc.",151:"ConnecteDevice Ltd.",152:"zer01.tv GmbH",153:"i.Tech Dynamic Global Distribution Ltd.",154:"Alpwise",155:"Jiangsu Toppower Automotive Electronics Co., Ltd.",156:"Colorfy, Inc.",157:"Geoforce Inc.",158:"Bose Corporation",159:"Suunto Oy",160:"Kensington Computer Products Group",161:"SR-Medizinelektronik",162:"Vertu Corporation Limited",163:"Meta Watch Ltd.",164:"LINAK A/S",165:"OTL Dynamics LLC",166:"Panda Ocean Inc.",167:"Visteon Corporation",168:"ARP Devices Limited",169:"Magneti Marelli S.p.A",170:"CAEN RFID srl",171:"Ingenieur-Systemgruppe Zahn GmbH",172:"Green Throttle Games",173:"Peter Systemtechnik GmbH",174:"Omegawave Oy",175:"Cinetix",176:"Passif Semiconductor Corp",177:"Saris Cycling Group, Inc",178:"Bekey A/S",179:"Clarinox Technologies Pty. Ltd.",180:"BDE Technology Co., Ltd.",181:"Swirl Networks",182:"Meso international",183:"TreLab Ltd",184:"Qualcomm Innovation Center, Inc. (QuIC)",185:"Johnson Controls, Inc.",186:"Starkey Laboratories Inc.",187:"S-Power Electronics Limited",188:"Ace Sensor Inc",189:"Aplix Corporation",190:"AAMP of America",191:"Stalmart Technology Limited",192:"AMICCOM Electronics Corporation",193:"Shenzhen Excelsecu Data Technology Co.,Ltd",194:"Geneq Inc.",195:"adidas AG",196:"LG Electronics",197:"Onset Computer Corporation",198:"Selfly BV",199:"Quuppa Oy.",200:"GeLo Inc",201:"Evluma",202:"MC10",203:"Binauric SE",204:"Beats Electronics",205:"Microchip Technology Inc.",206:"Elgato Systems GmbH",207:"ARCHOS SA",208:"Dexcom, Inc.",209:"Polar Electro Europe B.V.",210:"Dialog Semiconductor B.V.",211:"Taixingbang\xA0Technology (HK) Co,. LTD.",212:"Kawantech",213:"Austco Communication Systems",214:"Timex Group USA, Inc.",215:"Qualcomm Technologies, Inc.",216:"Qualcomm Connected Experiences, Inc.",217:"Voyetra Turtle Beach",218:"txtr GmbH",219:"Biosentronics",220:"Procter & Gamble",221:"Hosiden Corporation",222:"Muzik LLC",223:"Misfit Wearables Corp",224:"Google",225:"Danlers Ltd",226:"Semilink Inc",227:"inMusic Brands, Inc",228:"L.S. Research Inc.",229:"Eden Software Consultants Ltd.",230:"Freshtemp",231:"KS Technologies",232:"ACTS Technologies",233:"Vtrack Systems",234:"Nielsen-Kellerman Company",235:"Server Technology, Inc.",236:"BioResearch Associates",237:"Jolly Logic, LLC",238:"Above Average Outcomes, Inc.",239:"Bitsplitters GmbH",240:"PayPal, Inc.",241:"Witron Technology Limited",242:"Aether Things\xA0Inc. (formerly Morse Project Inc.)",243:"Kent Displays Inc.",244:"Nautilus Inc.",245:"Smartifier Oy",246:"Elcometer Limited",247:"VSN Technologies Inc.",248:"AceUni Corp., Ltd.",249:"StickNFind",250:"Crystal Code AB",251:"KOUKAAM a.s.",252:"Delphi Corporation",253:"ValenceTech Limited",254:"Reserved",255:"Typo Products, LLC",256:"TomTom International BV",257:"Fugoo, Inc",258:"Keiser Corporation",259:"Bang & Olufsen A/S",260:"PLUS Locations Systems Pty Ltd",261:"Ubiquitous Computing Technology Corporation",262:"Innovative Yachtter Solutions",263:"William Demant Holding A/S",264:"Chicony Electronics Co., Ltd.",265:"Atus BV",266:"Codegate Ltd.",267:"ERi, Inc.",268:"Transducers Direct, LLC",269:"Fujitsu Ten Limited",270:"Audi AG",271:"HiSilicon Technologies Co., Ltd.",272:"Nippon Seiki Co., Ltd.",273:"Steelseries ApS",274:"vyzybl Inc.",275:"Openbrain Technologies, Co., Ltd.",276:"Xensr",277:"e.solutions",278:"1OAK Technologies",279:"Wimoto Technologies Inc",280:"Radius Networks, Inc.",281:"Wize Technology Co., Ltd.",282:"Qualcomm Labs, Inc.",283:"Aruba Networks",284:"Baidu",285:"Arendi AG",286:"Skoda Auto a.s.",287:"Volkswagon AG",288:"Porsche AG",289:"Sino Wealth Electronic Ltd.",290:"AirTurn, Inc.",291:"Kinsa, Inc.",292:"HID Global",293:"SEAT es",294:"Promethean Ltd.",295:"Salutica Allied Solutions",296:"GPSI Group Pty Ltd",297:"Nimble Devices Oy",298:"Changzhou Yongse Infotech Co., Ltd",299:"SportIQ",300:"TEMEC Instruments B.V.",301:"Sony Corporation",302:"ASSA ABLOY",303:"Clarion Co., Ltd.",304:"Warehouse Innovations",305:"Cypress Semiconductor Corporation",306:"MADS Inc",307:"Blue Maestro Limited",308:"Resolution Products, Inc.",309:"Airewear LLC",310:"Seed Labs, Inc. (formerly ETC sp. z.o.o.)",311:"Prestigio Plaza Ltd.",312:"NTEO Inc.",313:"Focus Systems Corporation",314:"Tencent Holdings Limited",315:"Allegion",316:"Murata Manufacuring Co., Ltd.",318:"Nod, Inc.",319:"B&B Manufacturing Company",320:"Alpine\xA0Electronics\xA0(China)\xA0Co.,\xA0Ltd",321:"FedEx Services",322:"Grape Systems Inc.",323:"Bkon Connect",324:"Lintech GmbH",325:"Novatel Wireless",326:"Ciright",327:"Mighty Cast, Inc.",328:"Ambimat Electronics",329:"Perytons Ltd.",330:"Tivoli Audio, LLC",331:"Master Lock",332:"Mesh-Net Ltd",333:"Huizhou Desay SV Automotive CO., LTD.",334:"Tangerine, Inc.",335:"B&W Group Ltd.",336:"Pioneer Corporation",337:"OnBeep",338:"Vernier Software & Technology",339:"ROL Ergo",340:"Pebble Technology",341:"NETATMO",342:"Accumulate AB",343:"Anhui Huami Information Technology Co., Ltd.",344:"Inmite s.r.o.",345:"ChefSteps, Inc.",346:"micas AG",347:"Biomedical Research Ltd.",348:"Pitius Tec S.L.",349:"Estimote, Inc.",350:"Unikey Technologies, Inc.",351:"Timer Cap Co.",352:"AwoX",353:"yikes",354:"MADSGlobal NZ Ltd.",355:"PCH International",356:"Qingdao Yeelink Information Technology Co., Ltd.",357:"Milwaukee Tool (formerly Milwaukee Electric Tools)",358:"MISHIK Pte Ltd",359:"Bayer HealthCare",360:"Spicebox LLC",361:"emberlight",362:"Cooper-Atkins Corporation",363:"Qblinks",364:"MYSPHERA",365:"LifeScan Inc",366:"Volantic AB",367:"Podo Labs, Inc",368:"Roche Diabetes Care AG",369:"Amazon Fulfillment Service",370:"Connovate Technology Private Limited",371:"Kocomojo, LLC",372:"Everykey LLC",373:"Dynamic Controls",374:"SentriLock",375:"I-SYST inc.",376:"CASIO COMPUTER CO., LTD.",377:"LAPIS Semiconductor Co., Ltd.",378:"Telemonitor, Inc.",379:"taskit GmbH",380:"Daimler AG",381:"BatAndCat",382:"BluDotz Ltd",383:"XTel ApS",384:"Gigaset Communications GmbH",385:"Gecko Health Innovations, Inc.",386:"HOP Ubiquitous",387:"To Be Assigned",388:"Nectar",389:"bel\u2019apps LLC",390:"CORE Lighting Ltd",391:"Seraphim Sense Ltd",392:"Unico RBC",393:"Physical Enterprises Inc.",394:"Able Trend Technology Limited",395:"Konica Minolta, Inc.",396:"Wilo SE",397:"Extron Design Services",398:"Fitbit, Inc.",399:"Fireflies Systems",400:"Intelletto Technologies Inc.",401:"FDK CORPORATION",402:"Cloudleaf, Inc",403:"Maveric Automation LLC",404:"Acoustic Stream Corporation",405:"Zuli",406:"Paxton Access Ltd",407:"WiSilica Inc",408:"Vengit Limited",409:"SALTO SYSTEMS S.L.",410:"TRON Forum (formerly T-Engine Forum)",411:"CUBETECH s.r.o.",412:"Cokiya Incorporated",413:"CVS Health",414:"Ceruus",415:"Strainstall Ltd",416:"Channel Enterprises (HK) Ltd.",417:"FIAMM",418:"GIGALANE.CO.,LTD",419:"EROAD",420:"Mine Safety Appliances",421:"Icon Health and Fitness",422:"Asandoo GmbH",423:"ENERGOUS CORPORATION",424:"Taobao",425:"Canon Inc.",426:"Geophysical Technology Inc.",427:"Facebook, Inc.",428:"Nipro Diagnostics, Inc.",429:"FlightSafety International",430:"Earlens Corporation",431:"Sunrise Micro Devices, Inc.",432:"Star Micronics Co., Ltd.",433:"Netizens Sp. z o.o.",434:"Nymi Inc.",435:"Nytec, Inc.",436:"Trineo Sp. z o.o.",437:"Nest Labs Inc.",438:"LM Technologies Ltd",439:"General Electric Company",440:"i+D3 S.L.",441:"HANA Micron",442:"Stages Cycling LLC",443:"Cochlear Bone Anchored Solutions AB",444:"SenionLab AB",445:"Syszone Co., Ltd",446:"Pulsate Mobile Ltd.",447:"Hong Kong HunterSun Electronic Limited",448:"pironex GmbH",449:"BRADATECH Corp.",450:"Transenergooil AG",451:"Bunch",452:"DME Microelectronics",453:"Bitcraze AB",454:"HASWARE Inc.",455:"Abiogenix Inc.",456:"Poly-Control ApS",457:"Avi-on",458:"Laerdal Medical AS",459:"Fetch My Pet",460:"Sam Labs Ltd.",461:"Chengdu Synwing Technology Ltd",462:"HOUWA SYSTEM DESIGN, k.k.",463:"BSH",464:"Primus Inter Pares Ltd",465:"August",466:"Gill Electronics",467:"Sky Wave Design",468:"Newlab S.r.l.",469:"ELAD srl",470:"G-wearables inc.",471:"Squadrone Systems Inc.",472:"Code Corporation",473:"Savant Systems LLC",474:"Logitech International SA",475:"Innblue Consulting",476:"iParking Ltd.",477:"Koninklijke Philips Electronics N.V.",478:"Minelab Electronics Pty Limited",479:"Bison Group Ltd.",480:"Widex A/S",481:"Jolla Ltd",482:"Lectronix, Inc.",483:"Caterpillar Inc",484:"Freedom Innovations",485:"Dynamic Devices Ltd",486:"Technology Solutions (UK) Ltd",487:"IPS Group Inc.",488:"STIR",489:"Sano, Inc",490:"Advanced Application Design, Inc.",491:"AutoMap LLC",492:"Spreadtrum Communications Shanghai Ltd",493:"CuteCircuit LTD",494:"Valeo Service",495:"Fullpower Technologies, Inc.",496:"KloudNation",497:"Zebra Technologies Corporation",498:"Itron, Inc.",499:"The University of Tokyo",500:"UTC Fire and Security",501:"Cool Webthings Limited",502:"DJO Global",503:"Gelliner Limited",504:"Anyka (Guangzhou) Microelectronics Technology Co, LTD",505:"Medtronic, Inc.",506:"Gozio, Inc.",507:"Form Lifting, LLC",508:"Wahoo Fitness, LLC",509:"Kontakt Micro-Location Sp. z o.o.",510:"Radio System Corporation",511:"Freescale Semiconductor, Inc.",512:"Verifone Systems PTe Ltd. Taiwan Branch",513:"AR Timing",514:"Rigado LLC",515:"Kemppi Oy",516:"Tapcentive Inc.",517:"Smartbotics Inc.",518:"Otter Products, LLC",519:"STEMP Inc.",520:"LumiGeek LLC",521:"InvisionHeart Inc.",522:"Macnica Inc. ",523:"Jaguar Land Rover Limited",524:"CoroWare Technologies, Inc",525:"Simplo Technology Co., LTD",526:"Omron Healthcare Co., LTD",527:"Comodule GMBH",528:"ikeGPS",529:"Telink Semiconductor Co. Ltd",530:"Interplan Co., Ltd",531:"Wyler AG",532:"IK Multimedia Production srl",533:"Lukoton Experience Oy",534:"MTI Ltd",535:"Tech4home, Lda",536:"Hiotech AB",537:"DOTT Limited",538:"Blue Speck Labs, LLC",539:"Cisco Systems, Inc",540:"Mobicomm Inc",541:"Edamic",542:"Goodnet, Ltd",543:"Luster Leaf Products Inc",544:"Manus Machina BV",545:"Mobiquity Networks Inc",546:"Praxis Dynamics",547:"Philip Morris Products S.A.",548:"Comarch SA",549:"Nestl Nespresso S.A.",550:"Merlinia A/S",551:"LifeBEAM Technologies",552:"Twocanoes Labs, LLC",553:"Muoverti Limited",554:"Stamer Musikanlagen GMBH",555:"Tesla Motors",556:"Pharynks Corporation",557:"Lupine",558:"Siemens AG",559:"Huami (Shanghai) Culture Communication CO., LTD",560:"Foster Electric Company, Ltd",561:"ETA SA",562:"x-Senso Solutions Kft",563:"Shenzhen SuLong Communication Ltd",564:"FengFan (BeiJing) Technology Co, Ltd",565:"Qrio Inc",566:"Pitpatpet Ltd",567:"MSHeli s.r.l.",568:"Trakm8 Ltd",569:"JIN CO, Ltd",570:"Alatech Tehnology",571:"Beijing CarePulse Electronic Technology Co, Ltd",572:"Awarepoint",573:"ViCentra B.V.",574:"Raven Industries",575:"WaveWare Technologies Inc.",576:"Argenox Technologies",577:"Bragi GmbH",578:"16Lab Inc",579:"Masimo Corp",580:"Iotera Inc",581:"Endress+Hauser",582:"ACKme Networks, Inc.",583:"FiftyThree Inc.",584:"Parker Hannifin Corp",585:"Transcranial Ltd",586:"Uwatec AG",587:"Orlan LLC",588:"Blue Clover Devices",589:"M-Way Solutions GmbH",590:"Microtronics Engineering GmbH",591:"Schneider Schreibgerte GmbH",592:"Sapphire Circuits LLC",593:"Lumo Bodytech Inc.",594:"UKC Technosolution",595:"Xicato Inc.",596:"Playbrush",597:"Dai Nippon Printing Co., Ltd.",598:"G24 Power Limited",599:"AdBabble Local Commerce Inc.",600:"Devialet SA",601:"ALTYOR",602:"University of Applied Sciences Valais/Haute Ecole Valaisanne",603:"Five Interactive, LLC dba Zendo",604:"NetEaseHangzhouNetwork co.Ltd.",605:"Lexmark International Inc.",606:"Fluke Corporation",607:"Yardarm Technologies",608:"SensaRx",609:"SECVRE GmbH",610:"Glacial Ridge Technologies",611:"Identiv, Inc.",612:"DDS, Inc.",613:"SMK Corporation",614:"Schawbel Technologies LLC",615:"XMI Systems SA",616:"Cerevo",617:"Torrox GmbH & Co KG",618:"Gemalto",619:"DEKA Research & Development Corp.",620:"Domster Tadeusz Szydlowski",621:"Technogym SPA",622:"FLEURBAEY BVBA",623:"Aptcode Solutions",624:"LSI ADL Technology",625:"Animas Corp",626:"Alps Electric Co., Ltd.",627:"OCEASOFT",628:"Motsai Research",629:"Geotab",630:"E.G.O. Elektro-Gertebau GmbH",631:"bewhere inc",632:"Johnson Outdoors Inc",633:"steute Schaltgerate GmbH & Co. KG",634:"Ekomini inc.",635:"DEFA AS",636:"Aseptika Ltd",637:"HUAWEI Technologies Co., Ltd. ( )",638:"HabitAware, LLC",639:"ruwido austria gmbh",640:"ITEC corporation",641:"StoneL",642:"Sonova AG",643:"Maven Machines, Inc.",644:"Synapse Electronics",645:"Standard Innovation Inc.",646:"RF Code, Inc.",647:"Wally Ventures S.L.",648:"Willowbank Electronics Ltd",649:"SK Telecom",650:"Jetro AS",651:"Code Gears LTD",652:"NANOLINK APS",653:"IF, LLC",654:"RF Digital Corp",655:"Church & Dwight Co., Inc",656:"Multibit Oy",657:"CliniCloud Inc",658:"SwiftSensors",659:"Blue Bite",660:"ELIAS GmbH",661:"Sivantos GmbH",662:"Petzl",663:"storm power ltd",664:"EISST Ltd",665:"Inexess Technology Simma KG",666:"Currant, Inc.",667:"C2 Development, Inc.",668:"Blue Sky Scientific, LLC",669:"ALOTTAZS LABS, LLC",670:"Kupson spol. s r.o.",671:"Areus Engineering GmbH",672:"Impossible Camera GmbH",673:"InventureTrack Systems",674:"LockedUp",675:"Itude",676:"Pacific Lock Company",677:"Tendyron Corporation ( )",678:"Robert Bosch GmbH",679:"Illuxtron international B.V.",680:"miSport Ltd.",681:"Chargelib",682:"Doppler Lab",683:"BBPOS Limited",684:"RTB Elektronik GmbH & Co. KG",685:"Rx Networks, Inc.",686:"WeatherFlow, Inc.",687:"Technicolor USA Inc.",688:"Bestechnic(Shanghai),Ltd",689:"Raden Inc",690:"JouZen Oy",691:"CLABER S.P.A.",692:"Hyginex, Inc.",693:"HANSHIN ELECTRIC RAILWAY CO.,LTD.",694:"Schneider Electric",695:"Oort Technologies LLC",696:"Chrono Therapeutics",697:"Rinnai Corporation",698:"Swissprime Technologies AG",699:"Koha.,Co.Ltd",700:"Genevac Ltd",701:"Chemtronics",702:"Seguro Technology Sp. z o.o.",703:"Redbird Flight Simulations",704:"Dash Robotics",705:"LINE Corporation",706:"Guillemot Corporation",707:"Techtronic Power Tools Technology Limited",708:"Wilson Sporting Goods",709:"Lenovo (Singapore) Pte Ltd. ( )",710:"Ayatan Sensors",711:"Electronics Tomorrow Limited",712:"VASCO Data Security International, Inc.",713:"PayRange Inc.",714:"ABOV Semiconductor",715:"AINA-Wireless Inc.",716:"Eijkelkamp Soil & Water",717:"BMA ergonomics b.v.",718:"Teva Branded Pharmaceutical Products R&D, Inc.",719:"Anima",720:"3M",721:"Empatica Srl",722:"Afero, Inc.",723:"Powercast Corporation",724:"Secuyou ApS",725:"OMRON Corporation",726:"Send Solutions",727:"NIPPON SYSTEMWARE CO.,LTD.",728:"Neosfar",729:"Fliegl Agrartechnik GmbH",730:"Gilvader",731:"Digi International Inc (R)",732:"DeWalch Technologies, Inc.",733:"Flint Rehabilitation Devices, LLC",734:"Samsung SDS Co., Ltd.",735:"Blur Product Development",736:"University of Michigan",737:"Victron Energy BV",738:"NTT docomo",739:"Carmanah Technologies Corp.",740:"Bytestorm Ltd.",741:"Espressif Incorporated ( () )",742:"Unwire",743:"Connected Yard, Inc.",744:"American Music Environments",745:"Sensogram Technologies, Inc.",746:"Fujitsu Limited",747:"Ardic Technology",748:"Delta Systems, Inc",749:"HTC Corporation",750:"Citizen Holdings Co., Ltd.",751:"SMART-INNOVATION.inc",752:"Blackrat Software",753:"The Idea Cave, LLC",754:"GoPro, Inc.",755:"AuthAir, Inc",756:"Vensi, Inc.",757:"Indagem Tech LLC",758:"Intemo Technologies",759:"DreamVisions co., Ltd.",760:"Runteq Oy Ltd",761:"IMAGINATION TECHNOLOGIES LTD",762:"CoSTAR TEchnologies",763:"Clarius Mobile Health Corp.",764:"Shanghai Frequen Microelectronics Co., Ltd.",765:"Uwanna, Inc.",766:"Lierda Science & Technology Group Co., Ltd.",767:"Silicon Laboratories",768:"World Moto Inc.",769:"Giatec Scientific Inc.",770:"Loop Devices, Inc",771:"IACA electronique",772:"Martians Inc",773:"Swipp ApS",774:"Life Laboratory Inc.",775:"FUJI INDUSTRIAL CO.,LTD.",776:"Surefire, LLC",777:"Dolby Labs",778:"Ellisys",779:"Magnitude Lighting Converters",780:"Hilti AG",781:"Devdata S.r.l.",782:"Deviceworx",783:"Shortcut Labs",784:"SGL Italia S.r.l.",785:"PEEQ DATA",786:"Ducere Technologies Pvt Ltd",787:"DiveNav, Inc.",788:"RIIG AI Sp. z o.o.",789:"Thermo Fisher Scientific",790:"AG Measurematics Pvt. Ltd.",791:"CHUO Electronics CO., LTD.",792:"Aspenta International",793:"Eugster Frismag AG",794:"Amber wireless GmbH",795:"HQ Inc",796:"Lab Sensor Solutions",797:"Enterlab ApS",798:"Eyefi, Inc.",799:"MetaSystem S.p.A.",800:"SONO ELECTRONICS. CO., LTD",801:"Jewelbots",802:"Compumedics Limited",803:"Rotor Bike Components",804:"Astro, Inc.",805:"Amotus Solutions",806:"Healthwear Technologies (Changzhou)Ltd",807:"Essex Electronics",808:"Grundfos A/S",809:"Eargo, Inc.",810:"Electronic Design Lab",811:"ESYLUX",812:"NIPPON SMT.CO.,Ltd",813:"BM innovations GmbH",814:"indoormap",815:"OttoQ Inc",816:"North Pole Engineering",817:"3flares Technologies Inc.",818:"Electrocompaniet A.S.",819:"Mul-T-Lock",820:"Corentium AS",821:"Enlighted Inc",822:"GISTIC",823:"AJP2 Holdings, LLC",824:"COBI GmbH",825:"Blue Sky Scientific, LLC",826:"Appception, Inc.",827:"Courtney Thorne Limited",828:"Virtuosys",829:"TPV Technology Limited",830:"Monitra SA",831:"Automation Components, Inc.",832:"Letsense s.r.l.",833:"Etesian Technologies LLC",834:"GERTEC BRASIL LTDA.",835:"Drekker Development Pty. Ltd.",836:"Whirl Inc",837:"Locus Positioning",838:"Acuity Brands Lighting, Inc",839:"Prevent Biometrics",840:"Arioneo",841:"VersaMe",842:"Vaddio",843:"Libratone A/S",844:"HM Electronics, Inc.",845:"TASER International, Inc.",846:"SafeTrust Inc.",847:"Heartland Payment Systems",848:"Bitstrata Systems Inc.",849:"Pieps GmbH",850:"iRiding(Xiamen)Technology Co.,Ltd.",851:"Alpha Audiotronics, Inc.",852:"TOPPAN FORMS CO.,LTD.",853:"Sigma Designs, Inc.",854:"Spectrum Brands, Inc.",855:"Polymap Wireless",856:"MagniWare Ltd.",857:"Novotec Medical GmbH",858:"Medicom Innovation Partner a/s",859:"Matrix Inc.",860:"Eaton Corporation",861:"KYS",862:"Naya Health, Inc.",863:"Acromag",864:"Insulet Corporation",865:"Wellinks Inc.",866:"ON Semiconductor",867:"FREELAP SA",868:"Favero Electronics Srl",869:"BioMech Sensor LLC",870:"BOLTT Sports technologies Private limited",871:"Saphe International",872:"Metormote AB",873:"littleBits",874:"SetPoint Medical",875:"BRControls Products BV",876:"Zipcar",877:"AirBolt Pty Ltd",878:"KeepTruckin Inc",879:"Motiv, Inc.",880:"Wazombi Labs O",881:"ORBCOMM",882:"Nixie Labs, Inc.",883:"AppNearMe Ltd",884:"Holman Industries",885:"Expain AS",886:"Electronic Temperature Instruments Ltd",887:"Plejd AB",888:"Propeller Health",889:"Shenzhen iMCO Electronic Technology Co.,Ltd",890:"Algoria",891:"Apption Labs Inc.",892:"Cronologics Corporation",893:"MICRODIA Ltd.",894:"lulabytes S.L.",895:"Nestec S.A.",896:"LLC MEGA - F service",897:"Sharp Corporation",898:"Precision Outcomes Ltd",899:"Kronos Incorporated",900:"OCOSMOS Co., Ltd.",901:"Embedded Electronic Solutions Ltd. dba e2Solutions",902:"Aterica Inc.",903:"BluStor PMC, Inc.",904:"Kapsch TrafficCom AB",905:"ActiveBlu Corporation",906:"Kohler Mira Limited",907:"Noke",908:"Appion Inc.",909:"Resmed Ltd",910:"Crownstone B.V.",911:"Xiaomi Inc.",912:"INFOTECH s.r.o.",913:"Thingsquare AB",914:"T&D",915:"LAVAZZA S.p.A.",916:"Netclearance Systems, Inc.",917:"SDATAWAY",918:"BLOKS GmbH",919:"LEGO System A/S",920:"Thetatronics Ltd",921:"Nikon Corporation",922:"NeST",923:"South Silicon Valley Microelectronics",924:"ALE International",925:"CareView Communications, Inc.",926:"SchoolBoard Limited",927:"Molex Corporation",928:"IVT Wireless Limited",929:"Alpine Labs LLC",930:"Candura Instruments",931:"SmartMovt Technology Co., Ltd",932:"Token Zero Ltd",933:"ACE CAD Enterprise Co., Ltd. (ACECAD)",934:"Medela, Inc",935:"AeroScout",936:"Esrille Inc.",937:"THINKERLY SRL",938:"Exon Sp. z o.o.",939:"Meizu Technology Co., Ltd.",940:"Smablo LTD",941:"XiQ",942:"Allswell Inc.",943:"Comm-N-Sense Corp DBA Verigo",944:"VIBRADORM GmbH",945:"Otodata Wireless Network Inc.",946:"Propagation Systems Limited",947:"Midwest Instruments & Controls",948:"Alpha Nodus, inc.",949:"petPOMM, Inc",950:"Mattel",951:"Airbly Inc.",952:"A-Safe Limited",953:"FREDERIQUE CONSTANT SA",954:"Maxscend Microelectronics Company Limited",955:"Abbott Diabetes Care",956:"ASB Bank Ltd",957:"amadas",958:"Applied Science, Inc.",959:"iLumi Solutions Inc.",960:"Arch Systems Inc.",961:"Ember Technologies, Inc.",962:"Snapchat Inc",963:"Casambi Technologies Oy",964:"Pico Technology Inc.",965:"St. Jude Medical, Inc.",966:"Intricon",967:"Structural Health Systems, Inc.",968:"Avvel International",969:"Gallagher Group",970:"In2things Automation Pvt. Ltd.",971:"SYSDEV Srl",972:"Vonkil Technologies Ltd",973:"Wynd Technologies, Inc.",974:"CONTRINEX S.A.",975:"MIRA, Inc.",976:"Watteam Ltd",977:"Density Inc.",978:"IOT Pot India Private Limited",979:"Sigma Connectivity AB",980:"PEG PEREGO SPA",981:"Wyzelink Systems Inc.",982:"Yota Devices LTD",983:"FINSECUR",984:"Zen-Me Labs Ltd",985:"3IWare Co., Ltd.",986:"EnOcean GmbH",987:"Instabeat, Inc",988:"Nima Labs",989:"Andreas Stihl AG & Co. KG",990:"Nathan Rhoades LLC",991:"Grob Technologies, LLC",992:"Actions (Zhuhai) Technology Co., Limited",993:"SPD Development Company Ltd",994:"Sensoan Oy",995:"Qualcomm Life Inc",996:"Chip-ing AG",997:"ffly4u",998:"IoT Instruments Oy",999:"TRUE Fitness Technology",1e3:"Reiner Kartengeraete GmbH & Co. KG.",1001:"SHENZHEN LEMONJOY TECHNOLOGY CO., LTD.",1002:"Hello Inc.",1003:"Evollve Inc.",1004:"Jigowatts Inc.",1005:"BASIC MICRO.COM,INC.",1006:"CUBE TECHNOLOGIES",1007:"foolography GmbH",1008:"CLINK",1009:"Hestan Smart Cooking Inc.",1010:"WindowMaster A/S",1011:"Flowscape AB",1012:"PAL Technologies Ltd",1013:"WHERE, Inc.",1014:"Iton Technology Corp.",1015:"Owl Labs Inc.",1016:"Rockford Corp.",1017:"Becon Technologies Co.,Ltd.",1018:"Vyassoft Technologies Inc",1019:"Nox Medical",1020:"Kimberly-Clark",1021:"Trimble Navigation Ltd.",1022:"Littelfuse",1023:"Withings",1024:"i-developer IT Beratung UG",1026:"Sears Holdings Corporation",1027:"Gantner Electronic GmbH",1028:"Authomate Inc",1029:"Vertex International, Inc.",1030:"Airtago",1031:"Swiss Audio SA",1032:"ToGetHome Inc.",1033:"AXIS",1034:"Openmatics",1035:"Jana Care Inc.",1036:"Senix Corporation",1037:"NorthStar Battery Company, LLC",1038:"SKF (U.K.) Limited",1039:"CO-AX Technology, Inc.",1040:"Fender Musical Instruments",1041:"Luidia Inc",1042:"SEFAM",1043:"Wireless Cables Inc",1044:"Lightning Protection International Pty Ltd",1045:"Uber Technologies Inc",1046:"SODA GmbH",1047:"Fatigue Science",1048:"Alpine Electronics Inc.",1049:"Novalogy LTD",1050:"Friday Labs Limited",1051:"OrthoAccel Technologies",1052:"WaterGuru, Inc.",1053:"Benning Elektrotechnik und Elektronik GmbH & Co. KG",1054:"Dell Computer Corporation",1055:"Kopin Corporation",1056:"TecBakery GmbH",1057:"Backbone Labs, Inc.",1058:"DELSEY SA",1059:"Chargifi Limited",1060:"Trainesense Ltd.",1061:"Unify Software and Solutions GmbH & Co. KG",1062:"Husqvarna AB",1063:"Focus fleet and fuel management inc",1064:"SmallLoop, LLC",1065:"Prolon Inc.",1066:"BD Medical",1067:"iMicroMed Incorporated",1068:"Ticto N.V.",1069:"Meshtech AS",1070:"MemCachier Inc.",1071:"Danfoss A/S",1072:"SnapStyk Inc.",1073:"Amyway Corporation",1074:"Silk Labs, Inc.",1075:"Pillsy Inc.",1076:"Hatch Baby, Inc.",1077:"Blocks Wearables Ltd.",1078:"Drayson Technologies (Europe) Limited",1079:"eBest IOT Inc.",1080:"Helvar Ltd",1081:"Radiance Technologies",1082:"Nuheara Limited",1083:"Appside co., ltd.",1084:"DeLaval",1085:"Coiler Corporation",1086:"Thermomedics, Inc.",1087:"Tentacle Sync GmbH",1088:"Valencell, Inc.",1089:"iProtoXi Oy",1090:"SECOM CO., LTD.",1091:"Tucker International LLC",1092:"Metanate Limited",1093:"Kobian Canada Inc.",1094:"NETGEAR, Inc.",1095:"Fabtronics Australia Pty Ltd",1096:"Grand Centrix GmbH",1097:"1UP USA.com llc",1098:"SHIMANO INC.",1099:"Nain Inc.",1100:"LifeStyle Lock, LLC",1101:"VEGA Grieshaber KG",1102:"Xtrava Inc.",1103:"TTS Tooltechnic Systems AG & Co. KG",1104:"Teenage Engineering AB",1105:"Tunstall Nordic AB",1106:"Svep Design Center AB",1107:"GreenPeak Technologies BV",1108:"Sphinx Electronics GmbH & Co KG",1109:"Atomation",1110:"Nemik Consulting Inc",1111:"RF INNOVATION",1112:"Mini Solution Co., Ltd.",1113:"Lumenetix, Inc",1114:"2048450 Ontario Inc",1115:"SPACEEK LTD",1116:"Delta T Corporation",1117:"Boston Scientific Corporation",1118:"Nuviz, Inc.",1119:"Real Time Automation, Inc.",1120:"Kolibree",1121:"vhf elektronik GmbH",1122:"Bonsai Systems GmbH",1123:"Fathom Systems Inc.",1124:"Bellman & Symfon",1125:"International Forte Group LLC",1126:"CycleLabs Solutions inc.",1127:"Codenex Oy",1128:"Kynesim Ltd",1129:"Palago AB",1130:"INSIGMA INC.",1131:"PMD Solutions",1132:"Qingdao Realtime Technology Co., Ltd.",1133:"BEGA Gantenbrink-Leuchten KG",1134:"Pambor Ltd.",65535:"SPECIAL USE/DEFAULT"}});var wa=ae(va=>{"use strict";var J0=k("child_process").exec,Q0=k("child_process").execSync,ed=k("path"),pt=pe(),td=Ca(),nd=k("fs"),jt=process.platform,rd=jt==="linux"||jt==="android",sd=jt==="darwin",id=jt==="win32",od=jt==="freebsd",ad=jt==="openbsd",ld=jt==="netbsd",cd=jt==="sunos";function di(n){let t="";return n.indexOf("keyboard")>=0&&(t="Keyboard"),n.indexOf("mouse")>=0&&(t="Mouse"),n.indexOf("trackpad")>=0&&(t="Trackpad"),n.indexOf("speaker")>=0&&(t="Speaker"),n.indexOf("headset")>=0&&(t="Headset"),n.indexOf("phone")>=0&&(t="Phone"),n.indexOf("macbook")>=0&&(t="Computer"),n.indexOf("imac")>=0&&(t="Computer"),n.indexOf("ipad")>=0&&(t="Tablet"),n.indexOf("watch")>=0&&(t="Watch"),n.indexOf("headphone")>=0&&(t="Headset"),t}function ud(n){let t=n.split(" ")[0];return n=n.toLowerCase(),n.indexOf("apple")>=0&&(t="Apple"),n.indexOf("ipad")>=0&&(t="Apple"),n.indexOf("imac")>=0&&(t="Apple"),n.indexOf("iphone")>=0&&(t="Apple"),n.indexOf("magic mouse")>=0&&(t="Apple"),n.indexOf("magic track")>=0&&(t="Apple"),n.indexOf("macbook")>=0&&(t="Apple"),t}function pd(n){let t=parseInt(n);if(!isNaN(t))return td[t]}function dd(n,t,e){let r={};return r.device=null,r.name=pt.getValue(n,"name","="),r.manufacturer=null,r.macDevice=t,r.macHost=e,r.batteryPercent=null,r.type=di(r.name.toLowerCase()),r.connected=!1,r}function pi(n,t){let e={},r=((n.device_minorClassOfDevice_string||n.device_majorClassOfDevice_string||n.device_minorType||"")+(n.device_name||"")).toLowerCase();return e.device=n.device_services||"",e.name=n.device_name||"",e.manufacturer=n.device_manufacturer||pd(n.device_vendorID)||ud(n.device_name||"")||"",e.macDevice=(n.device_addr||n.device_address||"").toLowerCase().replace(/-/g,":"),e.macHost=t,e.batteryPercent=n.device_batteryPercent||null,e.type=di(r),e.connected=n.device_isconnected==="attrib_Yes"||!1,e}function fd(n){let t={};return t.device=null,t.name=pt.getValue(n,"name",":"),t.manufacturer=pt.getValue(n,"manufacturer",":"),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=di(t.name.toLowerCase()),t.connected=null,t}function md(n){return new Promise(t=>{process.nextTick(()=>{let e=[];if(rd){pt.getFilesInPath("/var/lib/bluetooth/").forEach(i=>{let s=ed.basename(i),o=i.split("/"),a=o.length>=6?o[o.length-2]:null,l=o.length>=7?o[o.length-3]:null;if(s==="info"){let c=nd.readFileSync(i,{encoding:"utf8"}).split(`
|
|
384
|
-
`);e.push(dd(c,a,l))}});try{let i=Q0("hcitool con",pt.execOptsLinux).toString().toLowerCase();for(let s=0;s<e.length;s++)e[s].macDevice&&e[s].macDevice.length>10&&i.indexOf(e[s].macDevice.toLowerCase())>=0&&(e[s].connected=!0)}catch{pt.noop()}n&&n(e),t(e)}sd&&J0("system_profiler SPBluetoothDataType -json",function(i,s){if(!i)try{let o=JSON.parse(s.toString());if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_title&&o.SPBluetoothDataType[0].device_title.length){let a=null;o.SPBluetoothDataType[0].local_device_title&&o.SPBluetoothDataType[0].local_device_title.general_address&&(a=o.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":")),o.SPBluetoothDataType[0].device_title.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0];let d=pi(p,a);e.push(d)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_connected&&o.SPBluetoothDataType[0].device_connected.length){let a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_connected.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0],p.device_isconnected="attrib_Yes";let d=pi(p,a);e.push(d)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_not_connected&&o.SPBluetoothDataType[0].device_not_connected.length){let a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_not_connected.forEach(l=>{let c=l,u=Object.keys(c);if(u&&u.length===1){let p=c[u[0]];p.device_name=u[0],p.device_isconnected="attrib_No";let d=pi(p,a);e.push(d)}})}}catch{pt.noop()}n&&n(e),t(e)}),id&&pt.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then((r,i)=>{i||r.toString().split(/\n\s*\n/).forEach(o=>{pt.getValue(o.split(`
|
|
385
|
-
`),"PNPClass",":")==="Bluetooth"&&e.push(fd(o.split(`
|
|
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
|
-
`);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",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};
|
|
2
|
+
var gt=Object.create;var Me=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var be=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ue=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var kt=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xt(e))!wt.call(t,n)&&n!==r&&Me(t,n,{get:()=>e[n],enumerable:!(s=yt(e,n))||s.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?gt(bt(t)):{},kt(e||!t||!t.__esModule?Me(r,"default",{value:t,enumerable:!0}):r,t));var nt=Ue((ms,Vr)=>{Vr.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 ct=Ue((vs,Z)=>{var Le=be("fs"),Ze=be("path"),jr=be("os"),Pr=be("crypto"),Lr=nt(),$e=Lr.version,Zr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function $r(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
3
|
+
`);let s;for(;(s=Zr.exec(r))!=null;){let n=s[1],a=s[2]||"";a=a.trim();let i=a[0];a=a.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),i==='"'&&(a=a.replace(/\\n/g,`
|
|
4
|
+
`),a=a.replace(/\\r/g,"\r")),e[n]=a}return e}function Mr(t){let e=ot(t),r=x.configDotenv({path:e});if(!r.parsed){let i=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw i.code="MISSING_DATA",i}let s=it(t).split(","),n=s.length,a;for(let i=0;i<n;i++)try{let o=s[i].trim(),d=zr(r,o);a=x.decrypt(d.ciphertext,d.key);break}catch(o){if(i+1>=n)throw o}return x.parse(a)}function Ur(t){console.log(`[dotenv@${$e}][INFO] ${t}`)}function Fr(t){console.log(`[dotenv@${$e}][WARN] ${t}`)}function Ie(t){console.log(`[dotenv@${$e}][DEBUG] ${t}`)}function it(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function zr(t,e){let r;try{r=new URL(e)}catch(o){if(o.code==="ERR_INVALID_URL"){let d=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 d.code="INVALID_DOTENV_KEY",d}throw o}let s=r.password;if(!s){let o=new Error("INVALID_DOTENV_KEY: Missing key part");throw o.code="INVALID_DOTENV_KEY",o}let n=r.searchParams.get("environment");if(!n){let o=new Error("INVALID_DOTENV_KEY: Missing environment part");throw o.code="INVALID_DOTENV_KEY",o}let a=`DOTENV_VAULT_${n.toUpperCase()}`,i=t.parsed[a];if(!i){let o=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${a} in your .env.vault file.`);throw o.code="NOT_FOUND_DOTENV_ENVIRONMENT",o}return{ciphertext:i,key:s}}function ot(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)Le.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Ze.resolve(process.cwd(),".env.vault");return Le.existsSync(e)?e:null}function at(t){return t[0]==="~"?Ze.join(jr.homedir(),t.slice(1)):t}function Br(t){Ur("Loading env from encrypted .env.vault");let e=x._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),x.populate(r,e,t),{parsed:e}}function Gr(t){let e=Ze.resolve(process.cwd(),".env"),r="utf8",s=!!(t&&t.debug);t&&t.encoding?r=t.encoding:s&&Ie("No encoding is specified. UTF-8 is used by default");let n=[e];if(t&&t.path)if(!Array.isArray(t.path))n=[at(t.path)];else{n=[];for(let d of t.path)n.push(at(d))}let a,i={};for(let d of n)try{let u=x.parse(Le.readFileSync(d,{encoding:r}));x.populate(i,u,t)}catch(u){s&&Ie(`Failed to load ${d} ${u.message}`),a=u}let o=process.env;return t&&t.processEnv!=null&&(o=t.processEnv),x.populate(o,i,t),a?{parsed:i,error:a}:{parsed:i}}function Yr(t){if(it(t).length===0)return x.configDotenv(t);let e=ot(t);return e?x._configVault(t):(Fr(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),x.configDotenv(t))}function Wr(t,e){let r=Buffer.from(e.slice(-64),"hex"),s=Buffer.from(t,"base64"),n=s.subarray(0,12),a=s.subarray(-16);s=s.subarray(12,-16);try{let i=Pr.createDecipheriv("aes-256-gcm",r,n);return i.setAuthTag(a),`${i.update(s)}${i.final()}`}catch(i){let o=i instanceof RangeError,d=i.message==="Invalid key length",u=i.message==="Unsupported state or unable to authenticate data";if(o||d){let p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(u){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw i}}function Kr(t,e,r={}){let s=!!(r&&r.debug),n=!!(r&&r.override);if(typeof e!="object"){let a=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw a.code="OBJECT_REQUIRED",a}for(let a of Object.keys(e))Object.prototype.hasOwnProperty.call(t,a)?(n===!0&&(t[a]=e[a]),s&&Ie(n===!0?`"${a}" is already defined and WAS overwritten`:`"${a}" is already defined and was NOT overwritten`)):t[a]=e[a]}var x={configDotenv:Gr,_configVault:Br,_parseVault:Mr,config:Yr,decrypt:Wr,parse:$r,populate:Kr};Z.exports.configDotenv=x.configDotenv;Z.exports._configVault=x._configVault;Z.exports._parseVault=x._parseVault;Z.exports.config=x.config;Z.exports.decrypt=x.decrypt;Z.exports.parse=x.parse;Z.exports.populate=x.populate;Z.exports=x});var y;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},t.getValidEnumValues=n=>{let a=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},t.find=(n,a)=>{for(let i of n)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(y||(y={}));var De;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(De||(De={}));var f=y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),j=t=>{switch(typeof t){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(t)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(t)?f.array:t===null?f.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?f.promise:typeof Map<"u"&&t instanceof Map?f.map:typeof Set<"u"&&t instanceof Set?f.set:typeof Date<"u"&&t instanceof Date?f.date:f.object;default:return f.unknown}},c=y.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"]),At=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),N=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(r(i));else{let o=s,d=0;for(;d<i.path.length;){let u=i.path[d];d===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],d++}}};return n(this),s}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};N.create=t=>new N(t);var oe=(t,e)=>{let r;switch(t.code){case c.invalid_type:t.received===f.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,y.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${y.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${y.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${y.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:r="Invalid function arguments";break;case c.invalid_return_type:r="Invalid function return type";break;case c.invalid_date:r="Invalid date";break;case c.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:y.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case c.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case c.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case c.custom:r="Invalid input";break;case c.invalid_intersection_types:r="Intersection results could not be merged";break;case c.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:r="Number must be finite";break;default:r=e.defaultError,y.assertNever(t)}return{message:r}},Be=oe;function Nt(t){Be=t}function we(){return Be}var ke=t=>{let{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="",d=s.filter(u=>!!u).slice().reverse();for(let u of d)o=u(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},Tt=[];function l(t,e){let r=we(),s=ke({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===oe?void 0:oe].filter(n=>!!n)});t.common.issues.push(s)}var w=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let n of r){if(n.status==="aborted")return v;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let n of r){let a=await n.key,i=await n.value;s.push({key:a,value:i})}return t.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let n of r){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return v;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},v=Object.freeze({status:"aborted"}),ie=t=>({status:"dirty",value:t}),k=t=>({status:"valid",value:t}),Ve=t=>t.status==="aborted",je=t=>t.status==="dirty",z=t=>t.status==="valid",me=t=>typeof Promise<"u"&&t instanceof Promise;function Ee(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function Ge(t,e,r,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}var h;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var he,pe,R=class{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}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}},Fe=(t,e)=>{if(z(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new N(t.common.issues);return this._error=r,this._error}}};function _(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var d,u;let{message:p}=t;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(d=p??s)!==null&&d!==void 0?d:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=p??r)!==null&&u!==void 0?u:o.defaultError}},description:n}}var g=class{get description(){return this._def.description}_getType(e){return j(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:j(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:j(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(me(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){var s;let n={common:{issues:[],async:(s=r?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Fe(n,a)}"~validate"(e){var r,s;let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:n});return z(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(r=a?.message)===null||r===void 0?void 0:r.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>z(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:j(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(me(n)?n:Promise.resolve(n));return Fe(s,a)}refine(e,r){let s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new T({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:r=>this["~validate"](r)}}optional(){return O.create(this,this._def)}nullable(){return S.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return L.create(this)}promise(){return U.create(this,this._def)}or(e){return J.create([this,e],this._def)}and(e){return H.create(this,e,this._def)}transform(e){return new T({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new re({..._(this._def),innerType:this,defaultValue:r,typeName:m.ZodDefault})}brand(){return new ve({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new se({..._(this._def),innerType:this,catchValue:r,typeName:m.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return _e.create(this,e)}readonly(){return ne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ot=/^c[^\s-]{8,}$/i,Rt=/^[0-9a-z]+$/,It=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ct=/^[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,St=/^[a-z0-9_-]{21}$/i,Dt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Vt=/^[-+]?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)?)??$/,jt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Se,Lt=/^(?:(?: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])$/,Zt=/^(?:(?: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])$/,$t=/^(([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]))$/,Mt=/^(([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])$/,Ut=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ft=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ye="((\\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])))",zt=new RegExp(`^${Ye}$`);function We(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Bt(t){return new RegExp(`^${We(t)}$`)}function Ke(t){let e=`${Ye}T${We(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Gt(t,e){return!!((e==="v4"||!e)&&Lt.test(t)||(e==="v6"||!e)&&$t.test(t))}function Yt(t,e){if(!Dt.test(t))return!1;try{let[r]=t.split("."),s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function Wt(t,e){return!!((e==="v4"||!e)&&Zt.test(t)||(e==="v6"||!e)&&Mt.test(t))}var $=class t extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),v}let s=new w,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")jt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Se||(Se=new RegExp(Pt,"u")),Se.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")St.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Rt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")It.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Ke(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?zt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Bt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?Vt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Gt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Yt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Wt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Ut.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ft.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):y.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){var r,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(s=e?.local)!==null&&s!==void 0?s:!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...h.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...h.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...h.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...h.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...h.errToObj(r)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};$.create=t=>{var e;return new $({checks:[],typeName:m.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,..._(t)})};function Kt(t,e){let r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=parseInt(t.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}var B=class t extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),v}let s,n=new w;for(let a of this._def.checks)a.kind==="int"?y.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Kt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_finite,message:a.message}),n.dirty()):y.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,h.toString(r))}gt(e,r){return this.setLimit("min",e,!1,h.toString(r))}lte(e,r){return this.setLimit("max",e,!0,h.toString(r))}lt(e,r){return this.setLimit("max",e,!1,h.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&y.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};B.create=t=>new B({checks:[],typeName:m.ZodNumber,coerce:t?.coerce||!1,..._(t)});var G=class t extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s,n=new w;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):y.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.bigint,received:r.parsedType}),v}gte(e,r){return this.setLimit("min",e,!0,h.toString(r))}gt(e,r){return this.setLimit("min",e,!1,h.toString(r))}lte(e,r){return this.setLimit("max",e,!0,h.toString(r))}lt(e,r){return this.setLimit("max",e,!1,h.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};G.create=t=>{var e;return new G({checks:[],typeName:m.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,..._(t)})};var Y=class extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),v}return k(e.data)}};Y.create=t=>new Y({typeName:m.ZodBoolean,coerce:t?.coerce||!1,..._(t)});var W=class t extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),v}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),v}let s=new w,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):y.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};W.create=t=>new W({checks:[],coerce:t?.coerce||!1,typeName:m.ZodDate,..._(t)});var ce=class extends g{_parse(e){if(this._getType(e)!==f.symbol){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),v}return k(e.data)}};ce.create=t=>new ce({typeName:m.ZodSymbol,..._(t)});var K=class extends g{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),v}return k(e.data)}};K.create=t=>new K({typeName:m.ZodUndefined,..._(t)});var q=class extends g{_parse(e){if(this._getType(e)!==f.null){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),v}return k(e.data)}};q.create=t=>new q({typeName:m.ZodNull,..._(t)});var M=class extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}};M.create=t=>new M({typeName:m.ZodAny,..._(t)});var P=class extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}};P.create=t=>new P({typeName:m.ZodUnknown,..._(t)});var I=class extends g{_parse(e){let r=this._getOrReturnCtx(e);return l(r,{code:c.invalid_type,expected:f.never,received:r.parsedType}),v}};I.create=t=>new I({typeName:m.ZodNever,..._(t)});var de=class extends g{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),v}return k(e.data)}};de.create=t=>new de({typeName:m.ZodVoid,..._(t)});var L=class t extends g{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==f.array)return l(r,{code:c.invalid_type,expected:f.array,received:r.parsedType}),v;if(n.exactLength!==null){let i=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(i||o)&&(l(r,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(l(r,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(l(r,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>n.type._parseAsync(new R(r,i,r.path,o)))).then(i=>w.mergeArray(s,i));let a=[...r.data].map((i,o)=>n.type._parseSync(new R(r,i,r.path,o)));return w.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:h.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:h.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:h.toString(r)}})}nonempty(e){return this.min(1,e)}};L.create=(t,e)=>new L({type:t,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function ae(t){if(t instanceof A){let e={};for(let r in t.shape){let s=t.shape[r];e[r]=O.create(ae(s))}return new A({...t._def,shape:()=>e})}else return t instanceof L?new L({...t._def,type:ae(t.element)}):t instanceof O?O.create(ae(t.unwrap())):t instanceof S?S.create(ae(t.unwrap())):t instanceof C?C.create(t.items.map(e=>ae(e))):t}var A=class t extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=y.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==f.object){let u=this._getOrReturnCtx(e);return l(u,{code:c.invalid_type,expected:f.object,received:u.parsedType}),v}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof I&&this._def.unknownKeys==="strip"))for(let u in n.data)i.includes(u)||o.push(u);let d=[];for(let u of i){let p=a[u],E=n.data[u];d.push({key:{status:"valid",value:u},value:p._parse(new R(n,E,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof I){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of o)d.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(u==="strict")o.length>0&&(l(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let p of o){let E=n.data[p];d.push({key:{status:"valid",value:p},value:u._parse(new R(n,E,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of d){let E=await p.key,xe=await p.value;u.push({key:E,value:xe,alwaysSet:p.alwaysSet})}return u}).then(u=>w.mergeObjectSync(s,u)):w.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var n,a,i,o;let d=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,r,s).message)!==null&&i!==void 0?i:s.defaultError;return r.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:d}:{message:d}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return y.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return y.objectKeys(this.shape).forEach(s=>{e[s]||(r[s]=this.shape[s])}),new t({...this._def,shape:()=>r})}deepPartial(){return ae(this)}partial(e){let r={};return y.objectKeys(this.shape).forEach(s=>{let n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return y.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof O;)a=a._def.innerType;r[s]=a}}),new t({...this._def,shape:()=>r})}keyof(){return qe(y.objectKeys(this.shape))}};A.create=(t,e)=>new A({shape:()=>t,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,..._(e)});A.strictCreate=(t,e)=>new A({shape:()=>t,unknownKeys:"strict",catchall:I.create(),typeName:m.ZodObject,..._(e)});A.lazycreate=(t,e)=>new A({shape:t,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,..._(e)});var J=class extends g{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new N(o.ctx.common.issues));return l(r,{code:c.invalid_union,unionErrors:i}),v}if(r.common.async)return Promise.all(s.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let d of s){let u={...r,common:{...r.common,issues:[]},parent:null},p=d._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(d=>new N(d));return l(r,{code:c.invalid_union,unionErrors:o}),v}}get options(){return this._def.options}};J.create=(t,e)=>new J({options:t,typeName:m.ZodUnion,..._(e)});var V=t=>t instanceof Q?V(t.schema):t instanceof T?V(t.innerType()):t instanceof X?[t.value]:t instanceof ee?t.options:t instanceof te?y.objectValues(t.enum):t instanceof re?V(t._def.innerType):t instanceof K?[void 0]:t instanceof q?[null]:t instanceof O?[void 0,...V(t.unwrap())]:t instanceof S?[null,...V(t.unwrap())]:t instanceof ve||t instanceof ne?V(t.unwrap()):t instanceof se?V(t._def.innerType):[],Ae=class t extends g{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.object)return l(r,{code:c.invalid_type,expected:f.object,received:r.parsedType}),v;let s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(l(r,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let n=new Map;for(let a of r){let i=V(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new t({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,..._(s)})}};function Pe(t,e){let r=j(t),s=j(e);if(t===e)return{valid:!0,data:t};if(r===f.object&&s===f.object){let n=y.objectKeys(e),a=y.objectKeys(t).filter(o=>n.indexOf(o)!==-1),i={...t,...e};for(let o of a){let d=Pe(t[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(r===f.array&&s===f.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],d=Pe(i,o);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return r===f.date&&s===f.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var H=class extends g{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Ve(a)||Ve(i))return v;let o=Pe(a.value,i.value);return o.valid?((je(a)||je(i))&&r.dirty(),{status:r.value,value:o.data}):(l(s,{code:c.invalid_intersection_types}),v)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};H.create=(t,e,r)=>new H({left:t,right:e,typeName:m.ZodIntersection,..._(r)});var C=class t extends g{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),v;if(s.data.length<this._def.items.length)return l(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...s.data].map((i,o)=>{let d=this._def.items[o]||this._def.rest;return d?d._parse(new R(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>w.mergeArray(r,i)):w.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};C.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new C({items:t,typeName:m.ZodTuple,rest:null,..._(e)})};var Ne=class t extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),v;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new R(s,o,s.path,o)),value:i._parse(new R(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?w.mergeObjectAsync(r,n):w.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof g?new t({keyType:e,valueType:r,typeName:m.ZodRecord,..._(s)}):new t({keyType:$.create(),valueType:e,typeName:m.ZodRecord,..._(r)})}},ue=class extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),v;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,d],u)=>({key:n._parse(new R(s,o,s.path,[u,"key"])),value:a._parse(new R(s,d,s.path,[u,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let d of i){let u=await d.key,p=await d.value;if(u.status==="aborted"||p.status==="aborted")return v;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(u.value,p.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let d of i){let u=d.key,p=d.value;if(u.status==="aborted"||p.status==="aborted")return v;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(u.value,p.value)}return{status:r.value,value:o}}}};ue.create=(t,e,r)=>new ue({valueType:e,keyType:t,typeName:m.ZodMap,..._(r)});var le=class t extends g{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),v;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let a=this._def.valueType;function i(d){let u=new Set;for(let p of d){if(p.status==="aborted")return v;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let o=[...s.data.values()].map((d,u)=>a._parse(new R(s,d,s.path,u)));return s.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:h.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:h.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};le.create=(t,e)=>new le({valueType:t,minSize:null,maxSize:null,typeName:m.ZodSet,..._(e)});var Te=class t extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.function)return l(r,{code:c.invalid_type,expected:f.function,received:r.parsedType}),v;function s(o,d){return ke({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,we(),oe].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:d}})}function n(o,d){return ke({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,we(),oe].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:d}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof U){let o=this;return k(async function(...d){let u=new N([]),p=await o._def.args.parseAsync(d,a).catch(F=>{throw u.addIssue(s(d,F)),u}),E=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(E,a).catch(F=>{throw u.addIssue(n(E,F)),u})})}else{let o=this;return k(function(...d){let u=o._def.args.safeParse(d,a);if(!u.success)throw new N([s(d,u.error)]);let p=Reflect.apply(i,this,u.data),E=o._def.returns.safeParse(p,a);if(!E.success)throw new N([n(p,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:C.create(e).rest(P.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new t({args:e||C.create([]).rest(P.create()),returns:r||P.create(),typeName:m.ZodFunction,..._(s)})}},Q=class extends g{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Q.create=(t,e)=>new Q({getter:t,typeName:m.ZodLazy,..._(e)});var X=class extends g{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return l(r,{received:r.data,code:c.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}};X.create=(t,e)=>new X({value:t,typeName:m.ZodLiteral,..._(e)});function qe(t,e){return new ee({values:t,typeName:m.ZodEnum,..._(e)})}var ee=class t extends g{constructor(){super(...arguments),he.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return l(r,{expected:y.joinValues(s),received:r.parsedType,code:c.invalid_type}),v}if(Ee(this,he,"f")||Ge(this,he,new Set(this._def.values),"f"),!Ee(this,he,"f").has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return l(r,{received:r.data,code:c.invalid_enum_value,options:s}),v}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};he=new WeakMap;ee.create=qe;var te=class extends g{constructor(){super(...arguments),pe.set(this,void 0)}_parse(e){let r=y.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){let n=y.objectValues(r);return l(s,{expected:y.joinValues(n),received:s.parsedType,code:c.invalid_type}),v}if(Ee(this,pe,"f")||Ge(this,pe,new Set(y.getValidEnumValues(this._def.values)),"f"),!Ee(this,pe,"f").has(e.data)){let n=y.objectValues(r);return l(s,{received:s.data,code:c.invalid_enum_value,options:n}),v}return k(e.data)}get enum(){return this._def.values}};pe=new WeakMap;te.create=(t,e)=>new te({values:t,typeName:m.ZodNativeEnum,..._(e)});var U=class extends g{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.promise&&r.common.async===!1)return l(r,{code:c.invalid_type,expected:f.promise,received:r.parsedType}),v;let s=r.parsedType===f.promise?r.data:Promise.resolve(r.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};U.create=(t,e)=>new U({type:t,typeName:m.ZodPromise,..._(e)});var T=class extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return v;let d=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return d.status==="aborted"?v:d.status==="dirty"||r.value==="dirty"?ie(d.value):d});{if(r.value==="aborted")return v;let o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?v:o.status==="dirty"||r.value==="dirty"?ie(o.value):o}}if(n.type==="refinement"){let i=o=>{let d=n.refinement(o,a);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?v:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?v:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!z(i))return i;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>z(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:r.value,value:o})):i);y.assertNever(n)}};T.create=(t,e,r)=>new T({schema:t,typeName:m.ZodEffects,effect:e,..._(r)});T.createWithPreprocess=(t,e,r)=>new T({schema:e,effect:{type:"preprocess",transform:t},typeName:m.ZodEffects,..._(r)});var O=class extends g{_parse(e){return this._getType(e)===f.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};O.create=(t,e)=>new O({innerType:t,typeName:m.ZodOptional,..._(e)});var S=class extends g{_parse(e){return this._getType(e)===f.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.create=(t,e)=>new S({innerType:t,typeName:m.ZodNullable,..._(e)});var re=class extends g{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var se=class extends g{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return me(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};se.create=(t,e)=>new se({innerType:t,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var fe=class extends g{_parse(e){if(this._getType(e)!==f.nan){let s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),v}return{status:"valid",value:e.data}}};fe.create=t=>new fe({typeName:m.ZodNaN,..._(t)});var qt=Symbol("zod_brand"),ve=class extends g{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},_e=class t extends g{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?v:a.status==="dirty"?(r.dirty(),ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?v:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new t({in:e,out:r,typeName:m.ZodPipeline})}},ne=class extends g{_parse(e){let r=this._def.innerType._parse(e),s=n=>(z(n)&&(n.value=Object.freeze(n.value)),n);return me(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}};ne.create=(t,e)=>new ne({innerType:t,typeName:m.ZodReadonly,..._(e)});function Je(t,e={},r){return t?M.create().superRefine((s,n)=>{var a,i;if(!t(s)){let o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,d=(i=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&i!==void 0?i:!0,u=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...u,fatal:d})}}):M.create()}var Jt={object:A.lazycreate},m;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(m||(m={}));var Ht=(t,e={message:`Input not instance of ${t.name}`})=>Je(r=>r instanceof t,e),He=$.create,Qe=B.create,Qt=fe.create,Xt=G.create,Xe=Y.create,er=W.create,tr=ce.create,rr=K.create,sr=q.create,nr=M.create,ar=P.create,ir=I.create,or=de.create,cr=L.create,ge=A.create,dr=A.strictCreate,ur=J.create,lr=Ae.create,fr=H.create,hr=C.create,pr=Ne.create,mr=ue.create,vr=le.create,_r=Te.create,gr=Q.create,yr=X.create,xr=ee.create,br=te.create,wr=U.create,ze=T.create,kr=O.create,Er=S.create,Ar=T.createWithPreprocess,Nr=_e.create,Tr=()=>He().optional(),Or=()=>Qe().optional(),Rr=()=>Xe().optional(),Ir={string:t=>$.create({...t,coerce:!0}),number:t=>B.create({...t,coerce:!0}),boolean:t=>Y.create({...t,coerce:!0}),bigint:t=>G.create({...t,coerce:!0}),date:t=>W.create({...t,coerce:!0})},Cr=v,ye=Object.freeze({__proto__:null,defaultErrorMap:oe,setErrorMap:Nt,getErrorMap:we,makeIssue:ke,EMPTY_PATH:Tt,addIssueToContext:l,ParseStatus:w,INVALID:v,DIRTY:ie,OK:k,isAborted:Ve,isDirty:je,isValid:z,isAsync:me,get util(){return y},get objectUtil(){return De},ZodParsedType:f,getParsedType:j,ZodType:g,datetimeRegex:Ke,ZodString:$,ZodNumber:B,ZodBigInt:G,ZodBoolean:Y,ZodDate:W,ZodSymbol:ce,ZodUndefined:K,ZodNull:q,ZodAny:M,ZodUnknown:P,ZodNever:I,ZodVoid:de,ZodArray:L,ZodObject:A,ZodUnion:J,ZodDiscriminatedUnion:Ae,ZodIntersection:H,ZodTuple:C,ZodRecord:Ne,ZodMap:ue,ZodSet:le,ZodFunction:Te,ZodLazy:Q,ZodLiteral:X,ZodEnum:ee,ZodNativeEnum:te,ZodPromise:U,ZodEffects:T,ZodTransformer:T,ZodOptional:O,ZodNullable:S,ZodDefault:re,ZodCatch:se,ZodNaN:fe,BRAND:qt,ZodBranded:ve,ZodPipeline:_e,ZodReadonly:ne,custom:Je,Schema:g,ZodSchema:g,late:Jt,get ZodFirstPartyTypeKind(){return m},coerce:Ir,any:nr,array:cr,bigint:Xt,boolean:Xe,date:er,discriminatedUnion:lr,effect:ze,enum:xr,function:_r,instanceof:Ht,intersection:fr,lazy:gr,literal:yr,map:mr,nan:Qt,nativeEnum:br,never:ir,null:sr,nullable:Er,number:Qe,object:ge,oboolean:Rr,onumber:Or,optional:kr,ostring:Tr,pipeline:Nr,preprocess:Ar,promise:wr,record:pr,set:vr,strictObject:dr,string:He,symbol:tr,transformer:ze,tuple:hr,undefined:rr,union:ur,unknown:ar,void:or,NEVER:Cr,ZodIssueCode:c,quotelessJson:At,ZodError:N});function et(t){let e=t.runtimeEnvStrict??t.runtimeEnv??process.env;if(t.emptyStringAsUndefined??!1)for(let[b,D]of Object.entries(e))D===""&&delete e[b];if(!!t.skipValidation)return e;let n=typeof t.client=="object"?t.client:{},a=typeof t.server=="object"?t.server:{},i=typeof t.shared=="object"?t.shared:{},o=ge(n),d=ge(a),u=ge(i),p=t.isServer??(typeof window>"u"||"Deno"in window),E=o.merge(u),xe=d.merge(u).merge(o),F=p?xe.safeParse(e):E.safeParse(e),lt=t.onValidationError??(b=>{throw console.error("\u274C Invalid environment variables:",b.flatten().fieldErrors),new Error("Invalid environment variables")}),ft=t.onInvalidAccess??(b=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(F.success===!1)return lt(F.error);let ht=b=>t.clientPrefix?!b.startsWith(t.clientPrefix)&&!(b in u.shape):!0,pt=b=>p||!ht(b),mt=b=>b==="__esModule"||b==="$$typeof",vt=(t.extends??[]).reduce((b,D)=>Object.assign(b,D),{}),_t=Object.assign(F.data,vt);return new Proxy(_t,{get(b,D){if(typeof D=="string"&&!mt(D))return pt(D)?Reflect.get(b,D):ft(D)}})}var Oe=(i=>(i.PROD_CN="prod-cn",i.PROD="prod",i.STAGING="staging",i.STAGING_CN="staging-cn",i.DEV="dev",i.LOCAL="local",i))(Oe||{}),tt=({fallback:t="prod"})=>{let e=process.env.ENV;if(!e)return t;let r=e.toLowerCase().trim();return Object.values(Oe).includes(r)?r:t},rt=t=>t==="prod-cn"||t==="staging-cn";var Sr=t=>{switch(t){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"}}},st=({fallback:t="prod"})=>et({server:{FLAVOR:ye.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(t),CONNECT_API_BASE_URL:ye.string().url(),CANVA_ENV_URL:ye.string().url(),CANVA_CLI_CLIENT_ID:ye.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD")},runtimeEnv:Sr(tt({fallback:t})),emptyStringAsUndefined:!0});var Re=class{constructor(e,r,s=!1){this.envService=e;this.env=r;this.debug=s}generatePreviewResult=async e=>{let r=e;if(!r){let n=await this.getAppId();if(!n.success)return n;r=n.data}return{success:!0,data:this.constructPreviewUrl(r)}};async getAppId(){try{let e=await this.envService.getAppIdFromEnvFile();if(!e.success)return e;let r=e.data;if(r==="YOUR_APP_ID_HERE"){let s="CANVA_APP_ID is set to the default placeholder value. Please update it in the .env file.";return this.debug&&console.error(s),{success:!1,code:"MISSING_FIELD",message:s}}return{success:!0,data:r}}catch(e){let r=`Unknown Error reading CANVA_APP_ID from .env file: ${e instanceof Error?e.message:String(e)}`;return this.debug&&console.error(r),{success:!1,code:"ENV_READ_ERROR",message:r}}}constructPreviewUrl(e){let r=this.encodeUiState({appId:e}),s=this.env.CANVA_ENV_URL,n=new URL("/login/",s),a=new URL("/design",s);return a.searchParams.append("create",""),a.searchParams.append("width","800"),a.searchParams.append("height","600"),a.searchParams.append("units","px"),a.searchParams.append("ui",r),n.searchParams.append("redirect",a.pathname+a.search),n.toString()}encodeUiState(e){let r={E:{"A?":"N",S:e.appId,g:!0}},s=JSON.stringify(r);return btoa(s).replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")}};var dt=Et(ct(),1);import qr from"fs/promises";import Jr from"path";var Ce=class{constructor(e,r=qr,s=Jr,n=!1){this.env=e;this.fileSystem=r;this.pathModule=s;this.debug=n}get isChina(){return rt(this.env.FLAVOR)}async getAppIdFromEnvFile(){try{let e=this.pathModule.resolve(process.cwd(),".env");try{await this.fileSystem.access(e)}catch{let a="No .env file found, ensure you are in your intended app's directory.";return this.debug&&console.error(a),{success:!1,code:"FILE_NOT_FOUND",message:a}}let r=await this.fileSystem.readFile(e,"utf-8"),n=dt.parse(r).CANVA_APP_ID;if(!n){let a="CANVA_APP_ID not found in .env file";return this.debug&&console.error(a),{success:!1,code:"MISSING_FIELD",message:a}}return{success:!0,data:n}}catch(e){let r=`Unknown Error reading CANVA_APP_ID from .env file: ${e instanceof Error?e.message:String(e)}`;return this.debug&&console.error(r),{success:!1,code:"ENV_READ_ERROR",message:r}}}};var ut=st({fallback:"prod"}),Hr=new Ce(ut),Qr=new Re(Hr,ut),Ns=()=>Qr.generatePreviewResult();export{Ns as generatePreviewUrl};
|