diff --git a/bin/setup_hashlink.js b/bin/setup_hashlink.js index 25610d0..db0f417 100755 --- a/bin/setup_hashlink.js +++ b/bin/setup_hashlink.js @@ -62,4 +62,4 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Y.g `);for(let s of r){let i=s.split("=");if(i.length===2&&(i[0].trim()==="VERSION_ID"||i[0].trim()==="DISTRIB_RELEASE")){e=i[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}he._getOsVersion=vL;function GL(){let A="/etc/lsb-release",e="/etc/os-release",t="";return Ea.existsSync(A)?t=Ea.readFileSync(A).toString():Ea.existsSync(e)&&(t=Ea.readFileSync(e).toString()),t}he._readLinuxVersionFile=GL});var Sd=y((dT,kd)=>{var HL=require("crypto");kd.exports=function(){return HL.randomBytes(16)}});var Ud=y((pT,Fd)=>{var bd=[];for(Ki=0;Ki<256;++Ki)bd[Ki]=(Ki+256).toString(16).substr(1);var Ki;function VL(A,e){var t=e||0,r=bd;return[r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]]].join("")}Fd.exports=VL});var xd=y((wT,Ld)=>{var qL=Sd(),OL=Ud();function WL(A,e,t){var r=e&&t||0;typeof A=="string"&&(e=A==="binary"?new Array(16):null,A=null),A=A||{};var s=A.random||(A.rng||qL)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e)for(var i=0;i<16;++i)e[r+i]=s[i];return e||OL(s)}Ld.exports=WL});var Yd=y(Ye=>{"use strict";var PL=Ye&&Ye.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),XL=Ye&&Ye.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),$s=Ye&&Ye.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&PL(e,A,t);return XL(e,A),e},Md=Ye&&Ye.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(l){try{h(r.next(l))}catch(Q){o(Q)}}function g(l){try{h(r.throw(l))}catch(Q){o(Q)}}function h(l){l.done?i(l.value):s(l.value).then(c,g)}h((r=r.apply(A,e||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.argStringToArray=Ye.ToolRunner=void 0;var la=$s(require("os")),Td=$s(require("events")),jL=$s(require("child_process")),ZL=$s(require("path")),KL=$s(jE()),_d=$s(PE()),zL=require("timers"),ha=process.platform==="win32",nl=class extends Td.EventEmitter{constructor(e,t,r){if(super(),!e)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let r=this._getSpawnFileName(),s=this._getSpawnArgs(e),i=t?"":"[command]";if(ha)if(this._isCmdFile()){i+=r;for(let o of s)i+=` ${o}`}else if(e.windowsVerbatimArguments){i+=`"${r}"`;for(let o of s)i+=` ${o}`}else{i+=this._windowsQuoteCmdArg(r);for(let o of s)i+=` ${this._windowsQuoteCmdArg(o)}`}else{i+=r;for(let o of s)i+=` ${o}`}return i}_processLineBuffer(e,t,r){try{let s=t+e.toString(),i=s.indexOf(la.EOL);for(;i>-1;){let o=s.substring(0,i);r(o),s=s.substring(i+la.EOL.length),i=s.indexOf(la.EOL)}return s}catch(s){return this._debug(`error processing line. Failed with error ${s}`),""}}_getSpawnFileName(){return ha&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(e){if(ha&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let r of this.args)t+=" ",t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r);return t+='"',[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return'""';let t=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],r=!1;for(let o of e)if(t.some(c=>c===o)){r=!0;break}if(!r)return e;let s='"',i=!0;for(let o=e.length;o>0;o--)s+=e[o-1],i&&e[o-1]==="\\"?s+="\\":e[o-1]==='"'?(i=!0,s+='"'):i=!1;return s+='"',s.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e)return'""';if(!e.includes(" ")&&!e.includes(" ")&&!e.includes('"'))return e;if(!e.includes('"')&&!e.includes("\\"))return`"${e}"`;let t='"',r=!0;for(let s=e.length;s>0;s--)t+=e[s-1],r&&e[s-1]==="\\"?t+="\\":e[s-1]==='"'?(r=!0,t+="\\"):r=!1;return t+='"',t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e=e||{};let r={};return r.cwd=e.cwd,r.env=e.env,r.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(r.argv0=`"${t}"`),r}exec(){return Md(this,void 0,void 0,function*(){return!_d.isRooted(this.toolPath)&&(this.toolPath.includes("/")||ha&&this.toolPath.includes("\\"))&&(this.toolPath=ZL.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield KL.which(this.toolPath,!0),new Promise((e,t)=>Md(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(let h of this.args)this._debug(` ${h}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+la.EOL);let s=new ol(r,this.toolPath);if(s.on("debug",h=>{this._debug(h)}),this.options.cwd&&!(yield _d.exists(this.options.cwd)))return t(new Error(`The cwd: ${this.options.cwd} does not exist!`));let i=this._getSpawnFileName(),o=jL.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i)),c="";o.stdout&&o.stdout.on("data",h=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(h),!r.silent&&r.outStream&&r.outStream.write(h),c=this._processLineBuffer(h,c,l=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(l)})});let g="";if(o.stderr&&o.stderr.on("data",h=>{s.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(h),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(h),g=this._processLineBuffer(h,g,l=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(l)})}),o.on("error",h=>{s.processError=h.message,s.processExited=!0,s.processClosed=!0,s.CheckComplete()}),o.on("exit",h=>{s.processExitCode=h,s.processExited=!0,this._debug(`Exit code ${h} received from tool '${this.toolPath}'`),s.CheckComplete()}),o.on("close",h=>{s.processExitCode=h,s.processExited=!0,s.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),s.CheckComplete()}),s.on("done",(h,l)=>{c.length>0&&this.emit("stdline",c),g.length>0&&this.emit("errline",g),o.removeAllListeners(),h?t(h):e(l)}),this.options.input){if(!o.stdin)throw new Error("child process missing stdin");o.stdin.end(this.options.input)}}))})}};Ye.ToolRunner=nl;function $L(A){let e=[],t=!1,r=!1,s="";function i(o){r&&o!=='"'&&(s+="\\"),s+=o,r=!1}for(let o=0;o0&&(e.push(s),s="");continue}i(c)}return s.length>0&&e.push(s.trim()),e}Ye.argStringToArray=$L;var ol=class A extends Td.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw new Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=zL.setTimeout(A.HandleTimeout,this.delay,this)))}_debug(e){this.emit("debug",e)}_setResult(){let e;this.processExited&&(this.processError?e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}}});var Vd=y(Je=>{"use strict";var Ax=Je&&Je.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),ex=Je&&Je.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),tx=Je&&Je.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&Ax(e,A,t);return ex(e,A),e},Gd=Je&&Je.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(l){try{h(r.next(l))}catch(Q){o(Q)}}function g(l){try{h(r.throw(l))}catch(Q){o(Q)}}function h(l){l.done?i(l.value):s(l.value).then(c,g)}h((r=r.apply(A,e||[])).next())})};Object.defineProperty(Je,"__esModule",{value:!0});Je.getExecOutput=Je.exec=void 0;var Jd=require("string_decoder"),vd=tx(Yd());function Hd(A,e,t){return Gd(this,void 0,void 0,function*(){let r=vd.argStringToArray(A);if(r.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");let s=r[0];return e=r.slice(1).concat(e||[]),new vd.ToolRunner(s,e,t).exec()})}Je.exec=Hd;function rx(A,e,t){var r,s;return Gd(this,void 0,void 0,function*(){let i="",o="",c=new Jd.StringDecoder("utf8"),g=new Jd.StringDecoder("utf8"),h=(r=t?.listeners)===null||r===void 0?void 0:r.stdout,l=(s=t?.listeners)===null||s===void 0?void 0:s.stderr,Q=S=>{o+=g.write(S),l&&l(S)},C=S=>{i+=c.write(S),h&&h(S)},f=Object.assign(Object.assign({},t?.listeners),{stdout:C,stderr:Q}),B=yield Hd(A,e,Object.assign(Object.assign({},t),{listeners:f}));return i+=c.end(),o+=g.end(),{exitCode:B,stdout:i,stderr:o}})}Je.getExecOutput=rx});var Wd=y(lt=>{"use strict";var sx=lt&<.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),ix=lt&<.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),nx=lt&<.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&sx(e,A,t);return ix(e,A),e},qd=lt&<.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(l){try{h(r.next(l))}catch(Q){o(Q)}}function g(l){try{h(r.throw(l))}catch(Q){o(Q)}}function h(l){l.done?i(l.value):s(l.value).then(c,g)}h((r=r.apply(A,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.RetryHelper=void 0;var Od=nx(js()),al=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return qd(this,void 0,void 0,function*(){let r=1;for(;rsetTimeout(t,e*1e3))})}};lt.RetryHelper=al});var Ap=y(sA=>{"use strict";var ox=sA&&sA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),ax=sA&&sA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Ht=sA&&sA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&ox(e,A,t);return ax(e,A),e},me=sA&&sA.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(l){try{h(r.next(l))}catch(Q){o(Q)}}function g(l){try{h(r.throw(l))}catch(Q){o(Q)}}function h(l){l.done?i(l.value):s(l.value).then(c,g)}h((r=r.apply(A,e||[])).next())})},cx=sA&&sA.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(sA,"__esModule",{value:!0});sA.evaluateVersions=sA.isExplicitVersion=sA.findFromManifest=sA.getManifestFromRepo=sA.findAllVersions=sA.find=sA.cacheFile=sA.cacheDir=sA.extractZip=sA.extractXar=sA.extractTar=sA.extract7z=sA.downloadTool=sA.HTTPError=void 0;var EA=Ht(js()),Ke=Ht(jE()),ht=Ht(require("fs")),gx=Ht(Nd()),$i=Ht(require("os")),mt=Ht(require("path")),Pd=Ht(xE()),or=Ht(rl()),Ex=Ht(require("stream")),lx=Ht(require("util")),Ai=require("assert"),Xd=cx(xd()),Rr=Vd(),hx=Wd(),zi=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};sA.HTTPError=zi;var gl=process.platform==="win32",Qx=process.platform==="darwin",ux="actions/tool-cache";function Cx(A,e,t,r){return me(this,void 0,void 0,function*(){e=e||mt.join($d(),Xd.default()),yield Ke.mkdirP(mt.dirname(e)),EA.debug(`Downloading ${A}`),EA.debug(`Destination ${e}`);let s=3,i=cl("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),o=cl("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new hx.RetryHelper(s,i,o).execute(()=>me(this,void 0,void 0,function*(){return yield Ix(A,e||"",t,r)}),g=>!(g instanceof zi&&g.httpStatusCode&&g.httpStatusCode<500&&g.httpStatusCode!==408&&g.httpStatusCode!==429))})}sA.downloadTool=Cx;function Ix(A,e,t,r){return me(this,void 0,void 0,function*(){if(ht.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let s=new Pd.HttpClient(ux,[],{allowRetries:!1});t&&(EA.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let i=yield s.get(A,r);if(i.message.statusCode!==200){let l=new zi(i.message.statusCode);throw EA.debug(`Failed to download from "${A}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`),l}let o=lx.promisify(Ex.pipeline),g=cl("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>i.message)(),h=!1;try{return yield o(g,ht.createWriteStream(e)),EA.debug("download complete"),h=!0,e}finally{if(!h){EA.debug("download failed");try{yield Ke.rmRF(e)}catch(l){EA.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function Bx(A,e,t){return me(this,void 0,void 0,function*(){Ai.ok(gl,"extract7z() not supported on current OS"),Ai.ok(A,'parameter "file" is required'),e=yield Qa(e);let r=process.cwd();if(process.chdir(e),t)try{let i=["x",EA.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",A],o={silent:!0};yield Rr.exec(`"${t}"`,i,o)}finally{process.chdir(r)}else{let s=mt.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),i=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),g=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${s}' -Source '${i}' -Target '${o}'`],h={silent:!0};try{let l=yield Ke.which("powershell",!0);yield Rr.exec(`"${l}"`,g,h)}finally{process.chdir(r)}}return e})}sA.extract7z=Bx;function fx(A,e,t="xz"){return me(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");e=yield Qa(e),EA.debug("Checking tar --version");let r="";yield Rr.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:g=>r+=g.toString(),stderr:g=>r+=g.toString()}}),EA.debug(r.trim());let s=r.toUpperCase().includes("GNU TAR"),i;t instanceof Array?i=t:i=[t],EA.isDebug()&&!t.includes("v")&&i.push("-v");let o=e,c=A;return gl&&s&&(i.push("--force-local"),o=e.replace(/\\/g,"/"),c=A.replace(/\\/g,"/")),s&&(i.push("--warning=no-unknown-keyword"),i.push("--overwrite")),i.push("-C",o,"-f",c),yield Rr.exec("tar",i),e})}sA.extractTar=fx;function dx(A,e,t=[]){return me(this,void 0,void 0,function*(){Ai.ok(Qx,"extractXar() not supported on current OS"),Ai.ok(A,'parameter "file" is required'),e=yield Qa(e);let r;t instanceof Array?r=t:r=[t],r.push("-x","-C",e,"-f",A),EA.isDebug()&&r.push("-v");let s=yield Ke.which("xar",!0);return yield Rr.exec(`"${s}"`,Sx(r)),e})}sA.extractXar=dx;function px(A,e){return me(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");return e=yield Qa(e),gl?yield wx(A,e):yield yx(A,e),e})}sA.extractZip=px;function wx(A,e){return me(this,void 0,void 0,function*(){let t=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=yield Ke.which("pwsh",!1);if(s){let o=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ")];EA.debug(`Using pwsh at path: ${s}`),yield Rr.exec(`"${s}"`,o)}else{let o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`].join(" ")],c=yield Ke.which("powershell",!0);EA.debug(`Using powershell at path: ${c}`),yield Rr.exec(`"${c}"`,o)}})}function yx(A,e){return me(this,void 0,void 0,function*(){let t=yield Ke.which("unzip",!0),r=[A];EA.isDebug()||r.unshift("-q"),r.unshift("-o"),yield Rr.exec(`"${t}"`,r,{cwd:e})})}function mx(A,e,t,r){return me(this,void 0,void 0,function*(){if(t=or.clean(t)||t,r=r||$i.arch(),EA.debug(`Caching tool ${e} ${t} ${r}`),EA.debug(`source dir: ${A}`),!ht.statSync(A).isDirectory())throw new Error("sourceDir is not a directory");let s=yield Zd(e,t,r);for(let i of ht.readdirSync(A)){let o=mt.join(A,i);yield Ke.cp(o,s,{recursive:!0})}return Kd(e,t,r),s})}sA.cacheDir=mx;function Dx(A,e,t,r,s){return me(this,void 0,void 0,function*(){if(r=or.clean(r)||r,s=s||$i.arch(),EA.debug(`Caching tool ${t} ${r} ${s}`),EA.debug(`source file: ${A}`),!ht.statSync(A).isFile())throw new Error("sourceFile is not a file");let i=yield Zd(t,r,s),o=mt.join(i,e);return EA.debug(`destination file ${o}`),yield Ke.cp(A,o),Kd(t,r,s),i})}sA.cacheFile=Dx;function Rx(A,e,t){if(!A)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(t=t||$i.arch(),!El(e)){let s=jd(A,t);e=zd(s,e)}let r="";if(e){e=or.clean(e)||"";let s=mt.join(ua(),A,e,t);EA.debug(`checking cache: ${s}`),ht.existsSync(s)&&ht.existsSync(`${s}.complete`)?(EA.debug(`Found tool in cache ${A} ${e} ${t}`),r=s):EA.debug("not found")}return r}sA.find=Rx;function jd(A,e){let t=[];e=e||$i.arch();let r=mt.join(ua(),A);if(ht.existsSync(r)){let s=ht.readdirSync(r);for(let i of s)if(El(i)){let o=mt.join(r,i,e||"");ht.existsSync(o)&&ht.existsSync(`${o}.complete`)&&t.push(i)}}return t}sA.findAllVersions=jd;function Nx(A,e,t,r="master"){return me(this,void 0,void 0,function*(){let s=[],i=`https://api.github.com/repos/${A}/${e}/git/trees/${r}`,o=new Pd.HttpClient("tool-cache"),c={};t&&(EA.debug("set auth"),c.authorization=t);let g=yield o.getJson(i,c);if(!g.result)return s;let h="";for(let Q of g.result.tree)if(Q.path==="versions-manifest.json"){h=Q.url;break}c.accept="application/vnd.github.VERSION.raw";let l=yield(yield o.get(h,c)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{s=JSON.parse(l)}catch{EA.debug("Invalid json")}}return s})}sA.getManifestFromRepo=Nx;function kx(A,e,t,r=$i.arch()){return me(this,void 0,void 0,function*(){return yield gx._findMatch(A,e,t,r)})}sA.findFromManifest=kx;function Qa(A){return me(this,void 0,void 0,function*(){return A||(A=mt.join($d(),Xd.default())),yield Ke.mkdirP(A),A})}function Zd(A,e,t){return me(this,void 0,void 0,function*(){let r=mt.join(ua(),A,or.clean(e)||e,t||"");EA.debug(`destination ${r}`);let s=`${r}.complete`;return yield Ke.rmRF(r),yield Ke.rmRF(s),yield Ke.mkdirP(r),r})}function Kd(A,e,t){let s=`${mt.join(ua(),A,or.clean(e)||e,t||"")}.complete`;ht.writeFileSync(s,""),EA.debug("finished caching tool")}function El(A){let e=or.clean(A)||"";EA.debug(`isExplicit: ${e}`);let t=or.valid(e)!=null;return EA.debug(`explicit? ${t}`),t}sA.isExplicitVersion=El;function zd(A,e){let t="";EA.debug(`evaluating ${A.length} versions`),A=A.sort((r,s)=>or.gt(r,s)?1:-1);for(let r=A.length-1;r>=0;r--){let s=A[r];if(or.satisfies(s,e)){t=s;break}}return t?EA.debug(`matched: ${t}`):EA.debug("match not found"),t}sA.evaluateVersions=zd;function ua(){let A=process.env.RUNNER_TOOL_CACHE||"";return Ai.ok(A,"Expected RUNNER_TOOL_CACHE to be defined"),A}function $d(){let A=process.env.RUNNER_TEMP||"";return Ai.ok(A,"Expected RUNNER_TEMP to be defined"),A}function cl(A,e){let t=global[A];return t!==void 0?t:e}function Sx(A){return Array.from(new Set(A))}});(function(A){"use strict";var e=function(){return TA.__string_rec(this,"")},t=t||{},r;class s{constructor(n,a){this.r=new RegExp(n,a.split("u").join(""))}match(n){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(n),this.r.s=n,this.r.m!=null}matched(n){if(this.r.m!=null&&n>=0&&n8&&E<14?!0:E==32}static ltrim(n){let a=n.length,E=0;for(;E0?i.substr(n,E,a-E):n}static rtrim(n){let a=n.length,E=0;for(;E0?i.substr(n,0,a-E):n}static trim(n){return l.ltrim(l.rtrim(n))}static replace(n,a,E){return n.split(a).join(E)}static hex(n,a){let E="";do E="0123456789ABCDEF".charAt(n&15)+E,n>>>=4;while(n>0);if(a!=null)for(;E.lengththis.length)throw B.thrown(xA.OutsideBounds);E==null&&(E=M.UTF8);let u="",I=this.b,p=n,m=n+a;switch(E._hx_index){case 0:for(;p>8}return new F(I.buffer)}let E=[],u=0;for(;u>6),E.push(128|I&63)):I<=65535?(E.push(224|I>>12),E.push(128|I>>6&63),E.push(128|I&63)):(E.push(240|I>>18),E.push(128|I>>12&63),E.push(128|I>>6&63),E.push(128|I&63))}return new F(new Uint8Array(E).buffer)}}F.__name__=!0;var M=t["haxe.io.Encoding"]={__ename__:!0,__constructs__:null,UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:e},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:e}};M.__constructs__=[M.UTF8,M.RawNative];class G{static decode(n,a){if(a==null&&(a=!0),a)for(;i.cca(n,n.length-1)==61;)n=i.substr(n,0,-1);return new AA(G.BYTES).decodeBytes(F.ofString(n))}}G.__name__=!0;class AA{constructor(n){let a=n.length,E=1;for(;a>1<8||a!=1<>3,I=new F(new ArrayBuffer(u)),p=0,m=0,R=0,L=0;for(;L>m&255}return I}}AA.__name__=!0;class ZA{constructor(){this.h={}}}ZA.__name__=!0;class HA{constructor(){this.h={__keys__:{}}}}HA.__name__=!0;var w=t["haxe.ds.Option"]={__ename__:!0,__constructs__:null,Some:(r=function(k){return{_hx_index:0,v:k,__enum__:"haxe.ds.Option",toString:e}},r._hx_name="Some",r.__params__=["v"],r),None:{_hx_name:"None",_hx_index:1,__enum__:"haxe.ds.Option",toString:e}};w.__constructs__=[w.Some,w.None];var xA=t["haxe.io.Error"]={__ename__:!0,__constructs__:null,Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:e},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:e},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:e},Custom:(r=function(k){return{_hx_index:3,e:k,__enum__:"haxe.io.Error",toString:e}},r._hx_name="Custom",r.__params__=["e"],r)};xA.__constructs__=[xA.Blocked,xA.Overflow,xA.OutsideBounds,xA.Custom];class VA{static join(n){let a=[],E=0;for(;E0&&E[E.length-1]!=".."?E.pop():j==""?(E.length>0||i.cca(n,0)==47)&&E.push(j):j!="."&&E.push(j)}let p="",m=!1,R=!1,L=0,J=E.join(a);for(;L=55296&&K<=56319&&(K=K-55232<<10|j.charCodeAt(z+1)&1023);let aA=K;aA>=65536&&++L;let UA=aA;switch(UA){case 47:if(!m)R=!0;else{let sn=UA;m=!1,R&&(p+="/",R=!1),p+=String.fromCodePoint(sn)}break;case 58:p+=":",m=!0;break;default:let Rt=UA;m=!1,R&&(p+="/",R=!1),p+=String.fromCodePoint(Rt)}}return p}static addTrailingSlash(n){if(n.length==0)return"/";let a=n.lastIndexOf("/"),E=n.lastIndexOf("\\");return a=5)return"<...>";let E=typeof n;switch(E=="function"&&(n.__name__||n.__ename__)&&(E="object"),E){case"function":return"";case"object":if(n.__enum__){let L=t[n.__enum__].__constructs__[n._hx_index],J=L._hx_name;return L.__params__?(a=a+" ",J+"("+function(j){var z;let K=[];{let aA=0,UA=L.__params__;for(;aA0?",":"")+TA.__string_rec(n[j],a)}return R+="]",R}let u;try{u=n.toString}catch{return"???"}if(u!=null&&u!=Object.toString&&typeof u=="function"){let R=n.toString();if(R!="[object Object]")return R}let I=`{ `;a+=" ";let p=n.hasOwnProperty!=null,m=null;for(m in n)p&&!n.hasOwnProperty(m)||m=="prototype"||m=="__class__"||m=="__super__"||m=="__interfaces__"||m=="__properties__"||(I.length!=2&&(I+=`, `),I+=a+m+" : "+TA.__string_rec(n[m],a));return a=a.substring(1),I+=` -`+a+"}",I;case"string":return n;default:return String(n)}}}TA.__name__=!0;var eA=js(),pA=Ap(),te=require("child_process"),Qt=require("fs");function Qe(){process.title="Setup HashLink VM";let k=eA.getInput("version"),n=$A.parse(k.length==0||k=="latest"?"*":k);switch(n._hx_index){case 0:let a=KA.find(n.data);switch(a._hx_index){case 0:let E=a.v;new ll(E).install().handle(function(u){switch(u._hx_index){case 0:eA.info("HashLink "+E.version+' successfully installed in "'+u.data+'".');break;case 1:eA.setFailed(u.failure.message);break}});break;case 1:eA.setFailed("No release matching the version constraint.");break}break;case 1:eA.setFailed("Invalid version constraint.");break}}class De{static resolve(n,a){if(a.scheme!=null)return a;if(a.hosts[0]!=null){if(a.scheme!=null)return a;{let E=g.copy(a);return E.scheme=n.scheme,E}}else{let E={path:ze.join(n.path,a.path),payload:"",scheme:n.scheme,query:a.query,auth:n.auth,hosts:n.hosts,hash:a.hash};return De.makePayload(E),E}}static makePayload(n){let a="",E=n.auth,u=n.hosts;E==null?u.length!=0&&(a="//"+u.join(",")):u.length==0?a="//"+(E==null?"null":E==null?"":""+E+"@"):a="//"+(E==null?"null":E==null?"":""+E+"@")+u.join(","),a+=n.path==null?"null":n.path;let I=n.query;I!=null&&(a+="?"+(I??"null"));let p=n.hash;p!=null&&(a+="#"+p),n.payload=a.toString()}static toString(n){return n.scheme==null?n.payload:""+n.scheme+":"+n.payload}static fromString(n){return De.parse(n)}static noop(n){}static parse(n,a){for(;;){if(n==null){n="",a=null;continue}if(a==null&&(a=De.noop),n=l.trim(n),n.startsWith("data:"))return{scheme:"data",payload:i.substr(n,5,null),hosts:[]};let E=new s("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$",""),u=new s("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");E.match(n);let I,p=E.matched(7);if(p==null)I=[];else{let R=[],L=0,J=p.split(",");for(;L0&&m.charAt(0)!="/"&&(m="/"+m),{scheme:E.matched(2),payload:E.matched(3),hosts:I,auth:E.matched(6),path:ze.ofString(m),query:E.matched(10),hash:E.matched(12)}}}}class zr{static _new(n,a){let E;if(a==null)E=n;else{if(a>65535||a<=0)throw B.thrown("Invalid port");E=""+n+":"+a}return E}}class ze{static join(n,a){if(a=="")return n;if(a.charAt(0)=="/")return a;if(n.charAt(n.length-1)=="/")return ze.ofString(n+a);{let E=n.lastIndexOf("/");return E==-1?a:ze.ofString(i.substr(n,0,E+1)+(a??"null"))}}static ofString(n){return ze.normalize(n)}static normalize(n){if(n=l.trim(l.replace(n,"\\","/")),n==".")return"./";let a=n.endsWith("/..")||n.endsWith("/")||n.endsWith("/."),E=[],u=n.startsWith("/"),I=0,p=0,m=n.split("/");for(;p0;){let u=E.next();if(a==null||a(u))return w.Some(u)}return w.None}static _new(){return null}static fromArray(n){let a=null,E=0,u=n.length;for(;u-- >0;)a=new Dt(++E,n[u],a==null?Dt.EMPTY:[a]);return a}}class Dt{constructor(n,a,E){this.value=a,this.length=n,this.tails=E??Dt.EMPTY}}Dt.__name__=!0;class Vt{constructor(){this.afterParsing=[],this.plugins=new Re(this)}init(n){for(this.pos=0,this.max=n.length,this.source=n;this.source.charCodeAt(this.pos)<33;)this.pos++}parseString(){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let n;return this.source.charCodeAt(this.pos)==34?(this.pos+=1,n=!0):n=!1,n||this.die("Expected string"),this.parseRestOfString()}parseRestOfString(){return this.slice(this.skipString(),this.pos-1)}skipString(){let n=this.pos;for(;;){let a=this.source.indexOf(Vt.DBQT,this.pos);if(a==-1)this.die("unterminated string",n);else{this.pos=a+1;let E=this.pos-2;for(;this.source.charCodeAt(E)==92;)--E;if(!(E-this.pos&1))break}}return n}invalidNumber(n){return this.die("Invalid number "+this.source.substring(n,this.pos),n)}skipNumber(n){let a=this.pos-1,E=n==45,u=!E,I=n==48,p=!1,m=!1,R=!1,L=!1;for(;this.pos47?this.skipNumber(n):this.invalidChar(n)}}invalidChar(n){return this.die("invalid char "+l.hex(n,2),this.pos-1)}die(n,a,E){E==null&&(E=-1),a==null&&(a=-1),a==-1?(a=this.pos,E=a):E==-1&&(E=this.pos),E<=a&&(E=a+1);let u=function(p,m,R){return p.length>m?R?"... "+i.substr(p,p.length-m,null):i.substr(p,0,m)+" ...":p},I=a+E>>1;return zA.withData(422,n+(" at "+(E>a+1?"characters "+a+" - "+E:"character "+a)+" in "+(u(this.source.substring(0,a),20,!0)+" ----> "+u(this.source.substring(a,I),20,!1)+u(this.source.substring(I,E),20,!0)+" <---- "+u(this.source.substring(E,this.max),20,!1))),{source:this.source,start:a,end:E},{fileName:"tink/json/Parser.hx",lineNumber:472,className:"tink.json.BasicParser",methodName:"die"}).throwSelf()}}Vt.__name__=!0;class qA extends Vt{constructor(){super()}process0(){let n=this,a=0,E=null,u=null,I=this.pos;for(;;){let m=this.source.charCodeAt(this.pos++),R;if(m==123)break;R=m<33,R!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let p;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;p=!0}else p=!1;if(!p){A:for(;;){for(;;){let L=this.source.charCodeAt(this.pos++),J;if(L==34)break;J=L<33,J!=!0&&this.die('expected "')}switch(a=this.source.charCodeAt(this.pos++),a){case 97:if(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==116&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==34)))))){for(;;){let j=this.source.charCodeAt(this.pos++),z;if(j==58)break;z=j<33,z!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(L)E=null;else{for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let j;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;j=!0}else j=!1;j||this.die("Expected [");let z=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let K;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;K=!0}else K=!1;if(!K){for(;;){for(z.push(new An(this.process1()));this.source.charCodeAt(this.pos)<33;)this.pos++;let UA;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;UA=!0}else UA=!1;if(!UA)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let aA;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;aA=!0}else aA=!1;aA||this.die("Expected ]")}E=ut.fromArray(z)}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,J=!0):J=!1,J)continue;break A}break;case 118:if(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==114&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==111&&(a=this.source.charCodeAt(this.pos++),a==110&&(a=this.source.charCodeAt(this.pos++),a==34))))))){for(;;){let j=this.source.charCodeAt(this.pos++),z;if(j==58)break;z=j<33,z!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(L)u=null;else{let j=this.parseString();u=j.indexOf(tn.BACKSLASH)==-1?j:JSON.parse('"'+j+'"')}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,J=!0):J=!1,J)continue;break A}break}for(a!=34&&this.skipString();;){let L=this.source.charCodeAt(this.pos++),J;if(L==58)break;J=L<33,J!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,R=!0):R=!1,!R)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected }")}return{assets:E,version:u}}process1(){let n=this,a=0,E=null,u=!1,I=null,p=!1,m=this.pos;for(;;){let J=this.source.charCodeAt(this.pos++),j;if(J==123)break;j=J<33,j!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;if(!R){A:for(;;){for(;;){let z=this.source.charCodeAt(this.pos++),K;if(z==34)break;K=z<33,K!=!0&&this.die('expected "')}switch(a=this.source.charCodeAt(this.pos++),a){case 102:if(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==108&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==34)))){for(;;){let aA=this.source.charCodeAt(this.pos++),UA;if(aA==58)break;UA=aA<33,UA!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let z=this.parseString();for(E=z.indexOf(tn.BACKSLASH)==-1?z:JSON.parse('"'+z+'"'),u=!0;this.source.charCodeAt(this.pos)<33;)this.pos++;let K;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,K=!0):K=!1,K)continue;break A}break;case 111:if(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==34)){for(;;){let UA=this.source.charCodeAt(this.pos++),Rt;if(UA==58)break;Rt=UA<33,Rt!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let z=this.parseString(),K=z.indexOf(tn.BACKSLASH)==-1?z:JSON.parse('"'+z+'"');switch(K){case"Linux":case"Mac":case"Windows":I=K;break;default:throw B.thrown(new zA(422,"Unrecognized enum value: "+K+". Accepted values are: "+new fl().write(["Linux","Mac","Windows"]),{fileName:"tink/json/macros/GenReader.hx",lineNumber:454,className:"tink.json.Parser0",methodName:"process1"}))}for(p=!0;this.source.charCodeAt(this.pos)<33;)this.pos++;let aA;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,aA=!0):aA=!1,aA)continue;break A}break}for(a!=34&&this.skipString();;){let z=this.source.charCodeAt(this.pos++),K;if(z==58)break;K=z<33,K!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let j;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,j=!0):j=!1,!j)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;J=!0}else J=!1;J||this.die("Expected }")}let L=function(J){return n.die('missing field "'+J+'"',m)};return{file:u?E:L("file"),os:p?I:L("os")}}parse(n){for(this.afterParsing.length>0&&(this.afterParsing=[]),this.init(n);this.source.charCodeAt(this.pos)<33;)this.pos++;let a;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;a=!0}else a=!1;a||this.die("Expected [");let E=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let u;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;u=!0}else u=!1;if(!u){for(;;){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;for(E.push(new KA(R?null:this.process0()));this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(!L)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected ]")}let I=0,p=this.afterParsing;for(;I0&&(this.afterParsing=[]),E}}qA.__name__=!0;class Re{constructor(n){this.target=n,this.registry=new HA}}Re.__name__=!0;class KA{constructor(n){n==null&&(n={});let a=this,E=wA.cur;wA.cur=null;let u=new wA(ri.sync(function(){let K=a.getAsset(Q.systemName()),aA;switch(K._hx_index){case 0:aA=De.fromString("releases/download/"+At.get_value(a.__coco_tag)+"/"+K.v.file);break;case 1:aA=De.fromString("archive/refs/tags/"+At.get_value(a.__coco_tag)+".zip");break}return De.resolve(KA.baseUrl,aA)}),null,null);wA.cur=E,this.__coco_url=u;let I=wA.cur;wA.cur=null;let p=new wA(ri.sync(function(){let K=ei.sure(v.parse(a.version)),aA=""+K.major+"."+K.minor;return K.patch>0?""+aA+"."+K.patch:aA}),null,null);wA.cur=I,this.__coco_tag=p;let m=wA.cur;wA.cur=null;let R=new wA(ri.sync(function(){return a.getAsset(Q.systemName())==w.None}),null,null);wA.cur=m,this.__coco_isSource=R;let L=wA.cur;wA.cur=null;let J=new wA(ri.sync(function(){let K=!1,aA=new da(KA.data);for(;aA.list.length>0;)if(aA.next().version==a.version){K=!0;break}return K}),null,null);wA.cur=L,this.__coco_exists=J;let j=n.assets;this.assets=j??ut._new();let z=n.version;this.version=z??"0.0.0",this.__coco_transitionCount=yl._new(0),this.errorTrigger=Cl.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new C(this),this.observables={assets:new ti(this.assets,null),exists:this.__coco_exists,isSource:this.__coco_isSource,tag:this.__coco_tag,url:this.__coco_url,version:new ti(this.version,null),isInTransition:At.map(this.__coco_transitionCount,wl.plain(function(K){return K>0}))}}getAsset(n){return ut.first(this.assets,function(a){return a.os==n})}static find(n){return ut.first(KA.data,function(a){return $A.matches(n,ei.sure(v.parse(a.version)))})}}KA.__name__=!0;class An{constructor(n){this.file=n.file,this.os=n.os,this.__coco_transitionCount=yl._new(0),this.errorTrigger=Cl.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new C(this),this.observables={file:new ti(this.file,null),os:new ti(this.os,null),isInTransition:At.map(this.__coco_transitionCount,wl.plain(function(a){return a>0}))}}}An.__name__=!0;class ll{constructor(n){this.release=n}download(){let n=this;return $r.next($r.next(Ot.ofJsPromise(pA.downloadTool(De.toString(At.get_value(this.release.__coco_url)))),function(a){return Ot.ofJsPromise(pA.extractZip(a))}),function(a){return ei.next(n.findSubfolder(a),function(E){return new Ct(new $e(DA.Success(n.normalizeSeparator(VA.join([a,E])))))})})}install(){let n=pA.find("hashlink",this.release.version),a=this,E=n.length>0?new Ct(new $e(DA.Success(n))):$r.next(this.download(),function(I){return Ot.ofJsPromise(pA.cacheDir(I,"hashlink",a.release.version))}),u=At.get_value(this.release.__coco_isSource)&&process.env.GITHUB_ACTIONS=="true";return $r.next($r.next(E,function(I){return u?a.compile(I):new Ct(new $e(DA.Success(I)))}),function(I){let p=a.normalizeSeparator(I);return eA.addPath(At.get_value(a.release.__coco_isSource)?a.normalizeSeparator(VA.join([I,"bin"])):p),new Ct(new $e(DA.Success(p)))})}compile(n){let a=Q.systemName();if(!["Linux","Mac"].includes(a))return new Ct(new $e(DA.Failure(new zA(501,"Compilation is not supported on "+a+" platform.",{fileName:"src/setup_hashlink/Setup.hx",lineNumber:53,className:"setup_hashlink.Setup",methodName:"compile"}))));let E=VA.addTrailingSlash(process.cwd());return process.chdir(n),$r.next(a=="Linux"?this.compileLinux():this.compileMacOs(),function(u){return process.chdir(E),new Ct(new $e(DA.Success(u)))})}compileLinux(){c.iter(["sudo apt-get update","sudo apt-get install --assume-yes --no-install-recommends "+["libmbedtls-dev","libopenal-dev","libpng-dev","libsdl2-dev","libturbojpeg0-dev","libuv1-dev","libvorbis-dev"].join(" "),"make","sudo make install","sudo ldconfig"],function(E){te.spawnSync(E,{shell:!0,stdio:"inherit"})});let n=process.env.LD_LIBRARY_PATH,a=l.trim(n??"");return eA.exportVariable("LD_LIBRARY_PATH",a.length>0?"/usr/local/bin:"+a:"/usr/local/bin"),new Ct(new $e(DA.Success("/usr/local")))}compileMacOs(){return c.iter(["brew bundle","make","sudo make install"],function(n){te.spawnSync(n,{shell:!0,stdio:"inherit"})}),new Ct(new $e(DA.Success("/usr/local")))}findSubfolder(n){let a=Qt.readdirSync(n),E=[],u=0;for(;u>1&&n.compact()}}}Ia.__name__=!0;class ar{constructor(n){ar._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.disposeHandlers=[],this.f=n}dispose(){let n=this.disposeHandlers;if(n!=null){this.disposeHandlers=null;let a=this.f;this.f=ar.noop,a();let E=0;for(;E0){this.used=0;let E=this.ondrain;BA.depth<500?(BA.depth++,E(),BA.depth--):BA.defer(E)}}invoke(n){let a=this;if(BA.depth<500){if(BA.depth++,a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,u=n,I=function(){E.invoke(u)};a.queue.push(I)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,u=0;for(;u0&&a.queue.shift()())}BA.depth--}else BA.defer(function(){if(a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,u=n,I=function(){E.invoke(u)};a.queue.push(I)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,u=0;for(;u0&&a.queue.shift()())}})}compact(){if(!this.busy)if(this.used==0){this.resize(0);let n=this.ondrain;BA.depth<500?(BA.depth++,n(),BA.depth--):BA.defer(n)}else{let n=0,a=0,E=this.cells.length;for(;a256&&(n=new o(n.min,256));let E=n;for(;E.minn.length?0:a+n.length:a>n.length?n.length:a}static wrap(n,a){return a<0?a+n.length:a}static ofString(n){if(n==null||n=="")return lA.EMPTY;if(n.length==1){let a=n.charCodeAt(0);return an.length)return!1;let u=a;return lA.isEqual(n.string,n.start+E,a.length,u.string,u.start,u.length)}static isEqual(n,a,E,u,I,p){if(p!=E)return!1;let m=0;for(;m0}next(){let n=this.list.pop();if(n==null)return null;{let a=-n.tails.length;for(;a<0;)this.list.push(n.tails[-a++-1]);return n.value}}}da.__name__=!0;var YA=t["tink.semver.Bound"]={__ename__:!0,__constructs__:null,Unbounded:{_hx_name:"Unbounded",_hx_index:0,__enum__:"tink.semver.Bound",toString:e},Exlusive:(r=function(k){return{_hx_index:1,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Exlusive",r.__params__=["limit"],r),Inclusive:(r=function(k){return{_hx_index:2,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Inclusive",r.__params__=["limit"],r)};YA.__constructs__=[YA.Unbounded,YA.Exlusive,YA.Inclusive];class H{static isLowerThan(n,a){switch(n._hx_index){case 1:let E=n.limit;switch(a._hx_index){case 1:let I=a.limit;return v.eq(E,I)?!1:!v.gt(E,I);case 2:return!v.gt(E,a.limit);default:return!0}break;case 2:let u=n.limit;switch(a._hx_index){case 1:let I=a.limit;return v.eq(u,I)?!1:!v.gt(u,I);case 2:return!v.gt(u,a.limit);default:return!0}break;default:return!0}}static min(n,a,E){switch(n._hx_index){case 0:return E==_.Lower?YA.Unbounded:a;case 1:let u=n.limit;switch(a._hx_index){case 0:return E==_.Lower?YA.Unbounded:n;case 1:return v.lt(u,a.limit)?n:a;case 2:let p=a.limit;return v.eq(u,p)?E==_.Lower?a:n:v.lt(u,p)?n:a}break;case 2:let I=n.limit;switch(a._hx_index){case 0:return E==_.Lower?YA.Unbounded:n;case 1:let p=a.limit;return v.eq(p,I)?E==_.Lower?n:a:v.lt(I,p)?n:a;case 2:return v.lt(I,a.limit)?n:a}break}}static max(n,a,E){switch(n._hx_index){case 0:return E==_.Upper?YA.Unbounded:a;case 1:let u=n.limit;switch(a._hx_index){case 0:return E==_.Upper?YA.Unbounded:n;case 1:return v.gt(u,a.limit)?n:a;case 2:let p=a.limit;return v.eq(u,p)?E==_.Upper?a:n:v.gt(u,p)?n:a}break;case 2:let I=n.limit;switch(a._hx_index){case 0:return E==_.Upper?YA.Unbounded:n;case 1:let p=a.limit;return v.eq(p,I)?E==_.Upper?n:a:v.gt(I,p)?n:a;case 2:return v.gt(I,a.limit)?n:a}break}}}H.__name__=!0;var _=t["tink.semver.ExtremumKind"]={__ename__:!0,__constructs__:null,Upper:{_hx_name:"Upper",_hx_index:0,__enum__:"tink.semver.ExtremumKind",toString:e},Lower:{_hx_name:"Lower",_hx_index:1,__enum__:"tink.semver.ExtremumKind",toString:e}};_.__constructs__=[_.Upper,_.Lower];class $A{static parse(n){return n==null||n==""?DA.Success($A.WILDCARD):zA.catchExceptions((r=new It(lA.ofString(n)),wa(r,r.parseConstraint)),null,{fileName:"tink/semver/Constraint.hx",lineNumber:23,className:"tink.semver._Constraint.Constraint_Impl_",methodName:"parse"})}static create(n){let a=[],E=0;for(;E=")))return this.parseSimple(this.lower(YA.Inclusive));if(this.allowHere(lA.ofString(">")))return this.parseSimple(this.lower(YA.Exlusive));if(this.allowHere(lA.ofString("<=")))return this.parseSimple(this.upper(YA.Inclusive));if(this.allowHere(lA.ofString("<")))return this.parseSimple(this.upper(YA.Exlusive));if(this.allowHere(lA.ofString("=")))return $A.exact(this.parseInlineVersion());if(this.allowHere(lA.ofString("^")))return this.parseSimple(wa(this,this.carret));{let n=this.parsePartial();if(this.allow(It.HYPHEN)){let a=YA.Inclusive(this.full(n));return this.skipIgnored(),$A.fromRange({min:a,max:YA.Inclusive(this.parseInlineVersion())})}else if(n.patch<0){let a=this.full(n,!0);return v.range(a,n.minor<0?v.nextMajor(a):v.nextMinor(a))}else return $A.ofVersion(this.full(n))}}parseVersion(){let n=this.parseInlineVersion();return this.skipIgnored(),this.pos==this.max?n:this.die("Unexpected string",new o(this.pos,this.max))}parsePartial(){let n=this.pos,a=this,E=function(){return a.allowHere(lA.ofString("."))?a.num():-1},u=this.num(),I=E(),p=E(),m=null,R=-1;if(p>=0&&this.allowHere(It.HYPHEN)){this.skipIgnored();let L=this.pos;for(;;){let j;if(this.pos0?1:E<0?-1:0,u>0?1:u<0?-1:0),I>0?1:I<0?-1:0),p>0?1:p<0?-1:0),m>0?1:m<0?-1:0)}static idx(n,a){if(a==null)return 100;switch(a){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}static eq(n,a){return v.compare(n,a)==0}static gt(n,a){return v.compare(n,a)==1}static lt(n,a){return v.compare(n,a)==-1}static gte(n,a){return v.compare(n,a)!=-1}static lte(n,a){return v.compare(n,a)!=1}static range(n,a){return $A.range(n,a)}static parse(n){return zA.catchExceptions((r=new It(lA.ofString(n)),wa(r,r.parseVersion)),v.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})}static reportError(n){return typeof n=="string"?new zA(422,n,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"}):zA.withData(422,h.string(n),n,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}}class es{constructor(n,a,E,u,I){if(I==null&&(I=-1),n<0||a<0||E<0)throw B.thrown("version components must not be negative");this.major=n,this.minor=a,this.patch=E,this.preview=u,this.previewNum=I}toString(){let n=""+this.major+"."+this.minor+"."+this.patch;return this.preview!=null&&(n+="-"+this.preview,this.previewNum!=-1&&(n+="."+this.previewNum)),n}}es.__name__=!0;class rn{static chain(n,a){return n==0?a:n}}class At{static get_value(n){let a=n.getValue();return wA.cur!=null&&wA.cur.subscribeTo(n,a),a}static map(n,a){return new wA(ri.sync(function(){let E=At.get_value(n);return a(E)}),null,null)}}class ti{constructor(n,a){this.revision=kr._new(),this.value=n}getRevision(){return this.revision}getValue(){return this.value}getComparator(){return null}onInvalidate(n){return null}}ti.__name__=!0;class ve{constructor(n){ve._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.list=new Ba,this.observers=new Map,this.revision=kr._new()}getRevision(){return this.revision}onInvalidate(n){let a=this;if(this.observers.get(n))return null;{this.observers.set(n,!0);let E=this.list,u;if(E.disposeHandlers==null)u=null;else{let I=new Ia(function(p){n.invalidate()},E);if(E.cells.push(I),E.used++==0){let p=E.onfill;BA.depth<500?(BA.depth++,p(),BA.depth--):BA.defer(p)}u=I}return new Ca(u,new ul(function(){a.observers.delete(n)}))}}fire(){this.revision=kr._new(),this.list.invoke(null)}}ve.__name__=!0;class wl{static plain(n){return n}}class yl{static _new(n,a,E,u,I){return E==null?new pa(n,a,u,I):new ml(n,E,a,u,I)}}class pa extends ve{constructor(n,a,E,u){if(ve._hx_skip_constructor){super();return}ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E,u)}_hx_constructor(n,a,E,u){if(super._hx_constructor(u),this.value=n,this.comparator=a,E!=null){let I=E,p=!1,m=function(){I(p)};this.list.ondrain=m;let R=E,L=!0,J=function(){R(L)};this.list.onfill=J}}getValue(){return this.value}getComparator(){return this.comparator}}pa.__name__=!0;class ml extends pa{constructor(n,a,E,u,I){ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E,u,I)}_hx_constructor(n,a,E,u,I){this.guardApplied=!1,super._hx_constructor(n,E,u,I),this.guard=a}getValue(){return this.guardApplied?this.value:(this.guardApplied=!0,this.value=this.guard(this.value))}}ml.__name__=!0;class ri{static sync(n){return function(a,E){return n()}}}class Dl{constructor(n,a,E){this.used=!0,this.source=n,this.last=a,this.lastRev=n.getRevision(),this.owner=E,E.hot&&(this.link=this.source.onInvalidate(this.owner))}}Dl.__name__=!0;class wA extends ve{constructor(n,a,E){ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E)}_hx_constructor(n,a,E){this.sync=!0,this.dependencies=new Map,this.last=null,this.status=0,this.hot=!1,super._hx_constructor(E),this.compute=n,this.comparator=a;let u=this;this.list.onfill=function(){if(u.getValue(),u.getRevision(),u.subscriptions!=null){let I=0,p=u.subscriptions;for(;Ithis.revision)return this.revision=kr._new();return this.revision}subsValid(){if(this.subscriptions==null)return!1;let n=0,a=this.subscriptions;for(;n>10)+55232)+String.fromCharCode((k&1023)+56320)}),String.__name__=!0,Array.__name__=!0,S.content=[{name:"releases.json",data:"Ww0KCXsNCgkJInZlcnNpb24iOiAiMS4xNC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhhc2hsaW5rLTEuMTQuMC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEzLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGFzaGxpbmstMS4xMy4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuMTIuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIldpbmRvd3MiLCAiZmlsZSI6ICJobC0xLjEyLjAtd2luLnppcCJ9DQoJCV0NCgl9LA0KCXsNCgkJInZlcnNpb24iOiAiMS4xMS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMTEuMC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEwLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGwtMS4xMC4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuOS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuOS4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuOC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuOC4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNy4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNy4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNi4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiTGludXgiLCAiZmlsZSI6ICJobC0xLjYuMC1saW51eC50Z3oifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNi4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiTGludXgiLCAiZmlsZSI6ICJobC0xLjUuMC1saW51eC50Z3oifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNS4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjMuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIk1hYyIsICJmaWxlIjogImhsLTEuMy1vc3gzMi56aXAifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMy1XaW5kb3dzLnppcCJ9DQoJCV0NCgl9LA0KCXsNCgkJInZlcnNpb24iOiAiMS4yLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJNYWMiLCAiZmlsZSI6ICJobC0xLjItb3N4LnppcCJ9LA0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGwtMS4yLVdpbmRvd3MuemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIldpbmRvd3MiLCAiZmlsZSI6ICJobC0xLjEtV2luZG93cy56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuMC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMC1XaW5kb3dzLnppcCJ9DQoJCV0NCgl9DQpdDQo"}],TA.__toStr={}.toString,kr.counter=0,G.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G.BYTES=F.ofString(G.CHARS),Dt.EMPTY=[],Vt.DBQT=String.fromCodePoint(34),KA.baseUrl=De.fromString("https://github.com/HaxeFoundation/hashlink/"),KA.data=ut.fromArray(new qA().parse(S.getString("releases.json"))),BA.depth=0,ar._hx_skip_constructor=!1,qt._hx_skip_constructor=!1,Ot.NEVER_INST=new qt,tn.BACKSLASH="\\",ke.byInt=new ZA,ke.WHITE=ke.oneOf([9,10,11,12,13,32]),ke.LOWER=ke.ofRange(new o(97,123)),ke.DIGIT=ke.ofRange(new o(48,58)),lA.CHARS=function(k){var n;let a=[];{let E=0;for(;E<128;){let u=E++;a.push(new As(String.fromCodePoint(u),0,1))}}return n=a,n}(this),lA.EMPTY=new As("",0,0),It.OR=lA.ofString("||"),It.DOT=lA.ofString("."),It.HYPHEN=lA.ofString("-"),At.MAX_ITERATIONS=100,ve._hx_skip_constructor=!1,Qe()})(global); +`+a+"}",I;case"string":return n;default:return String(n)}}}TA.__name__=!0;var eA=js(),pA=Ap(),te=require("child_process"),Qt=require("fs");function Qe(){process.title="Setup HashLink VM";let k=eA.getInput("version"),n=$A.parse(k.length==0||k=="latest"?"*":k);switch(n._hx_index){case 0:let a=KA.find(n.data);switch(a._hx_index){case 0:let E=a.v;new ll(E).install().handle(function(u){switch(u._hx_index){case 0:eA.info("HashLink "+E.version+' successfully installed in "'+u.data+'".');break;case 1:eA.setFailed(u.failure.message);break}});break;case 1:eA.setFailed("No release matching the version constraint.");break}break;case 1:eA.setFailed("Invalid version constraint.");break}}class De{static resolve(n,a){if(a.scheme!=null)return a;if(a.hosts[0]!=null){if(a.scheme!=null)return a;{let E=g.copy(a);return E.scheme=n.scheme,E}}else{let E={path:ze.join(n.path,a.path),payload:"",scheme:n.scheme,query:a.query,auth:n.auth,hosts:n.hosts,hash:a.hash};return De.makePayload(E),E}}static makePayload(n){let a="",E=n.auth,u=n.hosts;E==null?u.length!=0&&(a="//"+u.join(",")):u.length==0?a="//"+(E==null?"null":E==null?"":""+E+"@"):a="//"+(E==null?"null":E==null?"":""+E+"@")+u.join(","),a+=n.path==null?"null":n.path;let I=n.query;I!=null&&(a+="?"+(I??"null"));let p=n.hash;p!=null&&(a+="#"+p),n.payload=a.toString()}static toString(n){return n.scheme==null?n.payload:""+n.scheme+":"+n.payload}static fromString(n){return De.parse(n)}static noop(n){}static parse(n,a){for(;;){if(n==null){n="",a=null;continue}if(a==null&&(a=De.noop),n=l.trim(n),n.startsWith("data:"))return{scheme:"data",payload:i.substr(n,5,null),hosts:[]};let E=new s("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$",""),u=new s("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");E.match(n);let I,p=E.matched(7);if(p==null)I=[];else{let R=[],L=0,J=p.split(",");for(;L0&&m.charAt(0)!="/"&&(m="/"+m),{scheme:E.matched(2),payload:E.matched(3),hosts:I,auth:E.matched(6),path:ze.ofString(m),query:E.matched(10),hash:E.matched(12)}}}}class zr{static _new(n,a){let E;if(a==null)E=n;else{if(a>65535||a<=0)throw B.thrown("Invalid port");E=""+n+":"+a}return E}}class ze{static join(n,a){if(a=="")return n;if(a.charAt(0)=="/")return a;if(n.charAt(n.length-1)=="/")return ze.ofString(n+a);{let E=n.lastIndexOf("/");return E==-1?a:ze.ofString(i.substr(n,0,E+1)+(a??"null"))}}static ofString(n){return ze.normalize(n)}static normalize(n){if(n=l.trim(l.replace(n,"\\","/")),n==".")return"./";let a=n.endsWith("/..")||n.endsWith("/")||n.endsWith("/."),E=[],u=n.startsWith("/"),I=0,p=0,m=n.split("/");for(;p0;){let u=E.next();if(a==null||a(u))return w.Some(u)}return w.None}static _new(){return null}static fromArray(n){let a=null,E=0,u=n.length;for(;u-- >0;)a=new Dt(++E,n[u],a==null?Dt.EMPTY:[a]);return a}}class Dt{constructor(n,a,E){this.value=a,this.length=n,this.tails=E??Dt.EMPTY}}Dt.__name__=!0;class Vt{constructor(){this.afterParsing=[],this.plugins=new Re(this)}init(n){for(this.pos=0,this.max=n.length,this.source=n;this.source.charCodeAt(this.pos)<33;)this.pos++}parseString(){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let n;return this.source.charCodeAt(this.pos)==34?(this.pos+=1,n=!0):n=!1,n||this.die("Expected string"),this.parseRestOfString()}parseRestOfString(){return this.slice(this.skipString(),this.pos-1)}skipString(){let n=this.pos;for(;;){let a=this.source.indexOf(Vt.DBQT,this.pos);if(a==-1)this.die("unterminated string",n);else{this.pos=a+1;let E=this.pos-2;for(;this.source.charCodeAt(E)==92;)--E;if(!(E-this.pos&1))break}}return n}invalidNumber(n){return this.die("Invalid number "+this.source.substring(n,this.pos),n)}skipNumber(n){let a=this.pos-1,E=n==45,u=!E,I=n==48,p=!1,m=!1,R=!1,L=!1;for(;this.pos47?this.skipNumber(n):this.invalidChar(n)}}invalidChar(n){return this.die("invalid char "+l.hex(n,2),this.pos-1)}die(n,a,E){E==null&&(E=-1),a==null&&(a=-1),a==-1?(a=this.pos,E=a):E==-1&&(E=this.pos),E<=a&&(E=a+1);let u=function(p,m,R){return p.length>m?R?"... "+i.substr(p,p.length-m,null):i.substr(p,0,m)+" ...":p},I=a+E>>1;return zA.withData(422,n+(" at "+(E>a+1?"characters "+a+" - "+E:"character "+a)+" in "+(u(this.source.substring(0,a),20,!0)+" ----> "+u(this.source.substring(a,I),20,!1)+u(this.source.substring(I,E),20,!0)+" <---- "+u(this.source.substring(E,this.max),20,!1))),{source:this.source,start:a,end:E},{fileName:"tink/json/Parser.hx",lineNumber:472,className:"tink.json.BasicParser",methodName:"die"}).throwSelf()}}Vt.__name__=!0;class qA extends Vt{constructor(){super()}process0(){let n=this,a=0,E=null,u=null,I=this.pos;for(;;){let m=this.source.charCodeAt(this.pos++),R;if(m==123)break;R=m<33,R!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let p;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;p=!0}else p=!1;if(!p){A:for(;;){for(;;){let L=this.source.charCodeAt(this.pos++),J;if(L==34)break;J=L<33,J!=!0&&this.die('expected "')}switch(a=this.source.charCodeAt(this.pos++),a){case 97:if(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==116&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==34)))))){for(;;){let j=this.source.charCodeAt(this.pos++),z;if(j==58)break;z=j<33,z!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(L)E=null;else{for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let j;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;j=!0}else j=!1;j||this.die("Expected [");let z=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let K;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;K=!0}else K=!1;if(!K){for(;;){for(z.push(new An(this.process1()));this.source.charCodeAt(this.pos)<33;)this.pos++;let UA;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;UA=!0}else UA=!1;if(!UA)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let aA;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;aA=!0}else aA=!1;aA||this.die("Expected ]")}E=ut.fromArray(z)}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,J=!0):J=!1,J)continue;break A}break;case 118:if(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==114&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==111&&(a=this.source.charCodeAt(this.pos++),a==110&&(a=this.source.charCodeAt(this.pos++),a==34))))))){for(;;){let j=this.source.charCodeAt(this.pos++),z;if(j==58)break;z=j<33,z!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(L)u=null;else{let j=this.parseString();u=j.indexOf(tn.BACKSLASH)==-1?j:JSON.parse('"'+j+'"')}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,J=!0):J=!1,J)continue;break A}break}for(a!=34&&this.skipString();;){let L=this.source.charCodeAt(this.pos++),J;if(L==58)break;J=L<33,J!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,R=!0):R=!1,!R)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected }")}return{assets:E,version:u}}process1(){let n=this,a=0,E=null,u=!1,I=null,p=!1,m=this.pos;for(;;){let J=this.source.charCodeAt(this.pos++),j;if(J==123)break;j=J<33,j!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;if(!R){A:for(;;){for(;;){let z=this.source.charCodeAt(this.pos++),K;if(z==34)break;K=z<33,K!=!0&&this.die('expected "')}switch(a=this.source.charCodeAt(this.pos++),a){case 102:if(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==108&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==34)))){for(;;){let aA=this.source.charCodeAt(this.pos++),UA;if(aA==58)break;UA=aA<33,UA!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let z=this.parseString();for(E=z.indexOf(tn.BACKSLASH)==-1?z:JSON.parse('"'+z+'"'),u=!0;this.source.charCodeAt(this.pos)<33;)this.pos++;let K;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,K=!0):K=!1,K)continue;break A}break;case 111:if(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==34)){for(;;){let UA=this.source.charCodeAt(this.pos++),Rt;if(UA==58)break;Rt=UA<33,Rt!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let z=this.parseString(),K=z.indexOf(tn.BACKSLASH)==-1?z:JSON.parse('"'+z+'"');switch(K){case"Linux":case"Mac":case"Windows":I=K;break;default:throw B.thrown(new zA(422,"Unrecognized enum value: "+K+". Accepted values are: "+new fl().write(["Linux","Mac","Windows"]),{fileName:"tink/json/macros/GenReader.hx",lineNumber:454,className:"tink.json.Parser0",methodName:"process1"}))}for(p=!0;this.source.charCodeAt(this.pos)<33;)this.pos++;let aA;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,aA=!0):aA=!1,aA)continue;break A}break}for(a!=34&&this.skipString();;){let z=this.source.charCodeAt(this.pos++),K;if(z==58)break;K=z<33,K!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let j;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,j=!0):j=!1,!j)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let J;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;J=!0}else J=!1;J||this.die("Expected }")}let L=function(J){return n.die('missing field "'+J+'"',m)};return{file:u?E:L("file"),os:p?I:L("os")}}parse(n){for(this.afterParsing.length>0&&(this.afterParsing=[]),this.init(n);this.source.charCodeAt(this.pos)<33;)this.pos++;let a;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;a=!0}else a=!1;a||this.die("Expected [");let E=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let u;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;u=!0}else u=!1;if(!u){for(;;){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;for(E.push(new KA(R?null:this.process0()));this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(!L)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected ]")}let I=0,p=this.afterParsing;for(;I0&&(this.afterParsing=[]),E}}qA.__name__=!0;class Re{constructor(n){this.target=n,this.registry=new HA}}Re.__name__=!0;class KA{constructor(n){n==null&&(n={});let a=this,E=wA.cur;wA.cur=null;let u=new wA(ri.sync(function(){let K=a.getAsset(Q.systemName()),aA;switch(K._hx_index){case 0:aA=De.fromString("releases/download/"+At.get_value(a.__coco_tag)+"/"+K.v.file);break;case 1:aA=De.fromString("archive/refs/tags/"+At.get_value(a.__coco_tag)+".zip");break}return De.resolve(KA.baseUrl,aA)}),null,null);wA.cur=E,this.__coco_url=u;let I=wA.cur;wA.cur=null;let p=new wA(ri.sync(function(){let K=ei.sure(v.parse(a.version)),aA=""+K.major+"."+K.minor;return K.patch>0?""+aA+"."+K.patch:aA}),null,null);wA.cur=I,this.__coco_tag=p;let m=wA.cur;wA.cur=null;let R=new wA(ri.sync(function(){return a.getAsset(Q.systemName())==w.None}),null,null);wA.cur=m,this.__coco_isSource=R;let L=wA.cur;wA.cur=null;let J=new wA(ri.sync(function(){let K=!1,aA=new da(KA.data);for(;aA.list.length>0;)if(aA.next().version==a.version){K=!0;break}return K}),null,null);wA.cur=L,this.__coco_exists=J;let j=n.assets;this.assets=j??ut._new();let z=n.version;this.version=z??"0.0.0",this.__coco_transitionCount=yl._new(0),this.errorTrigger=Cl.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new C(this),this.observables={assets:new ti(this.assets,null),exists:this.__coco_exists,isSource:this.__coco_isSource,tag:this.__coco_tag,url:this.__coco_url,version:new ti(this.version,null),isInTransition:At.map(this.__coco_transitionCount,wl.plain(function(K){return K>0}))}}getAsset(n){return ut.first(this.assets,function(a){return a.os==n})}static find(n){return ut.first(KA.data,function(a){return $A.matches(n,ei.sure(v.parse(a.version)))})}}KA.__name__=!0;class An{constructor(n){this.file=n.file,this.os=n.os,this.__coco_transitionCount=yl._new(0),this.errorTrigger=Cl.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new C(this),this.observables={file:new ti(this.file,null),os:new ti(this.os,null),isInTransition:At.map(this.__coco_transitionCount,wl.plain(function(a){return a>0}))}}}An.__name__=!0;class ll{constructor(n){this.release=n}download(){let n=this;return $r.next($r.next(Ot.ofJsPromise(pA.downloadTool(De.toString(At.get_value(this.release.__coco_url)))),function(a){return Ot.ofJsPromise(pA.extractZip(a))}),function(a){return ei.next(n.findSubfolder(a),function(E){return new Ct(new $e(DA.Success(n.normalizeSeparator(VA.join([a,E])))))})})}install(){let n=pA.find("hashlink",this.release.version),a=this,E=n.length>0?new Ct(new $e(DA.Success(n))):$r.next(this.download(),function(I){return Ot.ofJsPromise(pA.cacheDir(I,"hashlink",a.release.version))}),u=At.get_value(this.release.__coco_isSource)&&process.env.GITHUB_ACTIONS=="true";return $r.next($r.next(E,function(I){return u?a.compile(I):new Ct(new $e(DA.Success(I)))}),function(I){let p=a.normalizeSeparator(I);return eA.addPath(At.get_value(a.release.__coco_isSource)?a.normalizeSeparator(VA.join([I,"bin"])):p),new Ct(new $e(DA.Success(p)))})}compile(n){let a=Q.systemName();if(!["Linux","Mac"].includes(a))return new Ct(new $e(DA.Failure(new zA(501,"Compilation is not supported on "+a+" platform.",{fileName:"src/setup_hashlink/Setup.hx",lineNumber:53,className:"setup_hashlink.Setup",methodName:"compile"}))));let E=VA.addTrailingSlash(process.cwd());return process.chdir(n),$r.next(a=="Linux"?this.compileLinux():this.compileMacOs(),function(u){return process.chdir(E),new Ct(new $e(DA.Success(u)))})}compileLinux(){c.iter(["sudo apt-get update","sudo apt-get install --assume-yes --no-install-recommends "+["libmbedtls-dev","libopenal-dev","libpng-dev","libsdl2-dev","libturbojpeg0-dev","libuv1-dev","libvorbis-dev"].join(" "),"make","sudo make install","sudo ldconfig"],function(E){te.spawnSync(E,{shell:!0,stdio:"inherit"})});let n=process.env.LD_LIBRARY_PATH,a=l.trim(n??"");return eA.exportVariable("LD_LIBRARY_PATH",a.length>0?"/usr/local/bin:"+a:"/usr/local/bin"),new Ct(new $e(DA.Success("/usr/local")))}compileMacOs(){return c.iter(["brew bundle","make","sudo make install"],function(n){te.spawnSync(n,{shell:!0,stdio:"inherit"})}),new Ct(new $e(DA.Success("/usr/local")))}findSubfolder(n){let a=Qt.readdirSync(n),E=[],u=0;for(;u>1&&n.compact()}}}Ia.__name__=!0;class ar{constructor(n){ar._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.disposeHandlers=[],this.f=n}dispose(){let n=this.disposeHandlers;if(n!=null){this.disposeHandlers=null;let a=this.f;this.f=ar.noop,a();let E=0;for(;E0){this.used=0;let E=this.ondrain;BA.depth<500?(BA.depth++,E(),BA.depth--):BA.defer(E)}}invoke(n){let a=this;if(BA.depth<500){if(BA.depth++,a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,u=n,I=function(){E.invoke(u)};a.queue.push(I)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,u=0;for(;u0&&a.queue.shift()())}BA.depth--}else BA.defer(function(){if(a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,u=n,I=function(){E.invoke(u)};a.queue.push(I)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,u=0;for(;u0&&a.queue.shift()())}})}compact(){if(!this.busy)if(this.used==0){this.resize(0);let n=this.ondrain;BA.depth<500?(BA.depth++,n(),BA.depth--):BA.defer(n)}else{let n=0,a=0,E=this.cells.length;for(;a256&&(n=new o(n.min,256));let E=n;for(;E.minn.length?0:a+n.length:a>n.length?n.length:a}static wrap(n,a){return a<0?a+n.length:a}static ofString(n){if(n==null||n=="")return lA.EMPTY;if(n.length==1){let a=n.charCodeAt(0);return an.length)return!1;let u=a;return lA.isEqual(n.string,n.start+E,a.length,u.string,u.start,u.length)}static isEqual(n,a,E,u,I,p){if(p!=E)return!1;let m=0;for(;m0}next(){let n=this.list.pop();if(n==null)return null;{let a=-n.tails.length;for(;a<0;)this.list.push(n.tails[-a++-1]);return n.value}}}da.__name__=!0;var YA=t["tink.semver.Bound"]={__ename__:!0,__constructs__:null,Unbounded:{_hx_name:"Unbounded",_hx_index:0,__enum__:"tink.semver.Bound",toString:e},Exlusive:(r=function(k){return{_hx_index:1,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Exlusive",r.__params__=["limit"],r),Inclusive:(r=function(k){return{_hx_index:2,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Inclusive",r.__params__=["limit"],r)};YA.__constructs__=[YA.Unbounded,YA.Exlusive,YA.Inclusive];class H{static isLowerThan(n,a){switch(n._hx_index){case 1:let E=n.limit;switch(a._hx_index){case 1:let I=a.limit;return v.eq(E,I)?!1:!v.gt(E,I);case 2:return!v.gt(E,a.limit);default:return!0}break;case 2:let u=n.limit;switch(a._hx_index){case 1:let I=a.limit;return v.eq(u,I)?!1:!v.gt(u,I);case 2:return!v.gt(u,a.limit);default:return!0}break;default:return!0}}static min(n,a,E){switch(n._hx_index){case 0:return E==_.Lower?YA.Unbounded:a;case 1:let u=n.limit;switch(a._hx_index){case 0:return E==_.Lower?YA.Unbounded:n;case 1:return v.lt(u,a.limit)?n:a;case 2:let p=a.limit;return v.eq(u,p)?E==_.Lower?a:n:v.lt(u,p)?n:a}break;case 2:let I=n.limit;switch(a._hx_index){case 0:return E==_.Lower?YA.Unbounded:n;case 1:let p=a.limit;return v.eq(p,I)?E==_.Lower?n:a:v.lt(I,p)?n:a;case 2:return v.lt(I,a.limit)?n:a}break}}static max(n,a,E){switch(n._hx_index){case 0:return E==_.Upper?YA.Unbounded:a;case 1:let u=n.limit;switch(a._hx_index){case 0:return E==_.Upper?YA.Unbounded:n;case 1:return v.gt(u,a.limit)?n:a;case 2:let p=a.limit;return v.eq(u,p)?E==_.Upper?a:n:v.gt(u,p)?n:a}break;case 2:let I=n.limit;switch(a._hx_index){case 0:return E==_.Upper?YA.Unbounded:n;case 1:let p=a.limit;return v.eq(p,I)?E==_.Upper?n:a:v.gt(I,p)?n:a;case 2:return v.gt(I,a.limit)?n:a}break}}}H.__name__=!0;var _=t["tink.semver.ExtremumKind"]={__ename__:!0,__constructs__:null,Upper:{_hx_name:"Upper",_hx_index:0,__enum__:"tink.semver.ExtremumKind",toString:e},Lower:{_hx_name:"Lower",_hx_index:1,__enum__:"tink.semver.ExtremumKind",toString:e}};_.__constructs__=[_.Upper,_.Lower];class $A{static parse(n){return n==null||n==""?DA.Success($A.WILDCARD):zA.catchExceptions((r=new It(lA.ofString(n)),wa(r,r.parseConstraint)),null,{fileName:"tink/semver/Constraint.hx",lineNumber:23,className:"tink.semver._Constraint.Constraint_Impl_",methodName:"parse"})}static create(n){let a=[],E=0;for(;E=")))return this.parseSimple(this.lower(YA.Inclusive));if(this.allowHere(lA.ofString(">")))return this.parseSimple(this.lower(YA.Exlusive));if(this.allowHere(lA.ofString("<=")))return this.parseSimple(this.upper(YA.Inclusive));if(this.allowHere(lA.ofString("<")))return this.parseSimple(this.upper(YA.Exlusive));if(this.allowHere(lA.ofString("=")))return $A.exact(this.parseInlineVersion());if(this.allowHere(lA.ofString("^")))return this.parseSimple(wa(this,this.carret));{let n=this.parsePartial();if(this.allow(It.HYPHEN)){let a=YA.Inclusive(this.full(n));return this.skipIgnored(),$A.fromRange({min:a,max:YA.Inclusive(this.parseInlineVersion())})}else if(n.patch<0){let a=this.full(n,!0);return v.range(a,n.minor<0?v.nextMajor(a):v.nextMinor(a))}else return $A.ofVersion(this.full(n))}}parseVersion(){let n=this.parseInlineVersion();return this.skipIgnored(),this.pos==this.max?n:this.die("Unexpected string",new o(this.pos,this.max))}parsePartial(){let n=this.pos,a=this,E=function(){return a.allowHere(lA.ofString("."))?a.num():-1},u=this.num(),I=E(),p=E(),m=null,R=-1;if(p>=0&&this.allowHere(It.HYPHEN)){this.skipIgnored();let L=this.pos;for(;;){let j;if(this.pos0?1:E<0?-1:0,u>0?1:u<0?-1:0),I>0?1:I<0?-1:0),p>0?1:p<0?-1:0),m>0?1:m<0?-1:0)}static idx(n,a){if(a==null)return 100;switch(a){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}static eq(n,a){return v.compare(n,a)==0}static gt(n,a){return v.compare(n,a)==1}static lt(n,a){return v.compare(n,a)==-1}static gte(n,a){return v.compare(n,a)!=-1}static lte(n,a){return v.compare(n,a)!=1}static range(n,a){return $A.range(n,a)}static parse(n){return zA.catchExceptions((r=new It(lA.ofString(n)),wa(r,r.parseVersion)),v.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})}static reportError(n){return typeof n=="string"?new zA(422,n,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"}):zA.withData(422,h.string(n),n,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}}class es{constructor(n,a,E,u,I){if(I==null&&(I=-1),n<0||a<0||E<0)throw B.thrown("version components must not be negative");this.major=n,this.minor=a,this.patch=E,this.preview=u,this.previewNum=I}toString(){let n=""+this.major+"."+this.minor+"."+this.patch;return this.preview!=null&&(n+="-"+this.preview,this.previewNum!=-1&&(n+="."+this.previewNum)),n}}es.__name__=!0;class rn{static chain(n,a){return n==0?a:n}}class At{static get_value(n){let a=n.getValue();return wA.cur!=null&&wA.cur.subscribeTo(n,a),a}static map(n,a){return new wA(ri.sync(function(){let E=At.get_value(n);return a(E)}),null,null)}}class ti{constructor(n,a){this.revision=kr._new(),this.value=n}getRevision(){return this.revision}getValue(){return this.value}getComparator(){return null}onInvalidate(n){return null}}ti.__name__=!0;class ve{constructor(n){ve._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.list=new Ba,this.observers=new Map,this.revision=kr._new()}getRevision(){return this.revision}onInvalidate(n){let a=this;if(this.observers.get(n))return null;{this.observers.set(n,!0);let E=this.list,u;if(E.disposeHandlers==null)u=null;else{let I=new Ia(function(p){n.invalidate()},E);if(E.cells.push(I),E.used++==0){let p=E.onfill;BA.depth<500?(BA.depth++,p(),BA.depth--):BA.defer(p)}u=I}return new Ca(u,new ul(function(){a.observers.delete(n)}))}}fire(){this.revision=kr._new(),this.list.invoke(null)}}ve.__name__=!0;class wl{static plain(n){return n}}class yl{static _new(n,a,E,u,I){return E==null?new pa(n,a,u,I):new ml(n,E,a,u,I)}}class pa extends ve{constructor(n,a,E,u){if(ve._hx_skip_constructor){super();return}ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E,u)}_hx_constructor(n,a,E,u){if(super._hx_constructor(u),this.value=n,this.comparator=a,E!=null){let I=E,p=!1,m=function(){I(p)};this.list.ondrain=m;let R=E,L=!0,J=function(){R(L)};this.list.onfill=J}}getValue(){return this.value}getComparator(){return this.comparator}}pa.__name__=!0;class ml extends pa{constructor(n,a,E,u,I){ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E,u,I)}_hx_constructor(n,a,E,u,I){this.guardApplied=!1,super._hx_constructor(n,E,u,I),this.guard=a}getValue(){return this.guardApplied?this.value:(this.guardApplied=!0,this.value=this.guard(this.value))}}ml.__name__=!0;class ri{static sync(n){return function(a,E){return n()}}}class Dl{constructor(n,a,E){this.used=!0,this.source=n,this.last=a,this.lastRev=n.getRevision(),this.owner=E,E.hot&&(this.link=this.source.onInvalidate(this.owner))}}Dl.__name__=!0;class wA extends ve{constructor(n,a,E){ve._hx_skip_constructor=!0,super(),ve._hx_skip_constructor=!1,this._hx_constructor(n,a,E)}_hx_constructor(n,a,E){this.sync=!0,this.dependencies=new Map,this.last=null,this.status=0,this.hot=!1,super._hx_constructor(E),this.compute=n,this.comparator=a;let u=this;this.list.onfill=function(){if(u.getValue(),u.getRevision(),u.subscriptions!=null){let I=0,p=u.subscriptions;for(;Ithis.revision)return this.revision=kr._new();return this.revision}subsValid(){if(this.subscriptions==null)return!1;let n=0,a=this.subscriptions;for(;n>10)+55232)+String.fromCharCode((k&1023)+56320)}),String.__name__=!0,Array.__name__=!0,S.content=[{name:"releases.json",data:"Ww0KCXsNCgkJInZlcnNpb24iOiAiMS4xNC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhhc2hsaW5rLTEuMTQuMC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEzLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGFzaGxpbmstMS4xMy4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuMTIuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIldpbmRvd3MiLCAiZmlsZSI6ICJobC0xLjEyLjAtd2luLnppcCJ9DQoJCV0NCgl9LA0KCXsNCgkJInZlcnNpb24iOiAiMS4xMS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMTEuMC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEwLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGwtMS4xMC4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuOS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuOS4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuOC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuOC4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNy4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNy4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNi4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiTGludXgiLCAiZmlsZSI6ICJobC0xLjYuMC1saW51eC50Z3oifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNi4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNS4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiTGludXgiLCAiZmlsZSI6ICJobC0xLjUuMC1saW51eC50Z3oifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNS4wLXdpbi56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuNC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuNC13aW4uemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjMuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIk1hYyIsICJmaWxlIjogImhsLTEuMy1vc3gzMi56aXAifSwNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMy1XaW5kb3dzLnppcCJ9DQoJCV0NCgl9LA0KCXsNCgkJInZlcnNpb24iOiAiMS4yLjAiLA0KCQkiYXNzZXRzIjogWw0KCQkJeyJvcyI6ICJNYWMiLCAiZmlsZSI6ICJobC0xLjItb3N4LnppcCJ9LA0KCQkJeyJvcyI6ICJXaW5kb3dzIiwgImZpbGUiOiAiaGwtMS4yLVdpbmRvd3MuemlwIn0NCgkJXQ0KCX0sDQoJew0KCQkidmVyc2lvbiI6ICIxLjEuMCIsDQoJCSJhc3NldHMiOiBbDQoJCQl7Im9zIjogIldpbmRvd3MiLCAiZmlsZSI6ICJobC0xLjEtV2luZG93cy56aXAifQ0KCQldDQoJfSwNCgl7DQoJCSJ2ZXJzaW9uIjogIjEuMC4wIiwNCgkJImFzc2V0cyI6IFsNCgkJCXsib3MiOiAiV2luZG93cyIsICJmaWxlIjogImhsLTEuMC1XaW5kb3dzLnppcCJ9DQoJCV0NCgl9DQpdDQo"}],TA.__toStr={}.toString,kr.counter=0,G.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",G.BYTES=F.ofString(G.CHARS),Dt.EMPTY=[],Vt.DBQT=String.fromCodePoint(34),KA.baseUrl=De.fromString("https://github.com/HaxeFoundation/hashlink/"),KA.data=ut.fromArray(new qA().parse(S.getString("releases.json"))),BA.depth=0,ar._hx_skip_constructor=!1,qt._hx_skip_constructor=!1,Ot.NEVER_INST=new qt,tn.BACKSLASH="\\",ke.byInt=new ZA,ke.WHITE=ke.oneOf([9,10,11,12,13,32]),ke.LOWER=ke.ofRange(new o(97,123)),ke.DIGIT=ke.ofRange(new o(48,58)),lA.CHARS=function(k){var n;let a=[];{let E=0;for(;E<128;){let u=E++;a.push(new As(String.fromCodePoint(u),0,1))}}return n=a,n}(this),lA.EMPTY=new As("",0,0),It.OR=lA.ofString("||"),It.DOT=lA.ofString("."),It.HYPHEN=lA.ofString("-"),At.MAX_ITERATIONS=100,ve._hx_skip_constructor=!1,Qe()})(globalThis); diff --git a/share/build.hxml b/share/build.hxml index b9803ba..0b1f786 100644 --- a/share/build.hxml +++ b/share/build.hxml @@ -2,7 +2,7 @@ --dce full --define analyzer-optimize --define js-es=6 ---define js-global=global +--define js-global=globalThis --define no-deprecation-warnings --library coconut.data --library hxnodejs