mirror of
https://github.com/docker/setup-qemu-action.git
synced 2024-12-22 17:45:38 +00:00
fa840ddb7d
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2 lines
106 KiB
JavaScript
Generated
2 lines
106 KiB
JavaScript
Generated
require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(r(2037));const u=r(5278);function issueCommand(e,t,r){const i=new Command(e,t,r);process.stdout.write(i.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const a="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=a+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const i=this.properties[r];if(i){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(i)}`}}}}e+=`${a}${escapeData(this.message)}`;return e}}function escapeData(e){return u.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return u.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const u=r(7351);const a=r(717);const l=r(5278);const c=o(r(2037));const f=o(r(1017));const d=r(8041);var h;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(h=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=l.toCommandValue(t);process.env[e]=r;const i=process.env["GITHUB_ENV"]||"";if(i){return a.issueFileCommand("ENV",a.prepareKeyValueMessage(e,t))}u.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){u.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){a.issueFileCommand("PATH",e)}else{u.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${f.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter((e=>e!==""));if(t&&t.trimWhitespace===false){return r}return r.map((e=>e.trim()))}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const i=["false","False","FALSE"];const n=getInput(e,t);if(r.includes(n))return true;if(i.includes(n))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return a.issueFileCommand("OUTPUT",a.prepareKeyValueMessage(e,t))}process.stdout.write(c.EOL);u.issueCommand("set-output",{name:e},l.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){u.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=h.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){u.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){u.issueCommand("error",l.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){u.issueCommand("warning",l.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){u.issueCommand("notice",l.toCommandProperties(t),e instanceof Error?e.toString():e)}t.notice=notice;function info(e){process.stdout.write(e+c.EOL)}t.info=info;function startGroup(e){u.issue("group",e)}t.startGroup=startGroup;function endGroup(){u.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return s(this,void 0,void 0,(function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r}))}t.group=group;function saveState(e,t){const r=process.env["GITHUB_STATE"]||"";if(r){return a.issueFileCommand("STATE",a.prepareKeyValueMessage(e,t))}u.issueCommand("save-state",{name:e},l.toCommandValue(t))}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState;function getIDToken(e){return s(this,void 0,void 0,(function*(){return yield d.OidcClient.getIDToken(e)}))}t.getIDToken=getIDToken;var p=r(1327);Object.defineProperty(t,"summary",{enumerable:true,get:function(){return p.summary}});var m=r(1327);Object.defineProperty(t,"markdownSummary",{enumerable:true,get:function(){return m.markdownSummary}});var _=r(2981);Object.defineProperty(t,"toPosixPath",{enumerable:true,get:function(){return _.toPosixPath}});Object.defineProperty(t,"toWin32Path",{enumerable:true,get:function(){return _.toWin32Path}});Object.defineProperty(t,"toPlatformPath",{enumerable:true,get:function(){return _.toPlatformPath}})},717:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.prepareKeyValueMessage=t.issueFileCommand=void 0;const s=o(r(7147));const u=o(r(2037));const a=r(5840);const l=r(5278);function issueFileCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}s.appendFileSync(r,`${l.toCommandValue(t)}${u.EOL}`,{encoding:"utf8"})}t.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,t){const r=`ghadelimiter_${a.v4()}`;const i=l.toCommandValue(t);if(e.includes(r)){throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`)}if(i.includes(r)){throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`)}return`${e}<<${r}${u.EOL}${i}${u.EOL}${r}`}t.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const n=r(6255);const o=r(5526);const s=r(2186);class OidcClient{static createHttpClient(e=true,t=10){const r={allowRetries:e,maxRetries:t};return new n.HttpClient("actions/oidc-client",[new o.BearerCredentialHandler(OidcClient.getRequestToken())],r)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){var t;return i(this,void 0,void 0,(function*(){const r=OidcClient.createHttpClient();const i=yield r.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.result.message}`)}));const n=(t=i.result)===null||t===void 0?void 0:t.value;if(!n){throw new Error("Response json body do not have ID Token field")}return n}))}static getIDToken(e){return i(this,void 0,void 0,(function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const r=encodeURIComponent(e);t=`${t}&audience=${r}`}s.debug(`ID token url is ${t}`);const r=yield OidcClient.getCall(t);s.setSecret(r);return r}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}t.OidcClient=OidcClient},2981:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.toPlatformPath=t.toWin32Path=t.toPosixPath=void 0;const s=o(r(1017));function toPosixPath(e){return e.replace(/[\\]/g,"/")}t.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}t.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,s.sep)}t.toPlatformPath=toPlatformPath},1327:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.summary=t.markdownSummary=t.SUMMARY_DOCS_URL=t.SUMMARY_ENV_VAR=void 0;const n=r(2037);const o=r(7147);const{access:s,appendFile:u,writeFile:a}=o.promises;t.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";t.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return i(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const e=process.env[t.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${t.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield s(e,o.constants.R_OK|o.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath}))}wrap(e,t,r={}){const i=Object.entries(r).map((([e,t])=>` ${e}="${t}"`)).join("");if(!t){return`<${e}${i}>`}return`<${e}${i}>${t}</${e}>`}write(e){return i(this,void 0,void 0,(function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const r=yield this.filePath();const i=t?a:u;yield i(r,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return i(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(n.EOL)}addCodeBlock(e,t){const r=Object.assign({},t&&{lang:t});const i=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(i).addEOL()}addList(e,t=false){const r=t?"ol":"ul";const i=e.map((e=>this.wrap("li",e))).join("");const n=this.wrap(r,i);return this.addRaw(n).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:r,colspan:i,rowspan:n}=e;const o=t?"th":"td";const s=Object.assign(Object.assign({},i&&{colspan:i}),n&&{rowspan:n});return this.wrap(o,r,s)})).join("");return this.wrap("tr",t)})).join("");const r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){const r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){const{width:i,height:n}=r||{};const o=Object.assign(Object.assign({},i&&{width:i}),n&&{height:n});const s=this.wrap("img",null,Object.assign({src:e,alt:t},o));return this.addRaw(s).addEOL()}addHeading(e,t){const r=`h${t}`;const i=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1";const n=this.wrap(i,e);return this.addRaw(n).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const r=Object.assign({},t&&{cite:t});const i=this.wrap("blockquote",e,r);return this.addRaw(i).addEOL()}addLink(e,t){const r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}}const l=new Summary;t.markdownSummary=l;t.summary=l},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toCommandProperties=t.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}t.toCommandValue=toCommandValue;function toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}t.toCommandProperties=toCommandProperties},1514:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getExecOutput=t.exec=void 0;const u=r(1576);const a=o(r(8159));function exec(e,t,r){return s(this,void 0,void 0,(function*(){const i=a.argStringToArray(e);if(i.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const n=i[0];t=i.slice(1).concat(t||[]);const o=new a.ToolRunner(n,t,r);return o.exec()}))}t.exec=exec;function getExecOutput(e,t,r){var i,n;return s(this,void 0,void 0,(function*(){let o="";let s="";const a=new u.StringDecoder("utf8");const l=new u.StringDecoder("utf8");const c=(i=r===null||r===void 0?void 0:r.listeners)===null||i===void 0?void 0:i.stdout;const f=(n=r===null||r===void 0?void 0:r.listeners)===null||n===void 0?void 0:n.stderr;const stdErrListener=e=>{s+=l.write(e);if(f){f(e)}};const stdOutListener=e=>{o+=a.write(e);if(c){c(e)}};const d=Object.assign(Object.assign({},r===null||r===void 0?void 0:r.listeners),{stdout:stdOutListener,stderr:stdErrListener});const h=yield exec(e,t,Object.assign(Object.assign({},r),{listeners:d}));o+=a.end();s+=l.end();return{exitCode:h,stdout:o,stderr:s}}))}t.getExecOutput=getExecOutput},8159:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.argStringToArray=t.ToolRunner=void 0;const u=o(r(2037));const a=o(r(2361));const l=o(r(2081));const c=o(r(1017));const f=o(r(9326));const d=o(r(277));const h=r(9512);const p=process.platform==="win32";class ToolRunner extends a.EventEmitter{constructor(e,t,r){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=r||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const r=this._getSpawnFileName();const i=this._getSpawnArgs(e);let n=t?"":"[command]";if(p){if(this._isCmdFile()){n+=r;for(const e of i){n+=` ${e}`}}else if(e.windowsVerbatimArguments){n+=`"${r}"`;for(const e of i){n+=` ${e}`}}else{n+=this._windowsQuoteCmdArg(r);for(const e of i){n+=` ${this._windowsQuoteCmdArg(e)}`}}}else{n+=r;for(const e of i){n+=` ${e}`}}return n}_processLineBuffer(e,t,r){try{let i=t+e.toString();let n=i.indexOf(u.EOL);while(n>-1){const e=i.substring(0,n);r(e);i=i.substring(n+u.EOL.length);n=i.indexOf(u.EOL)}return i}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(p){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(p){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const r of this.args){t+=" ";t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const 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'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let r=false;for(const i of e){if(t.some((e=>e===i))){r=true;break}}if(!r){return e}let i='"';let n=true;for(let t=e.length;t>0;t--){i+=e[t-1];if(n&&e[t-1]==="\\"){i+="\\"}else if(e[t-1]==='"'){n=true;i+='"'}else{n=false}}i+='"';return i.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let r=true;for(let i=e.length;i>0;i--){t+=e[i-1];if(r&&e[i-1]==="\\"){t+="\\"}else if(e[i-1]==='"'){r=true;t+="\\"}else{r=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const r={};r.cwd=e.cwd;r.env=e.env;r["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){r.argv0=`"${t}"`}return r}exec(){return s(this,void 0,void 0,(function*(){if(!d.isRooted(this.toolPath)&&(this.toolPath.includes("/")||p&&this.toolPath.includes("\\"))){this.toolPath=c.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield f.which(this.toolPath,true);return new Promise(((e,t)=>s(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const r=this._cloneExecOptions(this.options);if(!r.silent&&r.outStream){r.outStream.write(this._getCommandString(r)+u.EOL)}const i=new ExecState(r,this.toolPath);i.on("debug",(e=>{this._debug(e)}));if(this.options.cwd&&!(yield d.exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const n=this._getSpawnFileName();const o=l.spawn(n,this._getSpawnArgs(r),this._getSpawnOptions(this.options,n));let s="";if(o.stdout){o.stdout.on("data",(e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!r.silent&&r.outStream){r.outStream.write(e)}s=this._processLineBuffer(e,s,(e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}}))}))}let a="";if(o.stderr){o.stderr.on("data",(e=>{i.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!r.silent&&r.errStream&&r.outStream){const t=r.failOnStdErr?r.errStream:r.outStream;t.write(e)}a=this._processLineBuffer(e,a,(e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}}))}))}o.on("error",(e=>{i.processError=e.message;i.processExited=true;i.processClosed=true;i.CheckComplete()}));o.on("exit",(e=>{i.processExitCode=e;i.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);i.CheckComplete()}));o.on("close",(e=>{i.processExitCode=e;i.processExited=true;i.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);i.CheckComplete()}));i.on("done",((r,i)=>{if(s.length>0){this.emit("stdline",s)}if(a.length>0){this.emit("errline",a)}o.removeAllListeners();if(r){t(r)}else{e(i)}}));if(this.options.input){if(!o.stdin){throw new Error("child process missing stdin")}o.stdin.end(this.options.input)}}))))}))}}t.ToolRunner=ToolRunner;function argStringToArray(e){const t=[];let r=false;let i=false;let n="";function append(e){if(i&&e!=='"'){n+="\\"}n+=e;i=false}for(let o=0;o<e.length;o++){const s=e.charAt(o);if(s==='"'){if(!i){r=!r}else{append(s)}continue}if(s==="\\"&&i){append(s);continue}if(s==="\\"&&r){i=true;continue}if(s===" "&&!r){if(n.length>0){t.push(n);n=""}continue}append(s)}if(n.length>0){t.push(n.trim())}return t}t.argStringToArray=argStringToArray;class ExecState extends a.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=h.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(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}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const 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()}}},277:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};var n;Object.defineProperty(t,"__esModule",{value:true});const o=r(9491);const s=r(7147);const u=r(1017);n=s.promises,t.chmod=n.chmod,t.copyFile=n.copyFile,t.lstat=n.lstat,t.mkdir=n.mkdir,t.readdir=n.readdir,t.readlink=n.readlink,t.rename=n.rename,t.rmdir=n.rmdir,t.stat=n.stat,t.symlink=n.symlink,t.unlink=n.unlink;t.IS_WINDOWS=process.platform==="win32";function exists(e){return i(this,void 0,void 0,(function*(){try{yield t.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}t.exists=exists;function isDirectory(e,r=false){return i(this,void 0,void 0,(function*(){const i=r?yield t.stat(e):yield t.lstat(e);return i.isDirectory()}))}t.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(t.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}t.isRooted=isRooted;function mkdirP(e,r=1e3,n=1){return i(this,void 0,void 0,(function*(){o.ok(e,"a path argument must be provided");e=u.resolve(e);if(n>=r)return t.mkdir(e);try{yield t.mkdir(e);return}catch(i){switch(i.code){case"ENOENT":{yield mkdirP(u.dirname(e),r,n+1);yield t.mkdir(e);return}default:{let r;try{r=yield t.stat(e)}catch(e){throw i}if(!r.isDirectory())throw i}}}}))}t.mkdirP=mkdirP;function tryGetExecutablePath(e,r){return i(this,void 0,void 0,(function*(){let i=undefined;try{i=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(i&&i.isFile()){if(t.IS_WINDOWS){const t=u.extname(e).toUpperCase();if(r.some((e=>e.toUpperCase()===t))){return e}}else{if(isUnixExecutable(i)){return e}}}const n=e;for(const o of r){e=n+o;i=undefined;try{i=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(i&&i.isFile()){if(t.IS_WINDOWS){try{const r=u.dirname(e);const i=u.basename(e).toUpperCase();for(const n of yield t.readdir(r)){if(i===n.toUpperCase()){e=u.join(r,n);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(i)){return e}}}}return""}))}t.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(t.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}},9326:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});const n=r(2081);const o=r(1017);const s=r(3837);const u=r(277);const a=s.promisify(n.exec);function cp(e,t,r={}){return i(this,void 0,void 0,(function*(){const{force:i,recursive:n}=readCopyOptions(r);const s=(yield u.exists(t))?yield u.stat(t):null;if(s&&s.isFile()&&!i){return}const a=s&&s.isDirectory()?o.join(t,o.basename(e)):t;if(!(yield u.exists(e))){throw new Error(`no such file or directory: ${e}`)}const l=yield u.stat(e);if(l.isDirectory()){if(!n){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,a,0,i)}}else{if(o.relative(e,a)===""){throw new Error(`'${a}' and '${e}' are the same file`)}yield copyFile(e,a,i)}}))}t.cp=cp;function mv(e,t,r={}){return i(this,void 0,void 0,(function*(){if(yield u.exists(t)){let i=true;if(yield u.isDirectory(t)){t=o.join(t,o.basename(e));i=yield u.exists(t)}if(i){if(r.force==null||r.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(o.dirname(t));yield u.rename(e,t)}))}t.mv=mv;function rmRF(e){return i(this,void 0,void 0,(function*(){if(u.IS_WINDOWS){try{if(yield u.isDirectory(e,true)){yield a(`rd /s /q "${e}"`)}else{yield a(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield u.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield u.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield a(`rm -rf "${e}"`)}else{yield u.unlink(e)}}}))}t.rmRF=rmRF;function mkdirP(e){return i(this,void 0,void 0,(function*(){yield u.mkdirP(e)}))}t.mkdirP=mkdirP;function which(e,t){return i(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(u.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{const t=[];if(u.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(o.delimiter)){if(e){t.push(e)}}}if(u.isRooted(e)){const r=yield u.tryGetExecutablePath(e,t);if(r){return r}return""}if(e.includes("/")||u.IS_WINDOWS&&e.includes("\\")){return""}const r=[];if(process.env.PATH){for(const e of process.env.PATH.split(o.delimiter)){if(e){r.push(e)}}}for(const i of r){const r=yield u.tryGetExecutablePath(i+o.sep+e,t);if(r){return r}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}}))}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const r=Boolean(e.recursive);return{force:t,recursive:r}}function cpDirRecursive(e,t,r,n){return i(this,void 0,void 0,(function*(){if(r>=255)return;r++;yield mkdirP(t);const i=yield u.readdir(e);for(const o of i){const i=`${e}/${o}`;const s=`${t}/${o}`;const a=yield u.lstat(i);if(a.isDirectory()){yield cpDirRecursive(i,s,r,n)}else{yield copyFile(i,s,n)}}yield u.chmod(t,(yield u.stat(e)).mode)}))}function copyFile(e,t,r){return i(this,void 0,void 0,(function*(){if((yield u.lstat(e)).isSymbolicLink()){try{yield u.lstat(t);yield u.unlink(t)}catch(e){if(e.code==="EPERM"){yield u.chmod(t,"0666");yield u.unlink(t)}}const r=yield u.readlink(e);yield u.symlink(r,t,u.IS_WINDOWS?"junction":null)}else if(!(yield u.exists(t))||r){yield u.copyFile(e,t)}}))}},5526:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.PersonalAccessTokenCredentialHandler=t.BearerCredentialHandler=t.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return r(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.HttpClient=t.isHttps=t.HttpClientResponse=t.HttpClientError=t.getProxyUrl=t.MediaTypes=t.Headers=t.HttpCodes=void 0;const u=o(r(3685));const a=o(r(5687));const l=o(r(9835));const c=o(r(4294));var f;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(f=t.HttpCodes||(t.HttpCodes={}));var d;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(d=t.Headers||(t.Headers={}));var h;(function(e){e["ApplicationJson"]="application/json"})(h=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){const t=l.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const p=[f.MovedPermanently,f.ResourceMoved,f.SeeOther,f.TemporaryRedirect,f.PermanentRedirect];const m=[f.BadGateway,f.ServiceUnavailable,f.GatewayTimeout];const _=["OPTIONS","GET","DELETE","HEAD"];const g=10;const v=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}t.HttpClientError=HttpClientError;class HttpClientResponse{constructor(e){this.message=e}readBody(){return s(this,void 0,void 0,(function*(){return new Promise((e=>s(this,void 0,void 0,(function*(){let t=Buffer.alloc(0);this.message.on("data",(e=>{t=Buffer.concat([t,e])}));this.message.on("end",(()=>{e(t.toString())}))}))))}))}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){const t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=e;this.handlers=t||[];this.requestOptions=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return s(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,t||{})}))}get(e,t){return s(this,void 0,void 0,(function*(){return this.request("GET",e,null,t||{})}))}del(e,t){return s(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,t||{})}))}post(e,t,r){return s(this,void 0,void 0,(function*(){return this.request("POST",e,t,r||{})}))}patch(e,t,r){return s(this,void 0,void 0,(function*(){return this.request("PATCH",e,t,r||{})}))}put(e,t,r){return s(this,void 0,void 0,(function*(){return this.request("PUT",e,t,r||{})}))}head(e,t){return s(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,t||{})}))}sendStream(e,t,r,i){return s(this,void 0,void 0,(function*(){return this.request(e,t,r,i)}))}getJson(e,t={}){return s(this,void 0,void 0,(function*(){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,h.ApplicationJson);const r=yield this.get(e,t);return this._processResponse(r,this.requestOptions)}))}postJson(e,t,r={}){return s(this,void 0,void 0,(function*(){const i=JSON.stringify(t,null,2);r[d.Accept]=this._getExistingOrDefaultHeader(r,d.Accept,h.ApplicationJson);r[d.ContentType]=this._getExistingOrDefaultHeader(r,d.ContentType,h.ApplicationJson);const n=yield this.post(e,i,r);return this._processResponse(n,this.requestOptions)}))}putJson(e,t,r={}){return s(this,void 0,void 0,(function*(){const i=JSON.stringify(t,null,2);r[d.Accept]=this._getExistingOrDefaultHeader(r,d.Accept,h.ApplicationJson);r[d.ContentType]=this._getExistingOrDefaultHeader(r,d.ContentType,h.ApplicationJson);const n=yield this.put(e,i,r);return this._processResponse(n,this.requestOptions)}))}patchJson(e,t,r={}){return s(this,void 0,void 0,(function*(){const i=JSON.stringify(t,null,2);r[d.Accept]=this._getExistingOrDefaultHeader(r,d.Accept,h.ApplicationJson);r[d.ContentType]=this._getExistingOrDefaultHeader(r,d.ContentType,h.ApplicationJson);const n=yield this.patch(e,i,r);return this._processResponse(n,this.requestOptions)}))}request(e,t,r,i){return s(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const n=new URL(t);let o=this._prepareRequest(e,n,i);const s=this._allowRetries&&_.includes(e)?this._maxRetries+1:1;let u=0;let a;do{a=yield this.requestRaw(o,r);if(a&&a.message&&a.message.statusCode===f.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(a)){e=t;break}}if(e){return e.handleAuthentication(this,o,r)}else{return a}}let t=this._maxRedirects;while(a.message.statusCode&&p.includes(a.message.statusCode)&&this._allowRedirects&&t>0){const s=a.message.headers["location"];if(!s){break}const u=new URL(s);if(n.protocol==="https:"&&n.protocol!==u.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield a.readBody();if(u.hostname!==n.hostname){for(const e in i){if(e.toLowerCase()==="authorization"){delete i[e]}}}o=this._prepareRequest(e,u,i);a=yield this.requestRaw(o,r);t--}if(!a.message.statusCode||!m.includes(a.message.statusCode)){return a}u+=1;if(u<s){yield a.readBody();yield this._performExponentialBackoff(u)}}while(u<s);return a}))}dispose(){if(this._agent){this._agent.destroy()}this._disposed=true}requestRaw(e,t){return s(this,void 0,void 0,(function*(){return new Promise(((r,i)=>{function callbackForResult(e,t){if(e){i(e)}else if(!t){i(new Error("Unknown error"))}else{r(t)}}this.requestRawWithCallback(e,t,callbackForResult)}))}))}requestRawWithCallback(e,t,r){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let i=false;function handleResult(e,t){if(!i){i=true;r(e,t)}}const n=e.httpModule.request(e.options,(e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)}));let o;n.on("socket",(e=>{o=e}));n.setTimeout(this._socketTimeout||3*6e4,(()=>{if(o){o.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));n.on("error",(function(e){handleResult(e)}));if(t&&typeof t==="string"){n.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",(function(){n.end()}));t.pipe(n)}else{n.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const i={};i.parsedUrl=t;const n=i.parsedUrl.protocol==="https:";i.httpModule=n?a:u;const o=n?443:80;i.options={};i.options.host=i.parsedUrl.hostname;i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):o;i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||"");i.options.method=e;i.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){i.options.headers["user-agent"]=this.userAgent}i.options.agent=this._getAgent(i.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(i.options)}}return i}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,r){let i;if(this.requestOptions&&this.requestOptions.headers){i=lowercaseKeys(this.requestOptions.headers)[t]}return e[t]||i||r}_getAgent(e){let t;const r=l.getProxyUrl(e);const i=r&&r.hostname;if(this._keepAlive&&i){t=this._proxyAgent}if(this._keepAlive&&!i){t=this._agent}if(t){return t}const n=e.protocol==="https:";let o=100;if(this.requestOptions){o=this.requestOptions.maxSockets||u.globalAgent.maxSockets}if(r&&r.hostname){const e={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})};let i;const s=r.protocol==="https:";if(n){i=s?c.httpsOverHttps:c.httpsOverHttp}else{i=s?c.httpOverHttps:c.httpOverHttp}t=i(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:o};t=n?new a.Agent(e):new u.Agent(e);this._agent=t}if(!t){t=n?a.globalAgent:u.globalAgent}if(n&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){return s(this,void 0,void 0,(function*(){e=Math.min(g,e);const t=v*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),t)))}))}_processResponse(e,t){return s(this,void 0,void 0,(function*(){return new Promise(((r,i)=>s(this,void 0,void 0,(function*(){const n=e.message.statusCode||0;const o={statusCode:n,result:null,headers:{}};if(n===f.NotFound){r(o)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let s;let u;try{u=yield e.readBody();if(u&&u.length>0){if(t&&t.deserializeDates){s=JSON.parse(u,dateTimeDeserializer)}else{s=JSON.parse(u)}o.result=s}o.headers=e.message.headers}catch(e){}if(n>299){let e;if(s&&s.message){e=s.message}else if(u&&u.length>0){e=u}else{e=`Failed request: (${n})`}const t=new HttpClientError(e,n);t.result=o.result;i(t)}else{r(o)}}))))}))}}t.HttpClient=HttpClient;const lowercaseKeys=e=>Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{})},9835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkBypass=t.getProxyUrl=void 0;function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const r=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(r){return new URL(r)}else{return undefined}}t.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const t=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!t){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const i=[e.hostname.toUpperCase()];if(typeof r==="number"){i.push(`${i[0]}:${r}`)}for(const e of t.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(i.some((t=>t===e))){return true}}return false}t.checkBypass=checkBypass},1962:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};var u;Object.defineProperty(t,"__esModule",{value:true});t.getCmdPath=t.tryGetExecutablePath=t.isRooted=t.isDirectory=t.exists=t.IS_WINDOWS=t.unlink=t.symlink=t.stat=t.rmdir=t.rename=t.readlink=t.readdir=t.mkdir=t.lstat=t.copyFile=t.chmod=void 0;const a=o(r(7147));const l=o(r(1017));u=a.promises,t.chmod=u.chmod,t.copyFile=u.copyFile,t.lstat=u.lstat,t.mkdir=u.mkdir,t.readdir=u.readdir,t.readlink=u.readlink,t.rename=u.rename,t.rmdir=u.rmdir,t.stat=u.stat,t.symlink=u.symlink,t.unlink=u.unlink;t.IS_WINDOWS=process.platform==="win32";function exists(e){return s(this,void 0,void 0,(function*(){try{yield t.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}t.exists=exists;function isDirectory(e,r=false){return s(this,void 0,void 0,(function*(){const i=r?yield t.stat(e):yield t.lstat(e);return i.isDirectory()}))}t.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(t.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}t.isRooted=isRooted;function tryGetExecutablePath(e,r){return s(this,void 0,void 0,(function*(){let i=undefined;try{i=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(i&&i.isFile()){if(t.IS_WINDOWS){const t=l.extname(e).toUpperCase();if(r.some((e=>e.toUpperCase()===t))){return e}}else{if(isUnixExecutable(i)){return e}}}const n=e;for(const o of r){e=n+o;i=undefined;try{i=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(i&&i.isFile()){if(t.IS_WINDOWS){try{const r=l.dirname(e);const i=l.basename(e).toUpperCase();for(const n of yield t.readdir(r)){if(i===n.toUpperCase()){e=l.join(r,n);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(i)){return e}}}}return""}))}t.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(t.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}t.getCmdPath=getCmdPath},7436:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.findInPath=t.which=t.mkdirP=t.rmRF=t.mv=t.cp=void 0;const u=r(9491);const a=o(r(2081));const l=o(r(1017));const c=r(3837);const f=o(r(1962));const d=c.promisify(a.exec);const h=c.promisify(a.execFile);function cp(e,t,r={}){return s(this,void 0,void 0,(function*(){const{force:i,recursive:n,copySourceDirectory:o}=readCopyOptions(r);const s=(yield f.exists(t))?yield f.stat(t):null;if(s&&s.isFile()&&!i){return}const u=s&&s.isDirectory()&&o?l.join(t,l.basename(e)):t;if(!(yield f.exists(e))){throw new Error(`no such file or directory: ${e}`)}const a=yield f.stat(e);if(a.isDirectory()){if(!n){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,u,0,i)}}else{if(l.relative(e,u)===""){throw new Error(`'${u}' and '${e}' are the same file`)}yield copyFile(e,u,i)}}))}t.cp=cp;function mv(e,t,r={}){return s(this,void 0,void 0,(function*(){if(yield f.exists(t)){let i=true;if(yield f.isDirectory(t)){t=l.join(t,l.basename(e));i=yield f.exists(t)}if(i){if(r.force==null||r.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(l.dirname(t));yield f.rename(e,t)}))}t.mv=mv;function rmRF(e){return s(this,void 0,void 0,(function*(){if(f.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}try{const t=f.getCmdPath();if(yield f.isDirectory(e,true)){yield d(`${t} /s /c "rd /s /q "%inputPath%""`,{env:{inputPath:e}})}else{yield d(`${t} /s /c "del /f /a "%inputPath%""`,{env:{inputPath:e}})}}catch(e){if(e.code!=="ENOENT")throw e}try{yield f.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield f.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield h(`rm`,[`-rf`,`${e}`])}else{yield f.unlink(e)}}}))}t.rmRF=rmRF;function mkdirP(e){return s(this,void 0,void 0,(function*(){u.ok(e,"a path argument must be provided");yield f.mkdir(e,{recursive:true})}))}t.mkdirP=mkdirP;function which(e,t){return s(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(f.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const r=yield findInPath(e);if(r&&r.length>0){return r[0]}return""}))}t.which=which;function findInPath(e){return s(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(f.IS_WINDOWS&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(l.delimiter)){if(e){t.push(e)}}}if(f.isRooted(e)){const r=yield f.tryGetExecutablePath(e,t);if(r){return[r]}return[]}if(e.includes(l.sep)){return[]}const r=[];if(process.env.PATH){for(const e of process.env.PATH.split(l.delimiter)){if(e){r.push(e)}}}const i=[];for(const n of r){const r=yield f.tryGetExecutablePath(l.join(n,e),t);if(r){i.push(r)}}return i}))}t.findInPath=findInPath;function readCopyOptions(e){const t=e.force==null?true:e.force;const r=Boolean(e.recursive);const i=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:r,copySourceDirectory:i}}function cpDirRecursive(e,t,r,i){return s(this,void 0,void 0,(function*(){if(r>=255)return;r++;yield mkdirP(t);const n=yield f.readdir(e);for(const o of n){const n=`${e}/${o}`;const s=`${t}/${o}`;const u=yield f.lstat(n);if(u.isDirectory()){yield cpDirRecursive(n,s,r,i)}else{yield copyFile(n,s,i)}}yield f.chmod(t,(yield f.stat(e)).mode)}))}function copyFile(e,t,r){return s(this,void 0,void 0,(function*(){if((yield f.lstat(e)).isSymbolicLink()){try{yield f.lstat(t);yield f.unlink(t)}catch(e){if(e.code==="EPERM"){yield f.chmod(t,"0666");yield f.unlink(t)}}const r=yield f.readlink(e);yield f.symlink(r,t,f.IS_WINDOWS?"junction":null)}else if(!(yield f.exists(t))||r){yield f.copyFile(e,t)}}))}},1561:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};var u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Docker=void 0;const a=u(r(2037));const l=u(r(1017));const c=o(r(2186));const f=o(r(7436));const d=r(1949);class Docker{static get configDir(){return process.env.DOCKER_CONFIG||l.default.join(a.default.homedir(),".docker")}static isAvailable(){return s(this,void 0,void 0,(function*(){return yield f.which("docker",true).then((e=>{c.debug(`Docker.isAvailable ok: ${e}`);return true})).catch((e=>{c.debug(`Docker.isAvailable error: ${e}`);return false}))}))}static printVersion(){return s(this,void 0,void 0,(function*(){yield d.Exec.exec("docker",["version"])}))}static printInfo(){return s(this,void 0,void 0,(function*(){yield d.Exec.exec("docker",["info"])}))}}t.Docker=Docker},1949:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.Exec=void 0;const u=o(r(2186));const a=o(r(1514));class Exec{static exec(e,t,r){return s(this,void 0,void 0,(function*(){u.debug(`Exec.exec: ${e} ${t===null||t===void 0?void 0:t.join(" ")}`);return a.exec(e,t,r)}))}static getExecOutput(e,t,r){return s(this,void 0,void 0,(function*(){u.debug(`Exec.getExecOutput: ${e} ${t===null||t===void 0?void 0:t.join(" ")}`);return a.getExecOutput(e,t,r)}))}}t.Exec=Exec},6618:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.run=void 0;const u=o(r(2186));const a=!!process.env["STATE_isPost"];if(!a){u.saveState("isPost","true")}function run(e,t){return s(this,void 0,void 0,(function*(){if(!a){try{yield e()}catch(e){u.setFailed(e.message)}}else if(t){yield t()}}))}t.run=run},8662:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.Util=void 0;const u=o(r(2186));const a=r(4393);class Util{static getInputList(e,t){const r=[];const i=u.getInput(e);if(i==""){return r}const n=(0,a.parse)(i,{columns:false,relaxQuotes:true,comment:"#",relaxColumnCount:true,skipEmptyLines:true,quote:t===null||t===void 0?void 0:t.quote});for(const e of n){if(e.length==1){if(t===null||t===void 0?void 0:t.ignoreComma){r.push(e[0])}else{r.push(...e[0].split(","))}}else if(!(t===null||t===void 0?void 0:t.ignoreComma)){r.push(...e)}else{r.push(e.join(","))}}return r.filter((e=>e)).map((e=>e.trim()))}static asyncForEach(e,t){return s(this,void 0,void 0,(function*(){for(let r=0;r<e.length;r++){yield t(e[r],r,e)}}))}static isValidUrl(e){try{new URL(e)}catch(e){return false}return true}}t.Util=Util},4294:(e,t,r)=>{e.exports=r(4219)},4219:(e,t,r)=>{"use strict";var i=r(1808);var n=r(4404);var o=r(3685);var s=r(5687);var u=r(2361);var a=r(9491);var l=r(3837);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=o.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=o.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||o.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",(function onFree(e,r,i,n){var o=toOptions(r,i,n);for(var s=0,u=t.requests.length;s<u;++s){var a=t.requests[s];if(a.host===o.host&&a.port===o.port){t.requests.splice(s,1);a.request.onSocket(e);return}}e.destroy();t.removeSocket(e)}))}l.inherits(TunnelingAgent,u.EventEmitter);TunnelingAgent.prototype.addRequest=function addRequest(e,t,r,i){var n=this;var o=mergeOptions({request:e},n.options,toOptions(t,r,i));if(n.sockets.length>=this.maxSockets){n.requests.push(o);return}n.createSocket(o,(function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){n.emit("free",t,o)}function onCloseOrRemove(e){n.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var r=this;var i={};r.sockets.push(i);var n=mergeOptions({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){n.localAddress=e.localAddress}if(n.proxyAuth){n.headers=n.headers||{};n.headers["Proxy-Authorization"]="Basic "+new Buffer(n.proxyAuth).toString("base64")}c("making CONNECT request");var o=r.request(n);o.useChunkedEncodingByDefault=false;o.once("response",onResponse);o.once("upgrade",onUpgrade);o.once("connect",onConnect);o.once("error",onError);o.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,r){process.nextTick((function(){onConnect(e,t,r)}))}function onConnect(n,s,u){o.removeAllListeners();s.removeAllListeners();if(n.statusCode!==200){c("tunneling socket could not be established, statusCode=%d",n.statusCode);s.destroy();var a=new Error("tunneling socket could not be established, "+"statusCode="+n.statusCode);a.code="ECONNRESET";e.request.emit("error",a);r.removeSocket(i);return}if(u.length>0){c("got illegal response body from proxy");s.destroy();var a=new Error("got illegal response body from proxy");a.code="ECONNRESET";e.request.emit("error",a);r.removeSocket(i);return}c("tunneling connection has established");r.sockets[r.sockets.indexOf(i)]=s;return t(s)}function onError(t){o.removeAllListeners();c("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var n=new Error("tunneling socket could not be established, "+"cause="+t.message);n.code="ECONNRESET";e.request.emit("error",n);r.removeSocket(i)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,(function(e){r.request.onSocket(e)}))}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,(function(i){var o=e.request.getHeader("host");var s=mergeOptions({},r.options,{socket:i,servername:o?o.replace(/:.*$/,""):e.host});var u=n.connect(0,s);r.sockets[r.sockets.indexOf(i)]=u;t(u)}))}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;t<r;++t){var i=arguments[t];if(typeof i==="object"){var n=Object.keys(i);for(var o=0,s=n.length;o<s;++o){var u=n[o];if(i[u]!==undefined){e[u]=i[u]}}}}return e}var c;if(process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)){c=function(){var e=Array.prototype.slice.call(arguments);if(typeof e[0]==="string"){e[0]="TUNNEL: "+e[0]}else{e.unshift("TUNNEL:")}console.error.apply(console,e)}}else{c=function(){}}t.debug=c},5840:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"v1",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"v3",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"v4",{enumerable:true,get:function(){return o.default}});Object.defineProperty(t,"v5",{enumerable:true,get:function(){return s.default}});Object.defineProperty(t,"NIL",{enumerable:true,get:function(){return u.default}});Object.defineProperty(t,"version",{enumerable:true,get:function(){return a.default}});Object.defineProperty(t,"validate",{enumerable:true,get:function(){return l.default}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return c.default}});Object.defineProperty(t,"parse",{enumerable:true,get:function(){return f.default}});var i=_interopRequireDefault(r(8628));var n=_interopRequireDefault(r(6409));var o=_interopRequireDefault(r(5122));var s=_interopRequireDefault(r(9120));var u=_interopRequireDefault(r(5332));var a=_interopRequireDefault(r(1595));var l=_interopRequireDefault(r(6900));var c=_interopRequireDefault(r(8950));var f=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return i.default.createHash("md5").update(e).digest()}var n=md5;t["default"]=n},5332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r="00000000-0000-0000-0000-000000000000";t["default"]=r},2746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e){if(!(0,i.default)(e)){throw TypeError("Invalid UUID")}let t;const r=new Uint8Array(16);r[0]=(t=parseInt(e.slice(0,8),16))>>>24;r[1]=t>>>16&255;r[2]=t>>>8&255;r[3]=t&255;r[4]=(t=parseInt(e.slice(9,13),16))>>>8;r[5]=t&255;r[6]=(t=parseInt(e.slice(14,18),16))>>>8;r[7]=t&255;r[8]=(t=parseInt(e.slice(19,23),16))>>>8;r[9]=t&255;r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255;r[11]=t/4294967296&255;r[12]=t>>>24&255;r[13]=t>>>16&255;r[14]=t>>>8&255;r[15]=t&255;return r}var n=parse;t["default"]=n},814:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t["default"]=r},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rng;var i=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const n=new Uint8Array(256);let o=n.length;function rng(){if(o>n.length-16){i.default.randomFillSync(n);o=0}return n.slice(o,o+=16)}},5274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return i.default.createHash("sha1").update(e).digest()}var n=sha1;t["default"]=n},8950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const n=[];for(let e=0;e<256;++e){n.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const r=(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+"-"+n[e[t+4]]+n[e[t+5]]+"-"+n[e[t+6]]+n[e[t+7]]+"-"+n[e[t+8]]+n[e[t+9]]+"-"+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase();if(!(0,i.default)(r)){throw TypeError("Stringified UUID is invalid")}return r}var o=stringify;t["default"]=o},8628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(807));var n=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let o;let s;let u=0;let a=0;function v1(e,t,r){let l=t&&r||0;const c=t||new Array(16);e=e||{};let f=e.node||o;let d=e.clockseq!==undefined?e.clockseq:s;if(f==null||d==null){const t=e.random||(e.rng||i.default)();if(f==null){f=o=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(d==null){d=s=(t[6]<<8|t[7])&16383}}let h=e.msecs!==undefined?e.msecs:Date.now();let p=e.nsecs!==undefined?e.nsecs:a+1;const m=h-u+(p-a)/1e4;if(m<0&&e.clockseq===undefined){d=d+1&16383}if((m<0||h>u)&&e.nsecs===undefined){p=0}if(p>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}u=h;a=p;s=d;h+=122192928e5;const _=((h&268435455)*1e4+p)%4294967296;c[l++]=_>>>24&255;c[l++]=_>>>16&255;c[l++]=_>>>8&255;c[l++]=_&255;const g=h/4294967296*1e4&268435455;c[l++]=g>>>8&255;c[l++]=g&255;c[l++]=g>>>24&15|16;c[l++]=g>>>16&255;c[l++]=d>>>8|128;c[l++]=d&255;for(let e=0;e<6;++e){c[l+e]=f[e]}return t||(0,n.default)(c)}var l=v1;t["default"]=l},6409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(5998));var n=_interopRequireDefault(r(4569));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const o=(0,i.default)("v3",48,n.default);var s=o;t["default"]=s},5998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=_default;t.URL=t.DNS=void 0;var i=_interopRequireDefault(r(8950));var n=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r){t.push(e.charCodeAt(r))}return t}const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=o;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s;function _default(e,t,r){function generateUUID(e,o,s,u){if(typeof e==="string"){e=stringToBytes(e)}if(typeof o==="string"){o=(0,n.default)(o)}if(o.length!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let a=new Uint8Array(16+e.length);a.set(o);a.set(e,o.length);a=r(a);a[6]=a[6]&15|t;a[8]=a[8]&63|128;if(s){u=u||0;for(let e=0;e<16;++e){s[u+e]=a[e]}return s}return(0,i.default)(a)}try{generateUUID.name=e}catch(e){}generateUUID.DNS=o;generateUUID.URL=s;return generateUUID}},5122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(807));var n=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function v4(e,t,r){e=e||{};const o=e.random||(e.rng||i.default)();o[6]=o[6]&15|64;o[8]=o[8]&63|128;if(t){r=r||0;for(let e=0;e<16;++e){t[r+e]=o[e]}return t}return(0,n.default)(o)}var o=v4;t["default"]=o},9120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(5998));var n=_interopRequireDefault(r(5274));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const o=(0,i.default)("v5",80,n.default);var s=o;t["default"]=s},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(814));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validate(e){return typeof e==="string"&&i.default.test(e)}var n=validate;t["default"]=n},1595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var i=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function version(e){if(!(0,i.default)(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}var n=version;t["default"]=n},8954:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=void 0;const s=o(r(2186));const u=r(8662);function getInputs(){return{image:s.getInput("image")||"tonistiigi/binfmt:latest",platforms:u.Util.getInputList("platforms").join(",")||"all"}}t.getInputs=getInputs},399:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});const u=o(r(8954));const a=o(r(2186));const l=o(r(6618));const c=r(1561);const f=r(1949);l.run((()=>s(void 0,void 0,void 0,(function*(){const e=u.getInputs();yield a.group(`Docker info`,(()=>s(void 0,void 0,void 0,(function*(){yield c.Docker.printVersion();yield c.Docker.printInfo()}))));yield a.group(`Pulling binfmt Docker image`,(()=>s(void 0,void 0,void 0,(function*(){yield f.Exec.exec("docker",["pull",e.image])}))));yield a.group(`Image info`,(()=>s(void 0,void 0,void 0,(function*(){yield f.Exec.exec("docker",["image","inspect",e.image])}))));yield a.group(`Installing QEMU static binaries`,(()=>s(void 0,void 0,void 0,(function*(){yield f.Exec.exec("docker",["run","--rm","--privileged",e.image,"--install",e.platforms])}))));yield a.group(`Extracting available platforms`,(()=>s(void 0,void 0,void 0,(function*(){yield f.Exec.getExecOutput("docker",["run","--rm","--privileged",e.image],{ignoreReturnCode:true,silent:true}).then((e=>{if(e.stderr.length>0&&e.exitCode!=0){throw new Error(e.stderr.trim())}const t=JSON.parse(e.stdout.trim());a.info(`${t.supported.join(",")}`);a.setOutput("platforms",t.supported.join(","))}))}))))}))))},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},3837:e=>{"use strict";e.exports=require("util")},4393:(e,t)=>{"use strict";class CsvError extends Error{constructor(e,t,r,...i){if(Array.isArray(t))t=t.join(" ").trim();super(t);if(Error.captureStackTrace!==undefined){Error.captureStackTrace(this,CsvError)}this.code=e;for(const e of i){for(const t in e){const i=e[t];this[t]=Buffer.isBuffer(i)?i.toString(r.encoding):i==null?i:JSON.parse(JSON.stringify(i))}}}}const is_object=function(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)};const normalize_columns_array=function(e){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];if(i===undefined||i===null||i===false){t[r]={disabled:true}}else if(typeof i==="string"){t[r]={name:i}}else if(is_object(i)){if(typeof i.name!=="string"){throw new CsvError("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"])}t[r]=i}else{throw new CsvError("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(i)} at position ${r}`])}}return t};class ResizeableBuffer{constructor(e=100){this.size=e;this.length=0;this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){const t=this.length+e.length;if(t>=this.size){this.resize();if(t>=this.size){throw Error("INVALID_BUFFER_STATE")}}const r=this.buf;this.buf=Buffer.allocUnsafe(this.size);e.copy(this.buf,0);r.copy(this.buf,e.length);this.length+=e.length}else{const t=this.length++;if(t===this.size){this.resize()}const r=this.clone();this.buf[0]=e;r.copy(this.buf,1,0,t)}}append(e){const t=this.length++;if(t===this.size){this.resize()}this.buf[t]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=this.size*2;const t=Buffer.allocUnsafe(this.size);this.buf.copy(t,0,0,e);this.buf=t}toString(e){if(e){return this.buf.slice(0,this.length).toString(e)}else{return Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}}toJSON(){return this.toString("utf8")}reset(){this.length=0}}const r=12;const i=13;const n=10;const o=32;const s=9;const init_state=function(e){return{bomSkipped:false,bufBytesStart:0,castField:e.cast_function,commenting:false,error:undefined,enabled:e.from_line===1,escaping:false,escapeIsQuote:Buffer.isBuffer(e.escape)&&Buffer.isBuffer(e.quote)&&Buffer.compare(e.escape,e.quote)===0,expectedRecordLength:Array.isArray(e.columns)?e.columns.length:undefined,field:new ResizeableBuffer(20),firstLineToHeaders:e.cast_first_line_to_header,needMoreDataSize:Math.max(e.comment!==null?e.comment.length:0,...e.delimiter.map((e=>e.length)),e.quote!==null?e.quote.length:0),previousBuf:undefined,quoting:false,stop:false,rawBuffer:new ResizeableBuffer(100),record:[],recordHasError:false,record_length:0,recordDelimiterMaxLength:e.record_delimiter.length===0?0:Math.max(...e.record_delimiter.map((e=>e.length))),trimChars:[Buffer.from(" ",e.encoding)[0],Buffer.from("\t",e.encoding)[0]],wasQuoting:false,wasRowDelimiter:false,timchars:[Buffer.from(Buffer.from([i],"utf8").toString(),e.encoding),Buffer.from(Buffer.from([n],"utf8").toString(),e.encoding),Buffer.from(Buffer.from([r],"utf8").toString(),e.encoding),Buffer.from(Buffer.from([o],"utf8").toString(),e.encoding),Buffer.from(Buffer.from([s],"utf8").toString(),e.encoding)]}};const underscore=function(e){return e.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()}))};const normalize_options=function(e){const t={};for(const r in e){t[underscore(r)]=e[r]}if(t.encoding===undefined||t.encoding===true){t.encoding="utf8"}else if(t.encoding===null||t.encoding===false){t.encoding=null}else if(typeof t.encoding!=="string"&&t.encoding!==null){throw new CsvError("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(t.encoding)}`],t)}if(t.bom===undefined||t.bom===null||t.bom===false){t.bom=false}else if(t.bom!==true){throw new CsvError("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(t.bom)}`],t)}t.cast_function=null;if(t.cast===undefined||t.cast===null||t.cast===false||t.cast===""){t.cast=undefined}else if(typeof t.cast==="function"){t.cast_function=t.cast;t.cast=true}else if(t.cast!==true){throw new CsvError("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(t.cast)}`],t)}if(t.cast_date===undefined||t.cast_date===null||t.cast_date===false||t.cast_date===""){t.cast_date=false}else if(t.cast_date===true){t.cast_date=function(e){const t=Date.parse(e);return!isNaN(t)?new Date(t):e}}else if(typeof t.cast_date!=="function"){throw new CsvError("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(t.cast_date)}`],t)}t.cast_first_line_to_header=null;if(t.columns===true){t.cast_first_line_to_header=undefined}else if(typeof t.columns==="function"){t.cast_first_line_to_header=t.columns;t.columns=true}else if(Array.isArray(t.columns)){t.columns=normalize_columns_array(t.columns)}else if(t.columns===undefined||t.columns===null||t.columns===false){t.columns=false}else{throw new CsvError("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(t.columns)}`],t)}if(t.group_columns_by_name===undefined||t.group_columns_by_name===null||t.group_columns_by_name===false){t.group_columns_by_name=false}else if(t.group_columns_by_name!==true){throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(t.group_columns_by_name)}`],t)}else if(t.columns===false){throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],t)}if(t.comment===undefined||t.comment===null||t.comment===false||t.comment===""){t.comment=null}else{if(typeof t.comment==="string"){t.comment=Buffer.from(t.comment,t.encoding)}if(!Buffer.isBuffer(t.comment)){throw new CsvError("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(t.comment)}`],t)}}const r=JSON.stringify(t.delimiter);if(!Array.isArray(t.delimiter))t.delimiter=[t.delimiter];if(t.delimiter.length===0){throw new CsvError("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${r}`],t)}t.delimiter=t.delimiter.map((function(e){if(e===undefined||e===null||e===false){return Buffer.from(",",t.encoding)}if(typeof e==="string"){e=Buffer.from(e,t.encoding)}if(!Buffer.isBuffer(e)||e.length===0){throw new CsvError("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${r}`],t)}return e}));if(t.escape===undefined||t.escape===true){t.escape=Buffer.from('"',t.encoding)}else if(typeof t.escape==="string"){t.escape=Buffer.from(t.escape,t.encoding)}else if(t.escape===null||t.escape===false){t.escape=null}if(t.escape!==null){if(!Buffer.isBuffer(t.escape)){throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(t.escape)}`)}}if(t.from===undefined||t.from===null){t.from=1}else{if(typeof t.from==="string"&&/\d+/.test(t.from)){t.from=parseInt(t.from)}if(Number.isInteger(t.from)){if(t.from<0){throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(e.from)}`)}}else{throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(t.from)}`)}}if(t.from_line===undefined||t.from_line===null){t.from_line=1}else{if(typeof t.from_line==="string"&&/\d+/.test(t.from_line)){t.from_line=parseInt(t.from_line)}if(Number.isInteger(t.from_line)){if(t.from_line<=0){throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(e.from_line)}`)}}else{throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(e.from_line)}`)}}if(t.ignore_last_delimiters===undefined||t.ignore_last_delimiters===null){t.ignore_last_delimiters=false}else if(typeof t.ignore_last_delimiters==="number"){t.ignore_last_delimiters=Math.floor(t.ignore_last_delimiters);if(t.ignore_last_delimiters===0){t.ignore_last_delimiters=false}}else if(typeof t.ignore_last_delimiters!=="boolean"){throw new CsvError("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(t.ignore_last_delimiters)}`],t)}if(t.ignore_last_delimiters===true&&t.columns===false){throw new CsvError("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],t)}if(t.info===undefined||t.info===null||t.info===false){t.info=false}else if(t.info!==true){throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(t.info)}`)}if(t.max_record_size===undefined||t.max_record_size===null||t.max_record_size===false){t.max_record_size=0}else if(Number.isInteger(t.max_record_size)&&t.max_record_size>=0);else if(typeof t.max_record_size==="string"&&/\d+/.test(t.max_record_size)){t.max_record_size=parseInt(t.max_record_size)}else{throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(t.max_record_size)}`)}if(t.objname===undefined||t.objname===null||t.objname===false){t.objname=undefined}else if(Buffer.isBuffer(t.objname)){if(t.objname.length===0){throw new Error(`Invalid Option: objname must be a non empty buffer`)}if(t.encoding===null);else{t.objname=t.objname.toString(t.encoding)}}else if(typeof t.objname==="string"){if(t.objname.length===0){throw new Error(`Invalid Option: objname must be a non empty string`)}}else if(typeof t.objname==="number");else{throw new Error(`Invalid Option: objname must be a string or a buffer, got ${t.objname}`)}if(t.objname!==undefined){if(typeof t.objname==="number"){if(t.columns!==false){throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}}else{if(t.columns===false){throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}}}if(t.on_record===undefined||t.on_record===null){t.on_record=undefined}else if(typeof t.on_record!=="function"){throw new CsvError("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(t.on_record)}`],t)}if(t.quote===null||t.quote===false||t.quote===""){t.quote=null}else{if(t.quote===undefined||t.quote===true){t.quote=Buffer.from('"',t.encoding)}else if(typeof t.quote==="string"){t.quote=Buffer.from(t.quote,t.encoding)}if(!Buffer.isBuffer(t.quote)){throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(t.quote)}`)}}if(t.raw===undefined||t.raw===null||t.raw===false){t.raw=false}else if(t.raw!==true){throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(t.raw)}`)}if(t.record_delimiter===undefined){t.record_delimiter=[]}else if(typeof t.record_delimiter==="string"||Buffer.isBuffer(t.record_delimiter)){if(t.record_delimiter.length===0){throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t)}t.record_delimiter=[t.record_delimiter]}else if(!Array.isArray(t.record_delimiter)){throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(t.record_delimiter)}`],t)}t.record_delimiter=t.record_delimiter.map((function(e,r){if(typeof e!=="string"&&!Buffer.isBuffer(e)){throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${r},`,`got ${JSON.stringify(e)}`],t)}else if(e.length===0){throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${r},`,`got ${JSON.stringify(e)}`],t)}if(typeof e==="string"){e=Buffer.from(e,t.encoding)}return e}));if(typeof t.relax_column_count==="boolean");else if(t.relax_column_count===undefined||t.relax_column_count===null){t.relax_column_count=false}else{throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(t.relax_column_count)}`)}if(typeof t.relax_column_count_less==="boolean");else if(t.relax_column_count_less===undefined||t.relax_column_count_less===null){t.relax_column_count_less=false}else{throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(t.relax_column_count_less)}`)}if(typeof t.relax_column_count_more==="boolean");else if(t.relax_column_count_more===undefined||t.relax_column_count_more===null){t.relax_column_count_more=false}else{throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(t.relax_column_count_more)}`)}if(typeof t.relax_quotes==="boolean");else if(t.relax_quotes===undefined||t.relax_quotes===null){t.relax_quotes=false}else{throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(t.relax_quotes)}`)}if(typeof t.skip_empty_lines==="boolean");else if(t.skip_empty_lines===undefined||t.skip_empty_lines===null){t.skip_empty_lines=false}else{throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(t.skip_empty_lines)}`)}if(typeof t.skip_records_with_empty_values==="boolean");else if(t.skip_records_with_empty_values===undefined||t.skip_records_with_empty_values===null){t.skip_records_with_empty_values=false}else{throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(t.skip_records_with_empty_values)}`)}if(typeof t.skip_records_with_error==="boolean");else if(t.skip_records_with_error===undefined||t.skip_records_with_error===null){t.skip_records_with_error=false}else{throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(t.skip_records_with_error)}`)}if(t.rtrim===undefined||t.rtrim===null||t.rtrim===false){t.rtrim=false}else if(t.rtrim!==true){throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(t.rtrim)}`)}if(t.ltrim===undefined||t.ltrim===null||t.ltrim===false){t.ltrim=false}else if(t.ltrim!==true){throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(t.ltrim)}`)}if(t.trim===undefined||t.trim===null||t.trim===false){t.trim=false}else if(t.trim!==true){throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(t.trim)}`)}if(t.trim===true&&e.ltrim!==false){t.ltrim=true}else if(t.ltrim!==true){t.ltrim=false}if(t.trim===true&&e.rtrim!==false){t.rtrim=true}else if(t.rtrim!==true){t.rtrim=false}if(t.to===undefined||t.to===null){t.to=-1}else{if(typeof t.to==="string"&&/\d+/.test(t.to)){t.to=parseInt(t.to)}if(Number.isInteger(t.to)){if(t.to<=0){throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(e.to)}`)}}else{throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(e.to)}`)}}if(t.to_line===undefined||t.to_line===null){t.to_line=-1}else{if(typeof t.to_line==="string"&&/\d+/.test(t.to_line)){t.to_line=parseInt(t.to_line)}if(Number.isInteger(t.to_line)){if(t.to_line<=0){throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(e.to_line)}`)}}else{throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(e.to_line)}`)}}return t};const isRecordEmpty=function(e){return e.every((e=>e==null||e.toString&&e.toString().trim()===""))};const u=13;const a=10;const l={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])};const transform=function(e={}){const t={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0};const r=normalize_options(e);return{info:t,original_options:e,options:r,state:init_state(r),__needMoreData:function(e,t,r){if(r)return false;const{encoding:i,escape:n,quote:o}=this.options;const{quoting:s,needMoreDataSize:u,recordDelimiterMaxLength:a}=this.state;const l=t-e-1;const c=Math.max(u,a===0?Buffer.from("\r\n",i).length:a,s?(n===null?0:n.length)+o.length:0,s?o.length+a:0);return l<c},parse:function(e,t,r,i){const{bom:n,encoding:o,from_line:s,ltrim:c,max_record_size:f,raw:d,relax_quotes:h,rtrim:p,skip_empty_lines:m,to:_,to_line:g}=this.options;let{comment:v,escape:y,quote:w,record_delimiter:b}=this.options;const{bomSkipped:O,previousBuf:E,rawBuffer:S,escapeIsQuote:x}=this.state;let P;if(E===undefined){if(e===undefined){i();return}else{P=e}}else if(E!==undefined&&e===undefined){P=E}else{P=Buffer.concat([E,e])}if(O===false){if(n===false){this.state.bomSkipped=true}else if(P.length<3){if(t===false){this.state.previousBuf=P;return}}else{for(const e in l){if(l[e].compare(P,0,l[e].length)===0){const t=l[e].length;this.state.bufBytesStart+=t;P=P.slice(t);this.options=normalize_options({...this.original_options,encoding:e});({comment:v,escape:y,quote:w}=this.options);break}}this.state.bomSkipped=true}}const C=P.length;let R;for(R=0;R<C;R++){if(this.__needMoreData(R,C,t)){break}if(this.state.wasRowDelimiter===true){this.info.lines++;this.state.wasRowDelimiter=false}if(g!==-1&&this.info.lines>g){this.state.stop=true;i();return}if(this.state.quoting===false&&b.length===0){const e=this.__autoDiscoverRecordDelimiter(P,R);if(e){b=this.options.record_delimiter}}const e=P[R];if(d===true){S.append(e)}if((e===u||e===a)&&this.state.wasRowDelimiter===false){this.state.wasRowDelimiter=true}if(this.state.escaping===true){this.state.escaping=false}else{if(y!==null&&this.state.quoting===true&&this.__isEscape(P,R,e)&&R+y.length<C){if(x){if(this.__isQuote(P,R+y.length)){this.state.escaping=true;R+=y.length-1;continue}}else{this.state.escaping=true;R+=y.length-1;continue}}if(this.state.commenting===false&&this.__isQuote(P,R)){if(this.state.quoting===true){const t=P[R+w.length];const r=p&&this.__isCharTrimable(P,R+w.length);const i=v!==null&&this.__compareBytes(v,P,R+w.length,t);const n=this.__isDelimiter(P,R+w.length,t);const o=b.length===0?this.__autoDiscoverRecordDelimiter(P,R+w.length):this.__isRecordDelimiter(t,P,R+w.length);if(y!==null&&this.__isEscape(P,R,e)&&this.__isQuote(P,R+y.length)){R+=y.length-1}else if(!t||n||o||i||r){this.state.quoting=false;this.state.wasQuoting=true;R+=w.length-1;continue}else if(h===false){const e=this.__error(new CsvError("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(t)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(e!==undefined)return e}else{this.state.quoting=false;this.state.wasQuoting=true;this.state.field.prepend(w);R+=w.length-1}}else{if(this.state.field.length!==0){if(h===false){const e=this.__infoField();const t=Object.keys(l).map((e=>l[e].equals(this.state.field.toString())?e:false)).filter(Boolean)[0];const r=this.__error(new CsvError("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(e.column)} at line ${e.lines}, value is ${JSON.stringify(this.state.field.toString(o))}`,t?`(${t} bom)`:undefined],this.options,e,{field:this.state.field}));if(r!==undefined)return r}}else{this.state.quoting=true;R+=w.length-1;continue}}}if(this.state.quoting===false){const t=this.__isRecordDelimiter(e,P,R);if(t!==0){const e=this.state.commenting&&(this.state.wasQuoting===false&&this.state.record.length===0&&this.state.field.length===0);if(e){this.info.comment_lines++}else{if(this.state.enabled===false&&this.info.lines+(this.state.wasRowDelimiter===true?1:0)>=s){this.state.enabled=true;this.__resetField();this.__resetRecord();R+=t-1;continue}if(m===true&&this.state.wasQuoting===false&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++;R+=t-1;continue}this.info.bytes=this.state.bufBytesStart+R;const e=this.__onField();if(e!==undefined)return e;this.info.bytes=this.state.bufBytesStart+R+t;const n=this.__onRecord(r);if(n!==undefined)return n;if(_!==-1&&this.info.records>=_){this.state.stop=true;i();return}}this.state.commenting=false;R+=t-1;continue}if(this.state.commenting){continue}const n=v===null?0:this.__compareBytes(v,P,R,e);if(n!==0){this.state.commenting=true;continue}const o=this.__isDelimiter(P,R,e);if(o!==0){this.info.bytes=this.state.bufBytesStart+R;const e=this.__onField();if(e!==undefined)return e;R+=o-1;continue}}}if(this.state.commenting===false){if(f!==0&&this.state.record_length+this.state.field.length>f){return this.__error(new CsvError("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${f}`,`at line ${this.info.lines}`],this.options,this.__infoField()))}}const n=c===false||this.state.quoting===true||this.state.field.length!==0||!this.__isCharTrimable(P,R);const O=p===false||this.state.wasQuoting===false;if(n===true&&O===true){this.state.field.append(e)}else if(p===true&&!this.__isCharTrimable(P,R)){return this.__error(new CsvError("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()))}else{if(n===false){R+=this.__isCharTrimable(P,R)-1}continue}}if(t===true){if(this.state.quoting===true){const e=this.__error(new CsvError("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(e!==undefined)return e}else{if(this.state.wasQuoting===true||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+R;const e=this.__onField();if(e!==undefined)return e;const t=this.__onRecord(r);if(t!==undefined)return t}else if(this.state.wasRowDelimiter===true){this.info.empty_lines++}else if(this.state.commenting===true){this.info.comment_lines++}}}else{this.state.bufBytesStart+=R;this.state.previousBuf=P.slice(R)}if(this.state.wasRowDelimiter===true){this.info.lines++;this.state.wasRowDelimiter=false}},__onRecord:function(e){const{columns:t,group_columns_by_name:r,encoding:i,info:n,from:o,relax_column_count:s,relax_column_count_less:u,relax_column_count_more:a,raw:l,skip_records_with_empty_values:c}=this.options;const{enabled:f,record:d}=this.state;if(f===false){return this.__resetRecord()}const h=d.length;if(t===true){if(c===true&&isRecordEmpty(d)){this.__resetRecord();return}return this.__firstLineToColumns(d)}if(t===false&&this.info.records===0){this.state.expectedRecordLength=h}if(h!==this.state.expectedRecordLength){const e=t===false?new CsvError("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${h} on line ${this.info.lines}`],this.options,this.__infoField(),{record:d}):new CsvError("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${t.length},`,`got ${h} on line ${this.info.lines}`],this.options,this.__infoField(),{record:d});if(s===true||u===true&&h<this.state.expectedRecordLength||a===true&&h>this.state.expectedRecordLength){this.info.invalid_field_length++;this.state.error=e}else{const t=this.__error(e);if(t)return t}}if(c===true&&isRecordEmpty(d)){this.__resetRecord();return}if(this.state.recordHasError===true){this.__resetRecord();this.state.recordHasError=false;return}this.info.records++;if(o===1||this.info.records>=o){const{objname:o}=this.options;if(t!==false){const s={};for(let e=0,i=d.length;e<i;e++){if(t[e]===undefined||t[e].disabled)continue;if(r===true&&s[t[e].name]!==undefined){if(Array.isArray(s[t[e].name])){s[t[e].name]=s[t[e].name].concat(d[e])}else{s[t[e].name]=[s[t[e].name],d[e]]}}else{s[t[e].name]=d[e]}}if(l===true||n===true){const t=Object.assign({record:s},l===true?{raw:this.state.rawBuffer.toString(i)}:{},n===true?{info:this.__infoRecord()}:{});const r=this.__push(o===undefined?t:[s[o],t],e);if(r){return r}}else{const t=this.__push(o===undefined?s:[s[o],s],e);if(t){return t}}}else{if(l===true||n===true){const t=Object.assign({record:d},l===true?{raw:this.state.rawBuffer.toString(i)}:{},n===true?{info:this.__infoRecord()}:{});const r=this.__push(o===undefined?t:[d[o],t],e);if(r){return r}}else{const t=this.__push(o===undefined?d:[d[o],d],e);if(t){return t}}}}this.__resetRecord()},__firstLineToColumns:function(e){const{firstLineToHeaders:t}=this.state;try{const r=t===undefined?e:t.call(null,e);if(!Array.isArray(r)){return this.__error(new CsvError("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}))}const i=normalize_columns_array(r);this.state.expectedRecordLength=i.length;this.options.columns=i;this.__resetRecord();return}catch(e){return e}},__resetRecord:function(){if(this.options.raw===true){this.state.rawBuffer.reset()}this.state.error=undefined;this.state.record=[];this.state.record_length=0},__onField:function(){const{cast:e,encoding:t,rtrim:r,max_record_size:i}=this.options;const{enabled:n,wasQuoting:o}=this.state;if(n===false){return this.__resetField()}let s=this.state.field.toString(t);if(r===true&&o===false){s=s.trimRight()}if(e===true){const[e,t]=this.__cast(s);if(e!==undefined)return e;s=t}this.state.record.push(s);if(i!==0&&typeof s==="string"){this.state.record_length+=s.length}this.__resetField()},__resetField:function(){this.state.field.reset();this.state.wasQuoting=false},__push:function(e,t){const{on_record:r}=this.options;if(r!==undefined){const t=this.__infoRecord();try{e=r.call(null,e,t)}catch(e){return e}if(e===undefined||e===null){return}}t(e)},__cast:function(e){const{columns:t,relax_column_count:r}=this.options;const i=Array.isArray(t);if(i===true&&r&&this.options.columns.length<=this.state.record.length){return[undefined,undefined]}if(this.state.castField!==null){try{const t=this.__infoField();return[undefined,this.state.castField.call(null,e,t)]}catch(e){return[e]}}if(this.__isFloat(e)){return[undefined,parseFloat(e)]}else if(this.options.cast_date!==false){const t=this.__infoField();return[undefined,this.options.cast_date.call(null,e,t)]}return[undefined,e]},__isCharTrimable:function(e,t){const isTrim=(e,t)=>{const{timchars:r}=this.state;e:for(let i=0;i<r.length;i++){const n=r[i];for(let r=0;r<n.length;r++){if(n[r]!==e[t+r])continue e}return n.length}return 0};return isTrim(e,t)},__isFloat:function(e){return e-parseFloat(e)+1>=0},__compareBytes:function(e,t,r,i){if(e[0]!==i)return 0;const n=e.length;for(let i=1;i<n;i++){if(e[i]!==t[r+i])return 0}return n},__isDelimiter:function(e,t,r){const{delimiter:i,ignore_last_delimiters:n}=this.options;if(n===true&&this.state.record.length===this.options.columns.length-1){return 0}else if(n!==false&&typeof n==="number"&&this.state.record.length===n-1){return 0}e:for(let n=0;n<i.length;n++){const o=i[n];if(o[0]===r){for(let r=1;r<o.length;r++){if(o[r]!==e[t+r])continue e}return o.length}}return 0},__isRecordDelimiter:function(e,t,r){const{record_delimiter:i}=this.options;const n=i.length;e:for(let o=0;o<n;o++){const n=i[o];const s=n.length;if(n[0]!==e){continue}for(let e=1;e<s;e++){if(n[e]!==t[r+e]){continue e}}return n.length}return 0},__isEscape:function(e,t,r){const{escape:i}=this.options;if(i===null)return false;const n=i.length;if(i[0]===r){for(let r=0;r<n;r++){if(i[r]!==e[t+r]){return false}}return true}return false},__isQuote:function(e,t){const{quote:r}=this.options;if(r===null)return false;const i=r.length;for(let n=0;n<i;n++){if(r[n]!==e[t+n]){return false}}return true},__autoDiscoverRecordDelimiter:function(e,t){const{encoding:r}=this.options;const i=[Buffer.from("\r\n",r),Buffer.from("\n",r),Buffer.from("\r",r)];e:for(let r=0;r<i.length;r++){const n=i[r].length;for(let o=0;o<n;o++){if(i[r][o]!==e[t+o]){continue e}}this.options.record_delimiter.push(i[r]);this.state.recordDelimiterMaxLength=i[r].length;return i[r].length}return 0},__error:function(e){const{encoding:t,raw:r,skip_records_with_error:i}=this.options;const n=typeof e==="string"?new Error(e):e;if(i){this.state.recordHasError=true;if(this.options.on_skip!==undefined){this.options.on_skip(n,r?this.state.rawBuffer.toString(t):undefined)}return undefined}else{return n}},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){const{columns:e,raw:t,encoding:r}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:e===true,index:this.state.record.length,raw:t?this.state.rawBuffer.toString(r):undefined}},__infoField:function(){const{columns:e}=this.options;const t=Array.isArray(e);return{...this.__infoRecord(),column:t===true?e.length>this.state.record.length?e[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};const parse=function(e,t={}){if(typeof e==="string"){e=Buffer.from(e)}const r=t&&t.objname?{}:[];const i=transform(t);const push=e=>{if(i.options.objname===undefined)r.push(e);else{r[e[0]]=e[1]}};const close=()=>{};const n=i.parse(e,false,push,close);if(n!==undefined)throw n;const o=i.parse(undefined,true,push,close);if(o!==undefined)throw o;return r};t.CsvError=CsvError;t.parse=parse}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={exports:{}};var o=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(399);module.exports=r})();
|
|
//# sourceMappingURL=index.js.map
|