module.exports=(()=>{var__webpack_modules__={2932:(e,t,r)=>{constn=r(2186);consts=r(3117);(async()=>{try{awaits()}catch(e){n.setFailed(e.message)}})()},3117:(e,t,r)=>{constn=r(5747).promises;consts=r(2087);consto=r(5622);consti=r(2186);consta=r(7784);constc=r(7436);constl=r(467);constu=r(1383);functionfindLatest(e){i.debug("Parsing version list for latest version");lett="0.0.0";for(constrine.versions){if(u.prerelease(r)!==null){continue}t=u.gt(r,t)?r:t}i.info(`Latest version is ${t}`);returne.versions[t]}functionfindSpecific(e,t){i.debug(`Parsing version list for version ${t}`);returne.versions[t]}functionfindLatestMatchingSpecification(e,t){i.debug(`Parsing version list for latest matching specification ${t}`);constr=[];for(consttine.versions){r.push(t)}constn=u.maxSatisfying(r,t);if(!n){thrownewError(`Could not find Terraform version matching ${t} in version list`)}i.info(`Latest version satisfying ${t} is ${n}`);returne.versions[n]}asyncfunctiondownloadMetadata(){i.debug("Downloading version metadata");returnl("https://releases.hashicorp.com/terraform/index.json").then(e=>e.json()).catch(e=>{i.setFailed(`Failed to fetch version metadata. ${e}`)})}functionmapArch(e){constt={x32:"386",x64:"amd64"};returnt[e]||e}functionmapOS(e){constt={win32:"windows"};returnt[e]||e}functiongetBuild(e,t,r){i.debug(`Getting build for Terraform version ${e.version}, os ${t}, and arch ${r}`);constn=e.builds.length&&e.builds.find(e=>e.arch===mapArch(r)&&e.os===mapOS(t));if(!n){thrownewError(`Terraform version ${e.version} not available for ${t} and ${r}`)}returnn}asyncfunctiondownloadCLI(e){i.debug(`Downloading Terraform CLI from ${e}`);constt=awaita.downloadTool(e);i.debug("Extracting Terraform CLI zip file");constr=awaita.extractZip(t);i.debug(`Terraform CLI path is ${r}.`);if(!t||!r){thrownewError(`Unable to download Terraform from ${e}`)}returnr}asyncfunctioninstallWrapper(e){lett,n;consta=s.platform().startsWith("win")?".exe":"";try{t=[e,`terraform${a}`].join(o.sep);n=[e,`terraform-bin${a}`].join(o.sep);i.debug(`Moving ${t} to ${n}.`);awaitc.mv(t,n)}catch(e){i.error(`Unable to move ${t} to ${n}.`);throwe}try{t=r.ab+"index1.js";n=[e,"terraform"].join(o.sep);i.debug(`Copying ${t} to ${n}.`);awaitc.cp(r.ab+"index1.js",n)}catch(e){i.error(`Unable to copy ${t} to ${n}.`);throwe}i.exportVariable("TERRAFORM_CLI_PATH",e)}asyncfunctionaddCredentials(e,t,r){consts=`\ncredentials "${e}" {\n token = "${t}"\n}`.trim();leta=r==="win32"?`${process.env.APPDATA}/terraform.rc`:`${process.env.HOME}/.terraformrc`;a=process.env.TF_CLI_CONFIG_FILE?process.env.TF_CLI_CONFIG_FILE:a;constl=o.dirname(a);i.debug(`Creating ${l}`);awaitc.mkdirP(l);i.debug(`Adding credentials to ${a}`);awaitn.writeFile(a,s)}asyncfunctionrun(){try{conste=i.getInput("terraform_version");constt=i.getInput("cli_config_credentials_hostname");constr=i.getInput("cli_config_credentials_token");constn=i.getInput("terraform_wrapper")==="true";consto=s.platform();consta=s.arch();constc=awaitdownloadMetadata();constl=findSpecific(c,e);constu=e.toLowerCase()==="latest"?findLatest(c):l||findLatestMatchingSpecification(c,e);if(u){conste=getBuild(u,o,a);consts=awaitdownloadCLI(e.url);if(n){awaitinstallWrapper(s)}i.addPath(s);if(t&&r){awaitaddCredentials(t,r,o)}returnu}else{i.setFailed(`Could not find Terraform version ${e} in version list`)}}catch(e){i.error(e);throwe}}e.exports=run},7351:function(e,t,r){"use strict";varn=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(e!=null)for(varrine)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;returnt};Object.defineProperty(t,"__esModule",{value:true});consts=n(r(2087));consto=r(5278);functionissueCommand(e,t,r){constn=newCommand(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;functionissue(e,t=""){issueCommand(e,{},t)}t.issue=issue;consti="::";classCommand{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){lete=i+this.command;if(this