From 00180bcc03436efa1348d65188eddaf882ab998a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:47:54 +0000 Subject: [PATCH 1/2] chore(deps): update dependency zod to v4.5.4 --- pnpm-lock.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0899ec7..add1d26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: version: 2.9.0 zod: specifier: ^4.0.0 - version: 4.4.3 + version: 4.5.4 devDependencies: '@types/node': specifier: ^24.0.0 @@ -1297,8 +1297,8 @@ packages: yuku-parser@0.5.48: resolution: {integrity: sha512-OWBfhrpgK9+/4+IXG9oT8Bao4AhViQA7vdyNNH7EUg8dQYgwa70XtIBWTpCEme1P1ECyoDNYkn0wT63f8XRcVA==} - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zod@4.5.4: + resolution: {integrity: sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==} snapshots: @@ -2341,4 +2341,4 @@ snapshots: '@yuku-parser/binding-win32-arm64': 0.5.48 '@yuku-parser/binding-win32-x64': 0.5.48 - zod@4.4.3: {} + zod@4.5.4: {} From a7de086a9e92d00bd45352c77d0fcb178a68ccdb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 6 Sep 2026 17:48:20 +0000 Subject: [PATCH 2/2] chore: rebuild action bundle for dependency update --- dist/index.mjs | 116 ++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index df1d417..2f61854 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -15,17 +15,17 @@ Content-Type: ${o.type||`application/octet-stream`}\r\n\r\n`);r.push(e,o,i),type ${n.count} ${n.noun} ${n.is} pending: ${e.format(t)} -`.trim())}}})),zt=__commonJSMin(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=Le(),i=gt();getGlobalDispatcher()===void 0&&setGlobalDispatcher(new i);function setGlobalDispatcher(e){if(!e||typeof e.dispatch!=`function`)throw new r(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1})}function getGlobalDispatcher(){return globalThis[n]}t.exports={setGlobalDispatcher,getGlobalDispatcher}})),Bt=__commonJSMin(((e,t)=>{t.exports=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}})),Vt=__commonJSMin(((e,t)=>{let n=ct();t.exports=e=>{let t=e?.maxRedirections;return e=>function(r,i){let{maxRedirections:a=t,...o}=r;return a?e(o,new n(e,a,r,i)):e(r,i)}}})),Ht=__commonJSMin(((e,t)=>{let n=yt();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),Ut=__commonJSMin(((e,t)=>{let n=z(),{InvalidArgumentError:r,RequestAbortedError:i}=Le(),a=Bt();var DumpHandler=class extends a{#e=1048576;#t=null;#n=!1;#r=!1;#i=0;#a=null;#o=null;constructor({maxSize:e},t){if(super(t),e!=null&&(!Number.isFinite(e)||e<1))throw new r(`maxSize must be a number greater than 0`);this.#e=e??this.#e,this.#o=t}onConnect(e){this.#t=e,this.#o.onConnect(this.#s.bind(this))}#s(e){this.#r=!0,this.#a=e}onHeaders(e,t,r,a){let o=n.parseHeaders(t)[`content-length`];if(o!=null&&o>this.#e)throw new i(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#o.onHeaders(e,t,r,a)}onError(e){this.#n||(e=this.#a??e,this.#o.onError(e))}onData(e){return this.#i+=e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#o.onError(this.#a):this.#o.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#o.onError(this.reason);return}this.#o.onComplete(e)}}};function createDumpInterceptor({maxSize:e}={maxSize:1048576}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new DumpHandler({maxSize:i},r))}}t.exports=createDumpInterceptor})),Wt=__commonJSMin(((e,t)=>{let{isIP:n}=R(`node:net`),{lookup:r}=R(`node:dns`),i=Bt(),{InvalidArgumentError:a,InformationalError:o}=Le(),s=2**31-1;var DNSInstance=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,t,n){let r=this.#n.get(e.hostname);if(r==null&&this.full){n(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new o(`No DNS entries found`));return}this.setRecords(e,r);let a=this.#n.get(e.hostname),s=this.pick(e,a,i.affinity),c;c=typeof s.port==`number`?`:${s.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${s.family===6?`[${s.address}]`:s.address}${c}`)});else{let a=this.pick(e,r,i.affinity);if(a==null){this.#n.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`)}}#r(e,t,n){r(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#i(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===s?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===s?o.offset=0:o.offset++;let c=o.offset%o.ips.length;return r=o.ips[c]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(c,1),this.pick(e,t,n)):r}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}};for(let e of t){e.timestamp=n,e.ttl=typeof e.ttl==`number`?Math.min(e.ttl,this.#e):this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.#n.set(e.hostname,r)}getHandler(e,t){return new DNSDispatchHandler(this,e,t)}},DNSDispatchHandler=class extends i{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:t,handler:n,dispatch:r},i){super(n),this.#i=t,this.#r=n,this.#t={...i},this.#e=e,this.#n=r}onError(e){switch(e.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(e,t)=>{if(e)return this.#r.onError(e);let n={...this.#t,origin:t};this.#n(n,this)});return}this.#r.onError(e);return;case`ENOTFOUND`:this.#e.deleteRecord(this.#i);default:this.#r.onError(e)}}};t.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new a(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new a(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new a(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new a(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new a(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new a(`Invalid pick. Must be a function`);let t=e?.dualStack??!0,r;r=t?e?.affinity??null:e?.affinity??4;let i=new DNSInstance({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:r,maxItems:e?.maxItems??1/0});return e=>function(t,r){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return n(a.hostname)===0?(i.runLookup(a,t,(n,o)=>{if(n)return r.onError(n);let s=null;s={...t,servername:a.hostname,origin:o,headers:{host:a.hostname,...t.headers}},e(s,i.getHandler({origin:a,dispatch:e,handler:r},t))}),!0):e(t,r)}}})),Gt=__commonJSMin(((e,t)=>{let{kConstruct:n}=Ie(),{kEnumerableProperty:r}=z(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=et(),{webidl:s}=$e(),c=R(`node:assert`),l=R(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function isHTTPWhiteSpaceCharCode(e){return e===10||e===13||e===9||e===32}function headerValueNormalize(e){let t=0,n=e.length;for(;n>t&&isHTTPWhiteSpaceCharCode(e.charCodeAt(n-1));)--n;for(;n>t&&isHTTPWhiteSpaceCharCode(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function fill(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function appendHeader(e,t,n){if(n=headerValueNormalize(n),!a(t))throw s.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:`Headers.append`,value:n,type:`header value`});if(h(e)===`immutable`)throw TypeError(`immutable`);return v(e).append(t,n,!1)}function compareHeaderName(e,t){return e[0]>1),t[s][0]<=l[0]?o=s+1:a=s;if(r!==s){for(i=r;i>o;)t[i]=t[--i];t[o]=l}}if(!n.next().done)throw TypeError(`Unreachable`);return t}{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(compareHeaderName)}}},p=class Headers{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new f,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),fill(this,e)))}append(e,t){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,2,`Headers.append`);let n=`Headers.append`;return e=s.converters.ByteString(e,n,`name`),t=s.converters.ByteString(t,n,`value`),appendHeader(this,e,t)}delete(e){if(s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.delete`),e=s.converters.ByteString(e,`Headers.delete`,`name`),!a(e))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:e,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.get`);let t=`Headers.get`;if(e=s.converters.ByteString(e,t,`name`),!a(e))throw s.errors.invalidArgument({prefix:t,value:e,type:`header name`});return this.#t.get(e,!1)}has(e){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.has`);let t=`Headers.has`;if(e=s.converters.ByteString(e,t,`name`),!a(e))throw s.errors.invalidArgument({prefix:t,value:e,type:`header name`});return this.#t.contains(e,!1)}set(e,t){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,2,`Headers.set`);let n=`Headers.set`;if(e=s.converters.ByteString(e,n,`name`),t=s.converters.ByteString(t,n,`value`),t=headerValueNormalize(t),!a(e))throw s.errors.invalidArgument({prefix:n,value:e,type:`header name`});if(!o(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(e,t,!1)}getSetCookie(){s.brandCheck(this,Headers);let e=this.#t.cookies;return e?[...e]:[]}get[d](){if(this.#t[d])return this.#t[d];let e=[],t=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[d]=t;for(let r=0;r>`](e,t,n,r.bind(e)):s.converters[`record`](e,t,n)}throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill,compareHeaderName,Headers:p,HeadersList:f,getHeadersGuard:h,setHeadersGuard:g,setHeadersList:y,getHeadersList:v}})),Kt=__commonJSMin(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Gt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=at(),h=z(),g=R(`node:util`),{kEnumerableProperty:v}=h,{isValidReasonPhrase:y,isCancelled:b,isAborted:x,isBlobLike:S,serializeJavascriptValueToJSONString:C,isErrorLike:w,isomorphicEncode:T,environmentSettingsObject:E}=et(),{redirectStatusSet:D,nullBodyStatus:O}=Xe(),{kState:k,kHeaders:A}=tt(),{webidl:j}=$e(),{FormData:M}=rt(),{URLSerializer:N}=Qe(),{kConstruct:P}=Ie(),ee=R(`node:assert`),{types:F}=R(`node:util`),te=new TextEncoder(`utf-8`);var ne=class Response{static error(){return fromInnerResponse(makeNetworkError(),`immutable`)}static json(e,t={}){j.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=j.converters.ResponseInit(t));let n=te.encode(C(e)),r=c(n),i=fromInnerResponse(makeResponse({}),`response`);return initializeResponse(i,t,{body:r[0],type:`application/json`}),i}static redirect(e,t=302){j.argumentLengthCheck(arguments,1,`Response.redirect`),e=j.converters.USVString(e),t=j.converters[`unsigned short`](t);let n;try{n=new URL(e,E.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!D.has(t))throw RangeError(`Invalid status code ${t}`);let r=fromInnerResponse(makeResponse({}),`immutable`);r[k].status=t;let i=T(N(n));return r[k].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(j.util.markAsUncloneable(this),e===P)return;e!==null&&(e=j.converters.BodyInit(e)),t=j.converters.ResponseInit(t),this[k]=makeResponse({}),this[A]=new n(P),o(this[A],`response`),s(this[A],this[k].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}initializeResponse(this,t,r)}get type(){return j.brandCheck(this,Response),this[k].type}get url(){j.brandCheck(this,Response);let e=this[k].urlList,t=e[e.length-1]??null;return t===null?``:N(t,!0)}get redirected(){return j.brandCheck(this,Response),this[k].urlList.length>1}get status(){return j.brandCheck(this,Response),this[k].status}get ok(){return j.brandCheck(this,Response),this[k].status>=200&&this[k].status<=299}get statusText(){return j.brandCheck(this,Response),this[k].statusText}get headers(){return j.brandCheck(this,Response),this[A]}get body(){return j.brandCheck(this,Response),this[k].body?this[k].body.stream:null}get bodyUsed(){return j.brandCheck(this,Response),!!this[k].body&&h.isDisturbed(this[k].body.stream)}clone(){if(j.brandCheck(this,Response),p(this))throw j.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let e=cloneResponse(this[k]);return d&&this[k].body?.stream&&f.register(this,new WeakRef(this[k].body.stream)),fromInnerResponse(e,a(this[A]))}[g.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${g.formatWithOptions(t,n)}`}};u(ne),Object.defineProperties(ne.prototype,{type:v,url:v,status:v,ok:v,redirected:v,statusText:v,headers:v,clone:v,body:v,bodyUsed:v,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(ne,{json:v,redirect:v,error:v});function cloneResponse(e){if(e.internalResponse)return filterResponse(cloneResponse(e.internalResponse),e.type);let t=makeResponse({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function makeResponse(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:`default`,status:200,timingInfo:null,cacheState:``,statusText:``,...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function makeNetworkError(e){return makeResponse({type:`error`,status:0,error:w(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function isNetworkError(e){return e.type===`error`&&e.status===0}function makeFilteredResponse(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(e,n){return n in t?t[n]:e[n]},set(e,n,r){return ee(!(n in t)),e[n]=r,!0}})}function filterResponse(e,t){if(t===`basic`)return makeFilteredResponse(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return makeFilteredResponse(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return makeFilteredResponse(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return makeFilteredResponse(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});ee(!1)}function makeAppropriateNetworkError(e,t=null){return ee(b(e)),x(e)?makeNetworkError(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):makeNetworkError(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function initializeResponse(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`);if(`statusText`in t&&t.statusText!=null&&!y(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[k].status=t.status),`statusText`in t&&t.statusText!=null&&(e[k].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[A],t.headers),n){if(O.includes(e.status))throw j.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[k].body=n.body,n.type!=null&&!e[k].headersList.contains(`content-type`,!0)&&e[k].headersList.append(`content-type`,n.type,!0)}}function fromInnerResponse(e,t){let r=new ne(P);return r[k]=e,r[A]=new n(P),s(r[A],e.headersList),o(r[A],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}j.converters.ReadableStream=j.interfaceConverter(ReadableStream),j.converters.FormData=j.interfaceConverter(M),j.converters.URLSearchParams=j.interfaceConverter(URLSearchParams),j.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?j.converters.USVString(e,t,n):S(e)?j.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||F.isArrayBuffer(e)?j.converters.BufferSource(e,t,n):h.isFormDataLike(e)?j.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?j.converters.URLSearchParams(e,t,n):j.converters.DOMString(e,t,n)},j.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?j.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:j.converters.XMLHttpRequestBodyInit(e,t,n)},j.converters.ResponseInit=j.dictionaryConverter([{key:`status`,converter:j.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:j.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:j.converters.HeadersInit}]),t.exports={isNetworkError,makeNetworkError,makeResponse,makeAppropriateNetworkError,filterResponse,Response:ne,cloneResponse,fromInnerResponse}})),qt=__commonJSMin(((e,t)=>{let{kConnected:n,kSize:r}=Ie();var CompatWeakRef=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},CompatFinalizer=class{constructor(e){this.finalizer=e}register(e,t){e.on&&e.on(`disconnect`,()=>{e[n]===0&&e[r]===0&&this.finalizer(t)})}unregister(e){}};t.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith(`v18`)?(process._rawDebug(`Using compatibility WeakRef and FinalizationRegistry`),{WeakRef:CompatWeakRef,FinalizationRegistry:CompatFinalizer}):{WeakRef,FinalizationRegistry}}})),Jt=__commonJSMin(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=at(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Gt(),{FinalizationRegistry:p}=qt()(),h=z(),g=R(`node:util`),{isValidHTTPToken:v,sameOrigin:y,environmentSettingsObject:b}=et(),{forbiddenMethodsSet:x,corsSafeListedMethodsSet:S,referrerPolicy:C,requestRedirect:w,requestMode:T,requestCredentials:E,requestCache:D,requestDuplex:O}=Xe(),{kEnumerableProperty:k,normalizedMethodRecordsBase:A,normalizedMethodRecords:j}=h,{kHeaders:M,kSignal:N,kState:P,kDispatcher:ee}=tt(),{webidl:F}=$e(),{URLSerializer:te}=Qe(),{kConstruct:ne}=Ie(),re=R(`node:assert`),{getMaxListeners:I,setMaxListeners:ie,getEventListeners:ae,defaultMaxListeners:oe}=R(`node:events`),se=Symbol(`abortController`),ce=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),le=new WeakMap;function buildAbort(e){return abort;function abort(){let t=e.deref();if(t!==void 0){ce.unregister(abort),this.removeEventListener(`abort`,abort),t.abort(this.reason);let e=le.get(t.signal);if(e!==void 0){if(e.size!==0){for(let t of e){let e=t.deref();e!==void 0&&e.abort(this.reason)}e.clear()}le.delete(t.signal)}}}}let ue=!1;var de=class Request{constructor(e,t={}){if(F.util.markAsUncloneable(this),e===ne)return;let r=`Request constructor`;F.argumentLengthCheck(arguments,1,r),e=F.converters.RequestInfo(e,r,`input`),t=F.converters.RequestInit(t,r,`init`);let i=null,u=null,p=b.settingsObject.baseUrl,g=null;if(typeof e==`string`){this[ee]=t.dispatcher;let n;try{n=new URL(e,p)}catch(t){throw TypeError(`Failed to parse URL from `+e,{cause:t})}if(n.username||n.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+e);i=makeRequest({urlList:[n]}),u=`cors`}else this[ee]=t.dispatcher||e[ee],re(e instanceof Request),i=e[P],g=e[N];let C=b.settingsObject.origin,w=`client`;if(i.window?.constructor?.name===`EnvironmentSettingsObject`&&y(i.window,C)&&(w=i.window),t.window!=null)throw TypeError(`'window' option '${w}' must be null`);`window`in t&&(w=`no-window`),i=makeRequest({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:b.settingsObject,window:w,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let T=Object.keys(t).length!==0;if(T&&(i.mode===`navigate`&&(i.mode=`same-origin`),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin=`client`,i.referrer=`client`,i.referrerPolicy=``,i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),t.referrer!==void 0){let e=t.referrer;if(e===``)i.referrer=`no-referrer`;else{let t;try{t=new URL(e,p)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||C&&!y(t,b.settingsObject.baseUrl)?i.referrer=`client`:i.referrer=t}}t.referrerPolicy!==void 0&&(i.referrerPolicy=t.referrerPolicy);let E;if(E=t.mode===void 0?u:t.mode,E===`navigate`)throw F.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(E!=null&&(i.mode=E),t.credentials!==void 0&&(i.credentials=t.credentials),t.cache!==void 0&&(i.cache=t.cache),i.cache===`only-if-cached`&&i.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(t.redirect!==void 0&&(i.redirect=t.redirect),t.integrity!=null&&(i.integrity=String(t.integrity)),t.keepalive!==void 0&&(i.keepalive=!!t.keepalive),t.method!==void 0){let e=t.method,n=j[e];if(n!==void 0)i.method=n;else{if(!v(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(x.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=A[t]??e,i.method=e}!ue&&i.method===`patch`&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:`UNDICI-FETCH-patch`}),ue=!0)}t.signal!==void 0&&(g=t.signal),this[P]=i;let D=new AbortController;if(this[N]=D.signal,g!=null){if(!g||typeof g.aborted!=`boolean`||typeof g.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(g.aborted)D.abort(g.reason);else{this[se]=D;let e=buildAbort(new WeakRef(D));try{(typeof I==`function`&&I(g)===oe||ae(g,`abort`).length>=oe)&&ie(1500,g)}catch{}h.addAbortListener(g,e),ce.register(D,{signal:g,abort:e},e)}}if(this[M]=new o(ne),d(this[M],i.headersList),l(this[M],`request`),E===`no-cors`){if(!S.has(i.method))throw TypeError(`'${i.method} is unsupported in no-cors mode.`);l(this[M],`request-no-cors`)}if(T){let e=f(this[M]),n=t.headers===void 0?new c(e):t.headers;if(e.clear(),n instanceof c){for(let{name:t,value:r}of n.rawValues())e.append(t,r,!1);e.cookies=n.cookies}else s(this[M],n)}let O=e instanceof Request?e[P].body:null;if((t.body!=null||O!=null)&&(i.method===`GET`||i.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let k=null;if(t.body!=null){let[e,r]=n(t.body,i.keepalive);k=e,r&&!f(this[M]).contains(`content-type`,!0)&&this[M].append(`content-type`,r)}let te=k??O;if(te!=null&&te.source==null){if(k!=null&&t.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(i.mode!==`same-origin`&&i.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);i.useCORSPreflightFlag=!0}let le=te;if(k==null&&O!=null){if(a(e))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let t=new TransformStream;O.stream.pipeThrough(t),le={source:O.source,length:O.length,stream:t.readable}}this[P].body=le}get method(){return F.brandCheck(this,Request),this[P].method}get url(){return F.brandCheck(this,Request),te(this[P].url)}get headers(){return F.brandCheck(this,Request),this[M]}get destination(){return F.brandCheck(this,Request),this[P].destination}get referrer(){return F.brandCheck(this,Request),this[P].referrer===`no-referrer`?``:this[P].referrer===`client`?`about:client`:this[P].referrer.toString()}get referrerPolicy(){return F.brandCheck(this,Request),this[P].referrerPolicy}get mode(){return F.brandCheck(this,Request),this[P].mode}get credentials(){return this[P].credentials}get cache(){return F.brandCheck(this,Request),this[P].cache}get redirect(){return F.brandCheck(this,Request),this[P].redirect}get integrity(){return F.brandCheck(this,Request),this[P].integrity}get keepalive(){return F.brandCheck(this,Request),this[P].keepalive}get isReloadNavigation(){return F.brandCheck(this,Request),this[P].reloadNavigation}get isHistoryNavigation(){return F.brandCheck(this,Request),this[P].historyNavigation}get signal(){return F.brandCheck(this,Request),this[N]}get body(){return F.brandCheck(this,Request),this[P].body?this[P].body.stream:null}get bodyUsed(){return F.brandCheck(this,Request),!!this[P].body&&h.isDisturbed(this[P].body.stream)}get duplex(){return F.brandCheck(this,Request),`half`}clone(){if(F.brandCheck(this,Request),a(this))throw TypeError(`unusable`);let e=cloneRequest(this[P]),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let e=le.get(this.signal);e===void 0&&(e=new Set,le.set(this.signal,e));let n=new WeakRef(t);e.add(n),h.addAbortListener(t.signal,buildAbort(n))}return fromInnerRequest(e,t.signal,u(this[M]))}[g.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${g.formatWithOptions(t,n)}`}};r(de);function makeRequest(e){return{method:e.method??`GET`,localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??``,window:e.window??`client`,keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??`all`,initiator:e.initiator??``,destination:e.destination??``,priority:e.priority??null,origin:e.origin??`client`,policyContainer:e.policyContainer??`client`,referrer:e.referrer??`client`,referrerPolicy:e.referrerPolicy??``,mode:e.mode??`no-cors`,useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??`same-origin`,useCredentials:e.useCredentials??!1,cache:e.cache??`default`,redirect:e.redirect??`follow`,integrity:e.integrity??``,cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??``,parserMetadata:e.parserMetadata??``,reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??`basic`,preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function cloneRequest(e){let t=makeRequest({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function fromInnerRequest(e,t,n){let r=new de(ne);return r[P]=e,r[N]=t,r[M]=new o(ne),d(r[M],e.headersList),l(r[M],n),r}Object.defineProperties(de.prototype,{method:k,url:k,headers:k,redirect:k,clone:k,signal:k,duplex:k,destination:k,body:k,bodyUsed:k,isHistoryNavigation:k,isReloadNavigation:k,keepalive:k,integrity:k,cache:k,credentials:k,attribute:k,referrerPolicy:k,referrer:k,mode:k,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),F.converters.Request=F.interfaceConverter(de),F.converters.RequestInfo=function(e,t,n){return typeof e==`string`?F.converters.USVString(e,t,n):e instanceof de?F.converters.Request(e,t,n):F.converters.USVString(e,t,n)},F.converters.AbortSignal=F.interfaceConverter(AbortSignal),F.converters.RequestInit=F.dictionaryConverter([{key:`method`,converter:F.converters.ByteString},{key:`headers`,converter:F.converters.HeadersInit},{key:`body`,converter:F.nullableConverter(F.converters.BodyInit)},{key:`referrer`,converter:F.converters.USVString},{key:`referrerPolicy`,converter:F.converters.DOMString,allowedValues:C},{key:`mode`,converter:F.converters.DOMString,allowedValues:T},{key:`credentials`,converter:F.converters.DOMString,allowedValues:E},{key:`cache`,converter:F.converters.DOMString,allowedValues:D},{key:`redirect`,converter:F.converters.DOMString,allowedValues:w},{key:`integrity`,converter:F.converters.DOMString},{key:`keepalive`,converter:F.converters.boolean},{key:`signal`,converter:F.nullableConverter(e=>F.converters.AbortSignal(e,`RequestInit`,`signal`,{strict:!1}))},{key:`window`,converter:F.converters.any},{key:`duplex`,converter:F.converters.DOMString,allowedValues:O},{key:`dispatcher`,converter:F.converters.any}]),t.exports={Request:de,makeRequest,fromInnerRequest,cloneRequest}})),Yt=__commonJSMin(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=Kt(),{HeadersList:s}=Gt(),{Request:c,cloneRequest:l}=Jt(),u=R(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:h,TAOCheck:g,appendRequestOriginHeader:v,responseLocationURL:y,requestCurrentURL:b,setRequestReferrerPolicyOnRedirect:x,tryUpgradeRequestToAPotentiallyTrustworthyURL:S,createOpaqueTimingInfo:C,appendFetchMetadata:w,corsCheck:T,crossOriginResourcePolicyCheck:E,determineRequestsReferrer:D,coarsenedSharedCurrentTime:O,createDeferredPromise:k,isBlobLike:A,sameOrigin:j,isCancelled:M,isAborted:N,isErrorLike:P,fullyReadBody:ee,readableStreamClose:F,isomorphicEncode:te,urlIsLocal:ne,urlIsHttpHttpsScheme:re,urlHasHttpsScheme:I,clampAndCoarsenConnectionTimingInfo:ie,simpleRangeHeaderValue:ae,buildContentRange:oe,createInflate:se,extractMimeType:ce}=et(),{kState:le,kDispatcher:ue}=tt(),de=R(`node:assert`),{safelyExtractBody:fe,extractBody:pe}=at(),{redirectStatusSet:me,nullBodyStatus:L,safeMethodsSet:he,requestBodyHeader:ge,subresourceSet:_e}=Xe(),ve=R(`node:events`),{Readable:ye,pipeline:be,finished:xe}=R(`node:stream`),{addAbortListener:Se,isErrored:Ce,isReadable:we,bufferToLowerCasedHeaderName:Te}=z(),{dataURLProcessor:Ee,serializeAMimeType:De,minimizeSupportedMimeType:Oe}=Qe(),{getGlobalDispatcher:ke}=zt(),{webidl:Ae}=$e(),{STATUS_CODES:je}=R(`node:http`),Me=[`GET`,`HEAD`],Ne=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,Pe;var Fetch=class extends ve{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`}terminate(e){this.state===`ongoing`&&(this.state=`terminated`,this.connection?.destroy(e),this.emit(`terminated`,e))}abort(e){this.state===`ongoing`&&(this.state=`aborted`,e||=new DOMException(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function handleFetchDone(e){finalizeAndReportTiming(e,`fetch`)}function fetch(e,t=void 0){Ae.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=k(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[le];if(r.signal.aborted)return abortFetch(n,i,null,r.signal.reason),n.promise;i.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(i.serviceWorkers=`none`);let a=null,s=!1,l=null;return Se(r.signal,()=>{s=!0,de(l!=null),l.abort(r.signal.reason);let e=a?.deref();abortFetch(n,i,e,r.signal.reason)}),l=fetching({request:i,processResponseEndOfBody:handleFetchDone,processResponse:e=>{if(!s){if(e.aborted){abortFetch(n,i,a,l.serializedAbortReason);return}if(e.type===`error`){n.reject(TypeError(`fetch failed`,{cause:e.error}));return}a=new WeakRef(o(e,`immutable`)),n.resolve(a.deref()),n=null}},dispatcher:r[ue]}),n.promise}function finalizeAndReportTiming(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;re(n)&&r!==null&&(e.timingAllowPassed||(r=C({startTime:r.startTime}),i=``),r.endTime=O(),e.timingInfo=r,Fe(r,n.href,t,globalThis,i))}let Fe=performance.markResourceTiming;function abortFetch(e,t,n,r){if(e&&e.reject(r),t.body!=null&&we(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[le];i.body!=null&&we(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function fetching({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=ke()}){de(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=O(l),d=C({startTime:u}),h={controller:new Fetch(s),request:e,timingInfo:d,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return de(!e.body||e.body.stream),e.window===`client`&&(e.window=e.client?.globalObject?.constructor?.name===`Window`?e.client:`no-window`),e.origin===`client`&&(e.origin=e.client.origin),e.policyContainer===`client`&&(e.policyContainer=e.client==null?f():p(e.client.policyContainer)),e.headersList.contains(`accept`,!0)||e.headersList.append(`accept`,`*/*`,!0),e.headersList.contains(`accept-language`,!0)||e.headersList.append(`accept-language`,`*`,!0),e.priority,_e.has(e.destination),mainFetch(h).catch(e=>{h.controller.terminate(e)}),h.controller}async function mainFetch(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!ne(b(r))&&(a=n(`local URLs only`)),S(r),h(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=D(r)),a===null&&(a=await(async()=>{let t=b(r);return j(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await schemeFetch(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await schemeFetch(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):re(b(r))?(r.responseTainting=`cors`,await httpFetch(e)):n(`URL scheme must be a HTTP(S) scheme`)})()),t)return a;a.status!==0&&!a.internalResponse&&(r.responseTainting,r.responseTainting===`basic`?a=i(a,`basic`):r.responseTainting===`cors`?a=i(a,`cors`):r.responseTainting===`opaque`?a=i(a,`opaque`):de(!1));let o=a.status===0?a:a.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(a.timingAllowPassed=!0),a.type===`opaque`&&o.status===206&&o.rangeRequested&&!r.headers.contains(`range`,!0)&&(a=o=n()),a.status!==0&&(r.method===`HEAD`||r.method===`CONNECT`||L.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let processBodyError=t=>fetchFinale(e,n(t));if(r.responseTainting===`opaque`||a.body==null){processBodyError(a.error);return}await ee(a.body,t=>{if(!d(t,r.integrity)){processBodyError(`integrity mismatch`);return}a.body=fe(t)[0],fetchFinale(e,a)},processBodyError)}else fetchFinale(e,a)}function schemeFetch(e){if(M(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=b(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{Pe||=R(`node:buffer`).resolveObjectURL;let e=b(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=Pe(e.toString());if(t.method!==`GET`||!A(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=te(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=t.headersList.get(`range`,!0),a=ae(e,!0);if(a===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:s,rangeEndValue:l}=a;if(s===null)s=o-l,l=s+l-1;else{if(s>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(l===null||l>=o)&&(l=o-1)}let u=r.slice(s,l,c);i.body=pe(u)[0];let d=te(`${u.size}`),f=oe(s,l,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,d,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,f,!0)}else{let e=pe(r);i.statusText=`OK`,i.body=e[0],i.headersList.set(`content-length`,s,!0),i.headersList.set(`content-type`,c,!0)}return Promise.resolve(i)}case`data:`:{let e=b(t),r=Ee(e);if(r===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let i=De(r.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:i}]],body:fe(r.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return httpFetch(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function finalizeResponse(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function fetchFinale(e,t){let n=e.timingInfo,processResponseEndOfBody=()=>{let r=Date.now();e.request.destination===`document`&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!==`https:`)return;n.endTime=r;let i=t.cacheState,a=t.bodyInfo;t.timingAllowPassed||(n=C(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=ce(t.headersList);e!==`failure`&&(a.contentType=Oe(e))}e.request.initiatorType!=null&&Fe(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let processResponseEndOfBodyTask=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>processResponseEndOfBodyTask())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let r=t.type===`error`?t:t.internalResponse??t;r.body==null?processResponseEndOfBody():xe(r.body.stream,()=>{processResponseEndOfBody()})}async function httpFetch(e){let t=e.request,r=null,i=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=r=await httpNetworkOrCacheFetch(e),t.responseTainting===`cors`&&T(t,r)===`failure`)return n(`cors failure`);g(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&E(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(me.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(void 0,!1),t.redirect===`error`?r=n(`unexpected redirect`):t.redirect===`manual`?r=i:t.redirect===`follow`?r=await httpRedirectFetch(e,r):de(!1)),r.timingInfo=a,r)}function httpRedirectFetch(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=y(i,b(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!re(a))return Promise.resolve(n(`URL scheme must be a HTTP(S) scheme`));if(r.redirectCount===20)return Promise.resolve(n(`redirect count exceeded`));if(r.redirectCount+=1,r.mode===`cors`&&(a.username||a.password)&&!j(r,a))return Promise.resolve(n(`cross origin not allowed for request mode "cors"`));if(r.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(n(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(n());if([301,302].includes(i.status)&&r.method===`POST`||i.status===303&&!Me.includes(r.method)){r.method=`GET`,r.body=null;for(let e of ge)r.headersList.delete(e)}j(b(r),a)||(r.headersList.delete(`authorization`,!0),r.headersList.delete(`proxy-authorization`,!0),r.headersList.delete(`cookie`,!0),r.headersList.delete(`host`,!0)),r.body!=null&&(de(r.body.source!=null),r.body=fe(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=O(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),x(r,i),mainFetch(e,!0)}async function httpNetworkOrCacheFetch(e,t=!1,i=!1){let a=e.request,o=null,s=null,c=null;a.window===`no-window`&&a.redirect===`error`?(o=e,s=a):(s=l(a),o={...e},o.request=s);let u=a.credentials===`include`||a.credentials===`same-origin`&&a.responseTainting===`basic`,d=s.body?s.body.length:null,f=null;if(s.body==null&&[`POST`,`PUT`].includes(s.method)&&(f=`0`),d!=null&&(f=te(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,te(s.referrer.href),!0),v(s),w(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,Ne),s.cache==="default"&&(s.headersList.contains(`if-modified-since`,!0)||s.headersList.contains(`if-none-match`,!0)||s.headersList.contains(`if-unmodified-since`,!0)||s.headersList.contains(`if-match`,!0)||s.headersList.contains(`if-range`,!0))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`,!0)&&s.headersList.append(`cache-control`,`max-age=0`,!0),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`,!0)||s.headersList.append(`pragma`,`no-cache`,!0),s.headersList.contains(`cache-control`,!0)||s.headersList.append(`cache-control`,`no-cache`,!0)),s.headersList.contains(`range`,!0)&&s.headersList.append(`accept-encoding`,`identity`,!0),s.headersList.contains(`accept-encoding`,!0)||(I(b(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`,!0):s.headersList.append(`accept-encoding`,`gzip, deflate`,!0)),s.headersList.delete(`host`,!0),s.cache=`no-store`,s.cache!==`no-store`&&s.cache,c==null){if(s.cache===`only-if-cached`)return n(`only if cached`);let e=await httpNetworkFetch(o,u,i);!he.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`,!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?n():M(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(M(e))return r(e);e.controller.connection.destroy(),c=await httpNetworkOrCacheFetch(e,t,!0)}return c}async function httpNetworkFetch(e,t=!1,i=!1){de(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException(`The operation was aborted.`,`AbortError`)))}};let o=e.request,c=null,l=e.timingInfo;o.cache=`no-store`,o.mode;let d=null;if(o.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(o.body!=null){let processBodyChunk=async function*(t){M(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},processEndOfBody=()=>{M(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},processBodyError=t=>{M(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*processBodyChunk(e);processEndOfBody()}catch(e){processBodyError(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await dispatch({body:d});if(o)c=a({status:n,statusText:r,headersList:i,socket:o});else{let o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),c=a({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),r(e,t)):n(t)}let pullAlgorithm=async()=>{await e.controller.resume()},cancelAlgorithm=t=>{M(e)||e.controller.abort(t)},f=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await pullAlgorithm(e)},async cancel(e){await cancelAlgorithm(e)},type:`bytes`});c.body={stream:f,source:null,length:null},e.controller.onAborted=onAborted,e.controller.on(`terminated`,onAborted),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(N(e))break;t=n?void 0:r}catch(r){e.controller.ended&&!l.encodedBodySize?t=void 0:(t=r,n=!0)}if(t===void 0){F(e.controller.controller),finalizeResponse(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}let r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),Ce(f)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function onAborted(t){N(e)?(c.aborted=!0,we(f)&&e.controller.controller.error(e.controller.serializedAbortReason)):we(f)&&e.controller.controller.error(TypeError(`terminated`,{cause:P(t)?t:void 0})),e.controller.connection.destroy()}return c;function dispatch({body:t}){let n=b(o),r=e.controller.dispatcher;return new Promise((i,a)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:o.method,body:r.isMockActive?o.body&&(o.body.source||o.body.stream):t,headers:o.headersList.entries,maxRedirections:0,upgrade:o.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;l.finalConnectionTimingInfo=ie(void 0,l.postRedirectStartTime,e.crossOriginIsolatedCapability),n.destroyed?t(new DOMException(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t),l.finalNetworkRequestStartTime=O(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=O(e.crossOriginIsolatedCapability)},onHeaders(e,t,n,r){if(e<200)return;let c=``,l=new s;for(let e=0;e5)return a(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)),!0;for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n===`x-gzip`||n===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`deflate`)d.push(se({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`br`)d.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{d.length=0;break}}}let p=this.onError.bind(this);return i({status:e,statusText:r,headersList:l,body:d.length?be(this.body,...d,e=>{e&&this.onError(e)}).on(`error`,p):this.body.on(`error`,p)}),!0},onData(t){if(e.controller.dump)return;let n=t;return l.encodedBodySize+=n.byteLength,this.body.push(n)},onComplete(){this.abort&&e.controller.off(`terminated`,this.abort),e.controller.onAborted&&e.controller.off(`terminated`,e.controller.onAborted),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),a(t)},onUpgrade(e,t,n){if(e!==101)return;let r=new s;for(let e=0;e{t.exports={kState:Symbol(`FileReader state`),kResult:Symbol(`FileReader result`),kError:Symbol(`FileReader error`),kLastProgressEventFired:Symbol(`FileReader last progress event fired timestamp`),kEvents:Symbol(`FileReader events`),kAborted:Symbol(`FileReader aborted`)}})),Zt=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),r=Symbol(`ProgressEvent state`);var i=class ProgressEvent extends Event{constructor(e,t={}){e=n.converters.DOMString(e,`ProgressEvent constructor`,`type`),t=n.converters.ProgressEventInit(t??{}),super(e,t),this[r]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return n.brandCheck(this,ProgressEvent),this[r].lengthComputable}get loaded(){return n.brandCheck(this,ProgressEvent),this[r].loaded}get total(){return n.brandCheck(this,ProgressEvent),this[r].total}};n.converters.ProgressEventInit=n.dictionaryConverter([{key:`lengthComputable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`loaded`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`total`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}]),t.exports={ProgressEvent:i}})),Qt=__commonJSMin(((e,t)=>{function getEncoding(e){if(!e)return`failure`;switch(e.trim().toLowerCase()){case`unicode-1-1-utf-8`:case`unicode11utf8`:case`unicode20utf8`:case`utf-8`:case`utf8`:case`x-unicode20utf8`:return`UTF-8`;case`866`:case`cp866`:case`csibm866`:case`ibm866`:return`IBM866`;case`csisolatin2`:case`iso-8859-2`:case`iso-ir-101`:case`iso8859-2`:case`iso88592`:case`iso_8859-2`:case`iso_8859-2:1987`:case`l2`:case`latin2`:return`ISO-8859-2`;case`csisolatin3`:case`iso-8859-3`:case`iso-ir-109`:case`iso8859-3`:case`iso88593`:case`iso_8859-3`:case`iso_8859-3:1988`:case`l3`:case`latin3`:return`ISO-8859-3`;case`csisolatin4`:case`iso-8859-4`:case`iso-ir-110`:case`iso8859-4`:case`iso88594`:case`iso_8859-4`:case`iso_8859-4:1988`:case`l4`:case`latin4`:return`ISO-8859-4`;case`csisolatincyrillic`:case`cyrillic`:case`iso-8859-5`:case`iso-ir-144`:case`iso8859-5`:case`iso88595`:case`iso_8859-5`:case`iso_8859-5:1988`:return`ISO-8859-5`;case`arabic`:case`asmo-708`:case`csiso88596e`:case`csiso88596i`:case`csisolatinarabic`:case`ecma-114`:case`iso-8859-6`:case`iso-8859-6-e`:case`iso-8859-6-i`:case`iso-ir-127`:case`iso8859-6`:case`iso88596`:case`iso_8859-6`:case`iso_8859-6:1987`:return`ISO-8859-6`;case`csisolatingreek`:case`ecma-118`:case`elot_928`:case`greek`:case`greek8`:case`iso-8859-7`:case`iso-ir-126`:case`iso8859-7`:case`iso88597`:case`iso_8859-7`:case`iso_8859-7:1987`:case`sun_eu_greek`:return`ISO-8859-7`;case`csiso88598e`:case`csisolatinhebrew`:case`hebrew`:case`iso-8859-8`:case`iso-8859-8-e`:case`iso-ir-138`:case`iso8859-8`:case`iso88598`:case`iso_8859-8`:case`iso_8859-8:1988`:case`visual`:return`ISO-8859-8`;case`csiso88598i`:case`iso-8859-8-i`:case`logical`:return`ISO-8859-8-I`;case`csisolatin6`:case`iso-8859-10`:case`iso-ir-157`:case`iso8859-10`:case`iso885910`:case`l6`:case`latin6`:return`ISO-8859-10`;case`iso-8859-13`:case`iso8859-13`:case`iso885913`:return`ISO-8859-13`;case`iso-8859-14`:case`iso8859-14`:case`iso885914`:return`ISO-8859-14`;case`csisolatin9`:case`iso-8859-15`:case`iso8859-15`:case`iso885915`:case`iso_8859-15`:case`l9`:return`ISO-8859-15`;case`iso-8859-16`:return`ISO-8859-16`;case`cskoi8r`:case`koi`:case`koi8`:case`koi8-r`:case`koi8_r`:return`KOI8-R`;case`koi8-ru`:case`koi8-u`:return`KOI8-U`;case`csmacintosh`:case`mac`:case`macintosh`:case`x-mac-roman`:return`macintosh`;case`iso-8859-11`:case`iso8859-11`:case`iso885911`:case`tis-620`:case`windows-874`:return`windows-874`;case`cp1250`:case`windows-1250`:case`x-cp1250`:return`windows-1250`;case`cp1251`:case`windows-1251`:case`x-cp1251`:return`windows-1251`;case`ansi_x3.4-1968`:case`ascii`:case`cp1252`:case`cp819`:case`csisolatin1`:case`ibm819`:case`iso-8859-1`:case`iso-ir-100`:case`iso8859-1`:case`iso88591`:case`iso_8859-1`:case`iso_8859-1:1987`:case`l1`:case`latin1`:case`us-ascii`:case`windows-1252`:case`x-cp1252`:return`windows-1252`;case`cp1253`:case`windows-1253`:case`x-cp1253`:return`windows-1253`;case`cp1254`:case`csisolatin5`:case`iso-8859-9`:case`iso-ir-148`:case`iso8859-9`:case`iso88599`:case`iso_8859-9`:case`iso_8859-9:1989`:case`l5`:case`latin5`:case`windows-1254`:case`x-cp1254`:return`windows-1254`;case`cp1255`:case`windows-1255`:case`x-cp1255`:return`windows-1255`;case`cp1256`:case`windows-1256`:case`x-cp1256`:return`windows-1256`;case`cp1257`:case`windows-1257`:case`x-cp1257`:return`windows-1257`;case`cp1258`:case`windows-1258`:case`x-cp1258`:return`windows-1258`;case`x-mac-cyrillic`:case`x-mac-ukrainian`:return`x-mac-cyrillic`;case`chinese`:case`csgb2312`:case`csiso58gb231280`:case`gb2312`:case`gb_2312`:case`gb_2312-80`:case`gbk`:case`iso-ir-58`:case`x-gbk`:return`GBK`;case`gb18030`:return`gb18030`;case`big5`:case`big5-hkscs`:case`cn-big5`:case`csbig5`:case`x-x-big5`:return`Big5`;case`cseucpkdfmtjapanese`:case`euc-jp`:case`x-euc-jp`:return`EUC-JP`;case`csiso2022jp`:case`iso-2022-jp`:return`ISO-2022-JP`;case`csshiftjis`:case`ms932`:case`ms_kanji`:case`shift-jis`:case`shift_jis`:case`sjis`:case`windows-31j`:case`x-sjis`:return`Shift_JIS`;case`cseuckr`:case`csksc56011987`:case`euc-kr`:case`iso-ir-149`:case`korean`:case`ks_c_5601-1987`:case`ks_c_5601-1989`:case`ksc5601`:case`ksc_5601`:case`windows-949`:return`EUC-KR`;case`csiso2022kr`:case`hz-gb-2312`:case`iso-2022-cn`:case`iso-2022-cn-ext`:case`iso-2022-kr`:case`replacement`:return`replacement`;case`unicodefffe`:case`utf-16be`:return`UTF-16BE`;case`csunicode`:case`iso-10646-ucs-2`:case`ucs-2`:case`unicode`:case`unicodefeff`:case`utf-16`:case`utf-16le`:return`UTF-16LE`;case`x-user-defined`:return`x-user-defined`;default:return`failure`}}t.exports={getEncoding}})),$t=__commonJSMin(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Xt(),{ProgressEvent:s}=Zt(),{getEncoding:c}=Qt(),{serializeAMimeType:l,parseMIMEType:u}=Qe(),{types:d}=R(`node:util`),{StringDecoder:f}=R(`string_decoder`),{btoa:p}=R(`node:buffer`),h={enumerable:!0,writable:!1,configurable:!1};function readOperation(e,t,s,c){if(e[n]===`loading`)throw new DOMException(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let l=t.stream().getReader(),u=[],f=l.read(),p=!0;(async()=>{for(;!e[a];)try{let{done:h,value:g}=await f;if(p&&!e[a]&&queueMicrotask(()=>{fireAProgressEvent(`loadstart`,e)}),p=!1,!h&&d.isUint8Array(g))u.push(g),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{fireAProgressEvent(`progress`,e)})),f=l.read();else if(h){queueMicrotask(()=>{e[n]=`done`;try{let n=packageData(u,s,t.type,c);if(e[a])return;e[i]=n,fireAProgressEvent(`load`,e)}catch(t){e[r]=t,fireAProgressEvent(`error`,e)}e[n]!==`loading`&&fireAProgressEvent(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,fireAProgressEvent(`error`,e),e[n]!==`loading`&&fireAProgressEvent(`loadend`,e)});break}})()}function fireAProgressEvent(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function packageData(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=u(n||`application/octet-stream`);r!==`failure`&&(t+=l(r)),t+=`;base64,`;let i=new f(`latin1`);for(let n of e)t+=p(i.write(n));return t+=p(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=u(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),decode(e,t)}case`ArrayBuffer`:return combineByteSequences(e).buffer;case`BinaryString`:{let t=``,n=new f(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function decode(e,t){let n=combineByteSequences(e),r=BOMSniffing(n),i=0;r!==null&&(t=r,i=r===`UTF-8`?3:2);let a=n.slice(i);return new TextDecoder(t).decode(a)}function BOMSniffing(e){let[t,n,r]=e;return t===239&&n===187&&r===191?`UTF-8`:t===254&&n===255?`UTF-16BE`:t===255&&n===254?`UTF-16LE`:null}function combineByteSequences(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=0;return e.reduce((e,t)=>(e.set(t,n),n+=t.byteLength,e),new Uint8Array(t))}t.exports={staticPropertyDescriptors:h,readOperation,fireAProgressEvent}})),en=__commonJSMin(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=$t(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Xt(),{webidl:u}=$e(),{kEnumerableProperty:d}=z();var f=class FileReader extends EventTarget{constructor(){super(),this[a]=`empty`,this[s]=null,this[o]=null,this[c]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`ArrayBuffer`)}readAsBinaryString(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`BinaryString`)}readAsText(e,t=void 0){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),e=u.converters.Blob(e,{strict:!1}),t!==void 0&&(t=u.converters.DOMString(t,`FileReader.readAsText`,`encoding`)),r(this,e,`Text`,t)}readAsDataURL(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`DataURL`)}abort(){if(this[a]===`empty`||this[a]===`done`){this[s]=null;return}this[a]===`loading`&&(this[a]=`done`,this[s]=null),this[l]=!0,i(`abort`,this),this[a]!==`loading`&&i(`loadend`,this)}get readyState(){switch(u.brandCheck(this,FileReader),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,FileReader),this[s]}get error(){return u.brandCheck(this,FileReader),this[o]}get onloadend(){return u.brandCheck(this,FileReader),this[c].loadend}set onloadend(e){u.brandCheck(this,FileReader),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof e==`function`?(this[c].loadend=e,this.addEventListener(`loadend`,e)):this[c].loadend=null}get onerror(){return u.brandCheck(this,FileReader),this[c].error}set onerror(e){u.brandCheck(this,FileReader),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof e==`function`?(this[c].error=e,this.addEventListener(`error`,e)):this[c].error=null}get onloadstart(){return u.brandCheck(this,FileReader),this[c].loadstart}set onloadstart(e){u.brandCheck(this,FileReader),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof e==`function`?(this[c].loadstart=e,this.addEventListener(`loadstart`,e)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,FileReader),this[c].progress}set onprogress(e){u.brandCheck(this,FileReader),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof e==`function`?(this[c].progress=e,this.addEventListener(`progress`,e)):this[c].progress=null}get onload(){return u.brandCheck(this,FileReader),this[c].load}set onload(e){u.brandCheck(this,FileReader),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof e==`function`?(this[c].load=e,this.addEventListener(`load`,e)):this[c].load=null}get onabort(){return u.brandCheck(this,FileReader),this[c].abort}set onabort(e){u.brandCheck(this,FileReader),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof e==`function`?(this[c].abort=e,this.addEventListener(`abort`,e)):this[c].abort=null}};f.EMPTY=f.prototype.EMPTY=0,f.LOADING=f.prototype.LOADING=1,f.DONE=f.prototype.DONE=2,Object.defineProperties(f.prototype,{EMPTY:n,LOADING:n,DONE:n,readAsArrayBuffer:d,readAsBinaryString:d,readAsText:d,readAsDataURL:d,abort:d,readyState:d,result:d,error:d,onloadstart:d,onprogress:d,onload:d,onabort:d,onerror:d,onloadend:d,[Symbol.toStringTag]:{value:`FileReader`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(f,{EMPTY:n,LOADING:n,DONE:n}),t.exports={FileReader:f}})),tn=__commonJSMin(((e,t)=>{t.exports={kConstruct:Ie().kConstruct}})),nn=__commonJSMin(((e,t)=>{let n=R(`node:assert`),{URLSerializer:r}=Qe(),{isValidHeaderName:i}=et();function urlEquals(e,t,n=!1){return r(e,n)===r(t,n)}function getFieldValues(e){n(e!==null);let t=[];for(let n of e.split(`,`))n=n.trim(),i(n)&&t.push(n);return t}t.exports={urlEquals,getFieldValues}})),rn=__commonJSMin(((e,t)=>{let{kConstruct:n}=tn(),{urlEquals:r,getFieldValues:i}=nn(),{kEnumerableProperty:a,isDisturbed:o}=z(),{webidl:s}=$e(),{Response:c,cloneResponse:l,fromInnerResponse:u}=Kt(),{Request:d,fromInnerRequest:f}=Jt(),{kState:p}=tt(),{fetching:h}=Yt(),{urlIsHttpHttpsScheme:g,createDeferredPromise:v,readAllBytes:y}=et(),b=R(`node:assert`);var x=class Cache{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,t={}){s.brandCheck(this,Cache);let n=`Cache.match`;s.argumentLengthCheck(arguments,1,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.CacheQueryOptions(t,n,`options`);let r=this.#i(e,t,1);if(r.length!==0)return r[0]}async matchAll(e=void 0,t={}){s.brandCheck(this,Cache);let n=`Cache.matchAll`;return e!==void 0&&(e=s.converters.RequestInfo(e,n,`request`)),t=s.converters.CacheQueryOptions(t,n,`options`),this.#i(e,t)}async add(e){s.brandCheck(this,Cache);let t=`Cache.add`;s.argumentLengthCheck(arguments,1,t),e=s.converters.RequestInfo(e,t,`request`);let n=[e];return await this.addAll(n)}async addAll(e){s.brandCheck(this,Cache);let t=`Cache.addAll`;s.argumentLengthCheck(arguments,1,t);let n=[],r=[];for(let n of e){if(n===void 0)throw s.errors.conversionFailed({prefix:t,argument:`Argument 1`,types:[`undefined is not allowed`]});if(n=s.converters.RequestInfo(n),typeof n==`string`)continue;let e=n[p];if(!g(e.url)||e.method!==`GET`)throw s.errors.exception({header:t,message:`Expected http/s scheme when method is not GET.`})}let a=[];for(let o of e){let e=new d(o)[p];if(!g(e.url))throw s.errors.exception({header:t,message:`Expected http/s scheme.`});e.initiator=`fetch`,e.destination=`subresource`,r.push(e);let c=v();a.push(h({request:e,processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)c.reject(s.errors.exception({header:`Cache.addAll`,message:`Received an invalid status code or the request failed.`}));else if(e.headersList.contains(`vary`)){let t=i(e.headersList.get(`vary`));for(let e of t)if(e===`*`){c.reject(s.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of a)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),n.push(c.promise)}let o=await Promise.all(n),c=[],l=0;for(let e of o){let t={type:`put`,request:r[l],response:e};c.push(t),l++}let u=v(),f=null;try{this.#t(c)}catch(e){f=e}return queueMicrotask(()=>{f===null?u.resolve(void 0):u.reject(f)}),u.promise}async put(e,t){s.brandCheck(this,Cache);let n=`Cache.put`;s.argumentLengthCheck(arguments,2,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.Response(t,n,`response`);let r=null;if(r=e instanceof d?e[p]:new d(e)[p],!g(r.url)||r.method!==`GET`)throw s.errors.exception({header:n,message:`Expected an http/s scheme when method is not GET`});let a=t[p];if(a.status===206)throw s.errors.exception({header:n,message:`Got 206 status`});if(a.headersList.contains(`vary`)){let e=i(a.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:n,message:`Got * vary field value`})}if(a.body&&(o(a.body.stream)||a.body.stream.locked))throw s.errors.exception({header:n,message:`Response body is locked or disturbed`});let c=l(a),u=v();if(a.body!=null){let e=a.body.stream.getReader();y(e).then(u.resolve,u.reject)}else u.resolve(void 0);let f=[],h={type:`put`,request:r,response:c};f.push(h);let b=await u.promise;c.body!=null&&(c.body.source=b);let x=v(),S=null;try{this.#t(f)}catch(e){S=e}return queueMicrotask(()=>{S===null?x.resolve():x.reject(S)}),x.promise}async delete(e,t={}){s.brandCheck(this,Cache);let n=`Cache.delete`;s.argumentLengthCheck(arguments,1,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.CacheQueryOptions(t,n,`options`);let r=null;if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return!1}else b(typeof e==`string`),r=new d(e)[p];let i=[],a={type:`delete`,request:r,options:t};i.push(a);let o=v(),c=null,l;try{l=this.#t(i)}catch(e){c=e}return queueMicrotask(()=>{c===null?o.resolve(!!l?.length):o.reject(c)}),o.promise}async keys(e=void 0,t={}){s.brandCheck(this,Cache);let n=`Cache.keys`;e!==void 0&&(e=s.converters.RequestInfo(e,n,`request`)),t=s.converters.CacheQueryOptions(t,n,`options`);let r=null;if(e!==void 0){if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p])}let i=v(),a=[];if(e===void 0)for(let e of this.#e)a.push(e[0]);else{let e=this.#n(r,t);for(let t of e)a.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of a){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}i.resolve(Object.freeze(e))}),i.promise}#t(e){let t=this.#e,n=[...t],r=[],i=[];try{for(let n of e){if(n.type!==`delete`&&n.type!==`put`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`delete operation should not have an associated response`});if(this.#n(n.request,n.options,r).length)throw new DOMException(`???`,`InvalidStateError`);let e;if(n.type===`delete`){if(e=this.#n(n.request,n.options),e.length===0)return[];for(let n of e){let e=t.indexOf(n);b(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!g(i.url))throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`options must not be defined`});e=this.#n(n.request);for(let n of e){let e=t.indexOf(n);b(e!==-1),t.splice(e,1)}t.push([n.request,n.response]),r.push([n.request,n.response])}i.push([n.request,n.response])}return i}catch(e){throw this.#e.length=0,this.#e=n,e}}#n(e,t,n){let r=[],i=n??this.#e;for(let n of i){let[i,a]=n;this.#r(e,i,a,t)&&r.push(n)}return r}#r(e,t,n=null,a){let o=new URL(e.url),s=new URL(t.url);if(a?.ignoreSearch&&(s.search=``,o.search=``),!r(o,s,!0))return!1;if(n==null||a?.ignoreVary||!n.headersList.contains(`vary`))return!0;let c=i(n.headersList.get(`vary`));for(let n of c)if(n===`*`||t.headersList.get(n)!==e.headersList.get(n))return!1;return!0}#i(e,t,n=1/0){let r=null;if(e!==void 0){if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p])}let i=[];if(e===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,t);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=u(e,`immutable`);if(a.push(t.clone()),a.length>=n)break}return Object.freeze(a)}};Object.defineProperties(x.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let S=[{key:`ignoreSearch`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreMethod`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreVary`,converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.CacheQueryOptions=s.dictionaryConverter(S),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...S,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:x}})),an=__commonJSMin(((e,t)=>{let{kConstruct:n}=tn(),{Cache:r}=rn(),{webidl:i}=$e(),{kEnumerableProperty:a}=z();var o=class CacheStorage{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(e,t={}){if(i.brandCheck(this,CacheStorage),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),e=i.converters.RequestInfo(e),t=i.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let i=this.#e.get(t.cacheName);return await new r(n,i).match(e,t)}}else for(let i of this.#e.values()){let a=await new r(n,i).match(e,t);if(a!==void 0)return a}}async has(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.has(e)}async open(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.has(e)){let t=this.#e.get(e);return new r(n,t)}let a=[];return this.#e.set(e,a),new r(n,a)}async delete(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.delete(e)}async keys(){return i.brandCheck(this,CacheStorage),[...this.#e.keys()]}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CacheStorage`,configurable:!0},match:a,has:a,open:a,delete:a,keys:a}),t.exports={CacheStorage:o}})),on=__commonJSMin(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),sn=__commonJSMin(((e,t)=>{function isCTLExcludingHtab(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function validateCookieName(e){for(let t=0;t126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw Error(`Invalid cookie name`)}}function validateCookieValue(e){let t=e.length,n=0;if(e[0]===`"`){if(t===1||e[t-1]!==`"`)throw Error(`Invalid cookie value`);--t,++n}for(;n126||t===34||t===44||t===59||t===92)throw Error(`Invalid cookie value`)}}function validateCookiePath(e){for(let t=0;t126||n===59)throw Error(`Invalid cookie path`)}}function isLetterOrDigit(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function validateCookieDomain(e){if(e===` `)return;if(e.length>255)throw Error(`Invalid cookie domain`);let t=0;for(let n=0;n63)throw Error(`Invalid cookie domain`)}if(t===0||e.charCodeAt(e.length-1)===45)throw Error(`Invalid cookie domain`)}let n=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],r=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],i=Array(61).fill(0).map((e,t)=>t.toString().padStart(2,`0`));function toIMFDate(e){return typeof e==`number`&&(e=new Date(e)),`${n[e.getUTCDay()]}, ${i[e.getUTCDate()]} ${r[e.getUTCMonth()]} ${e.getUTCFullYear()} ${i[e.getUTCHours()]}:${i[e.getUTCMinutes()]}:${i[e.getUTCSeconds()]} GMT`}function validateCookieMaxAge(e){if(e<0)throw Error(`Invalid cookie max-age`)}function stringify(e){if(e.name.length===0)return null;validateCookieName(e.name),validateCookieValue(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith(`__Secure-`)&&(e.secure=!0),e.name.startsWith(`__Host-`)&&(e.secure=!0,e.domain=null,e.path=`/`),e.secure&&t.push(`Secure`),e.httpOnly&&t.push(`HttpOnly`),typeof e.maxAge==`number`&&(validateCookieMaxAge(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(validateCookieDomain(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(validateCookiePath(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${toIMFDate(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes(`=`))throw Error(`Invalid unparsed`);let[e,...r]=n.split(`=`),i=e.trim(),a=r.join(`=`);validateCookieName(i),validateCookieValue(a),t.push(`${i}=${a}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab,validateCookieName,validateCookiePath,validateCookieValue,toIMFDate,stringify}})),cn=__commonJSMin(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=on(),{isCTLExcludingHtab:i}=sn(),{collectASequenceOfCodePointsFast:a}=Qe(),o=R(`node:assert`);function parseSetCookie(e){if(i(e))return null;let t=``,r=``,o=``,s=``;if(e.includes(`;`)){let n={position:0};t=a(`;`,e,n),r=e.slice(n.position)}else t=e;if(!t.includes(`=`))s=t;else{let e={position:0};o=a(`=`,t,e),s=t.slice(e.position+1)}return o=o.trim(),s=s.trim(),o.length+s.length>n?null:{name:o,value:s,...parseUnparsedAttributes(r)}}function parseUnparsedAttributes(e,t={}){if(e.length===0)return t;o(e[0]===`;`),e=e.slice(1);let n=``;e.includes(`;`)?(n=a(`;`,e,{position:0}),e=e.slice(n.length)):(n=e,e=``);let i=``,s=``;if(n.includes(`=`)){let e={position:0};i=a(`=`,n,e),s=n.slice(e.position+1)}else i=n;if(i=i.trim(),s=s.trim(),s.length>r)return parseUnparsedAttributes(e,t);let c=i.toLowerCase();if(c===`expires`)t.expires=new Date(s);else if(c===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return parseUnparsedAttributes(e,t);t.maxAge=Number(s)}else if(c===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(c===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(c===`secure`)t.secure=!0;else if(c===`httponly`)t.httpOnly=!0;else if(c===`samesite`){let e=s.toLowerCase();e===`none`?t.sameSite=`None`:e===`strict`?t.sameSite=`Strict`:e===`lax`&&(t.sameSite=`Lax`)}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return parseUnparsedAttributes(e,t)}t.exports={parseSetCookie,parseUnparsedAttributes}})),ln=__commonJSMin(((e,t)=>{let{parseSetCookie:n}=cn(),{stringify:r}=sn(),{webidl:i}=$e(),{Headers:a}=Gt();function getCookies(e){i.argumentLengthCheck(arguments,1,`getCookies`),i.brandCheck(e,a,{strict:!1});let t=e.get(`cookie`),n={};if(!t)return n;for(let e of t.split(`;`)){let[t,...r]=e.split(`=`);n[t.trim()]=r.join(`=`)}return n}function deleteCookie(e,t,n){i.brandCheck(e,a,{strict:!1});let r=`deleteCookie`;i.argumentLengthCheck(arguments,2,r),t=i.converters.DOMString(t,r,`name`),n=i.converters.DeleteCookieAttributes(n),setCookie(e,{name:t,value:``,expires:new Date(0),...n})}function getSetCookies(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function setCookie(e,t){i.argumentLengthCheck(arguments,2,`setCookie`),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t);let n=r(t);n&&e.append(`Set-Cookie`,n)}i.converters.DeleteCookieAttributes=i.dictionaryConverter([{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null}]),i.converters.Cookie=i.dictionaryConverter([{converter:i.converters.DOMString,key:`name`},{converter:i.converters.DOMString,key:`value`},{converter:i.nullableConverter(e=>typeof e==`number`?i.converters[`unsigned long long`](e):new Date(e)),key:`expires`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters[`long long`]),key:`maxAge`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`secure`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`httpOnly`,defaultValue:()=>null},{converter:i.converters.USVString,key:`sameSite`,allowedValues:[`Strict`,`Lax`,`None`]},{converter:i.sequenceConverter(i.converters.DOMString),key:`unparsed`,defaultValue:()=>[]}]),t.exports={getCookies,deleteCookie,getSetCookies,setCookie}})),un=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),{kEnumerableProperty:r}=z(),{kConstruct:i}=Ie(),{MessagePort:a}=R(`node:worker_threads`);var o=class MessageEvent extends Event{#e;constructor(e,t={}){if(e===i){super(arguments[1],arguments[2]),n.util.markAsUncloneable(this);return}let r=`MessageEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.MessageEventInit(t,r,`eventInitDict`),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get data(){return n.brandCheck(this,MessageEvent),this.#e.data}get origin(){return n.brandCheck(this,MessageEvent),this.#e.origin}get lastEventId(){return n.brandCheck(this,MessageEvent),this.#e.lastEventId}get source(){return n.brandCheck(this,MessageEvent),this.#e.source}get ports(){return n.brandCheck(this,MessageEvent),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,r=!1,i=null,a=``,o=``,s=null,c=[]){return n.brandCheck(this,MessageEvent),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new MessageEvent(e,{bubbles:t,cancelable:r,data:i,origin:a,lastEventId:o,source:s,ports:c})}static createFastMessageEvent(e,t){let n=new MessageEvent(i,e,t);return n.#e=t,n.#e.data??=null,n.#e.origin??=``,n.#e.lastEventId??=``,n.#e.source??=null,n.#e.ports??=[],n}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class CloseEvent extends Event{#e;constructor(e,t={}){let r=`CloseEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get wasClean(){return n.brandCheck(this,CloseEvent),this.#e.wasClean}get code(){return n.brandCheck(this,CloseEvent),this.#e.code}get reason(){return n.brandCheck(this,CloseEvent),this.#e.reason}},l=class ErrorEvent extends Event{#e;constructor(e,t){let r=`ErrorEvent constructor`;n.argumentLengthCheck(arguments,1,r),super(e,t),n.util.markAsUncloneable(this),e=n.converters.DOMString(e,r,`type`),t=n.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return n.brandCheck(this,ErrorEvent),this.#e.message}get filename(){return n.brandCheck(this,ErrorEvent),this.#e.filename}get lineno(){return n.brandCheck(this,ErrorEvent),this.#e.lineno}get colno(){return n.brandCheck(this,ErrorEvent),this.#e.colno}get error(){return n.brandCheck(this,ErrorEvent),this.#e.error}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(l.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(a),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let u=[{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}];n.converters.MessageEventInit=n.dictionaryConverter([...u,{key:`data`,converter:n.converters.any,defaultValue:()=>null},{key:`origin`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lastEventId`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`source`,converter:n.nullableConverter(n.converters.MessagePort),defaultValue:()=>null},{key:`ports`,converter:n.converters[`sequence`],defaultValue:()=>[]}]),n.converters.CloseEventInit=n.dictionaryConverter([...u,{key:`wasClean`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`code`,converter:n.converters[`unsigned short`],defaultValue:()=>0},{key:`reason`,converter:n.converters.USVString,defaultValue:()=>``}]),n.converters.ErrorEventInit=n.dictionaryConverter([...u,{key:`message`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`filename`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lineno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`colno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`error`,converter:n.converters.any}]),t.exports={MessageEvent:o,CloseEvent:c,ErrorEvent:l,createFastMessageEvent:s}})),dn=__commonJSMin(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,sentCloseFrameState:{NOT_SENT:0,PROCESSING:1,SENT:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:2**16-1,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{string:1,typedArray:2,arrayBuffer:3,blob:4}}})),fn=__commonJSMin(((e,t)=>{t.exports={kWebSocketURL:Symbol(`url`),kReadyState:Symbol(`ready state`),kController:Symbol(`controller`),kResponse:Symbol(`response`),kBinaryType:Symbol(`binary type`),kSentClose:Symbol(`sent close`),kReceivedClose:Symbol(`received close`),kByteParser:Symbol(`byte parser`)}})),pn=__commonJSMin(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=fn(),{states:s,opcodes:c}=dn(),{ErrorEvent:l,createFastMessageEvent:u}=un(),{isUtf8:d}=R(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=Qe();function isConnecting(e){return e[n]===s.CONNECTING}function isEstablished(e){return e[n]===s.OPEN}function isClosing(e){return e[n]===s.CLOSING}function isClosed(e){return e[n]===s.CLOSED}function fireEvent(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function websocketMessageReceived(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=v(r)}catch{failWebsocketConnection(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):toArrayBuffer(r));fireEvent(`message`,e,u,{origin:e[o].origin,data:i})}function toArrayBuffer(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function isValidSubprotocol(e){if(e.length===0)return!1;for(let t=0;t126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function isValidStatusCode(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function failWebsocketConnection(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&fireEvent(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function isControlFrame(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function isContinuationFrame(e){return e===c.CONTINUATION}function isTextBinaryFrame(e){return e===c.TEXT||e===c.BINARY}function isValidOpcode(e){return isTextBinaryFrame(e)||isContinuationFrame(e)||isControlFrame(e)}function parseExtensions(e){let t={position:0},n=new Map;for(;t.position57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}let h=typeof process.versions.icu==`string`,g=h?new TextDecoder(`utf-8`,{fatal:!0}):void 0,v=h?g.decode.bind(g):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting,isEstablished,isClosing,isClosed,fireEvent,isValidSubprotocol,isValidStatusCode,failWebsocketConnection,websocketMessageReceived,utf8Decode:v,isControlFrame,isContinuationFrame,isTextBinaryFrame,isValidOpcode,parseExtensions,isValidClientWindowBits}})),mn=__commonJSMin(((e,t)=>{let{maxUnsigned16Bit:n}=dn(),r=16386,i,a=null,o=r;try{i=R(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;t{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=Le(),i=gt();getGlobalDispatcher()===void 0&&setGlobalDispatcher(new i);function setGlobalDispatcher(e){if(!e||typeof e.dispatch!=`function`)throw new r(`Argument agent must implement Agent`);Object.defineProperty(globalThis,n,{value:e,writable:!0,enumerable:!1,configurable:!1})}function getGlobalDispatcher(){return globalThis[n]}t.exports={setGlobalDispatcher,getGlobalDispatcher}})),Bt=__commonJSMin(((e,t)=>{t.exports=class{#e;constructor(e){if(typeof e!=`object`||!e)throw TypeError(`handler must be an object`);this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}})),Vt=__commonJSMin(((e,t)=>{let n=ct();t.exports=e=>{let t=e?.maxRedirections;return e=>function(r,i){let{maxRedirections:a=t,...o}=r;return a?e(o,new n(e,a,r,i)):e(r,i)}}})),Ht=__commonJSMin(((e,t)=>{let n=yt();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),Ut=__commonJSMin(((e,t)=>{let n=z(),{InvalidArgumentError:r,RequestAbortedError:i}=Le(),a=Bt();var DumpHandler=class extends a{#e=1048576;#t=null;#n=!1;#r=!1;#i=0;#a=null;#o=null;constructor({maxSize:e},t){if(super(t),e!=null&&(!Number.isFinite(e)||e<1))throw new r(`maxSize must be a number greater than 0`);this.#e=e??this.#e,this.#o=t}onConnect(e){this.#t=e,this.#o.onConnect(this.#s.bind(this))}#s(e){this.#r=!0,this.#a=e}onHeaders(e,t,r,a){let o=n.parseHeaders(t)[`content-length`];if(o!=null&&o>this.#e)throw new i(`Response size (${o}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#o.onHeaders(e,t,r,a)}onError(e){this.#n||(e=this.#a??e,this.#o.onError(e))}onData(e){return this.#i+=e.length,this.#i>=this.#e&&(this.#n=!0,this.#r?this.#o.onError(this.#a):this.#o.onComplete([])),!0}onComplete(e){if(!this.#n){if(this.#r){this.#o.onError(this.reason);return}this.#o.onComplete(e)}}};function createDumpInterceptor({maxSize:e}={maxSize:1048576}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new DumpHandler({maxSize:i},r))}}t.exports=createDumpInterceptor})),Wt=__commonJSMin(((e,t)=>{let{isIP:n}=R(`node:net`),{lookup:r}=R(`node:dns`),i=Bt(),{InvalidArgumentError:a,InformationalError:o}=Le(),s=2**31-1;var DNSInstance=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#i}get full(){return this.#n.size===this.#t}runLookup(e,t,n){let r=this.#n.get(e.hostname);if(r==null&&this.full){n(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(e,i,(t,r)=>{if(t||r==null||r.length===0){n(t??new o(`No DNS entries found`));return}this.setRecords(e,r);let a=this.#n.get(e.hostname),s=this.pick(e,a,i.affinity),c;c=typeof s.port==`number`?`:${s.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${s.family===6?`[${s.address}]`:s.address}${c}`)});else{let a=this.pick(e,r,i.affinity);if(a==null){this.#n.delete(e.hostname),this.runLookup(e,t,n);return}let o;o=typeof a.port==`number`?`:${a.port}`:e.port===``?``:`:${e.port}`,n(null,`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`)}}#r(e,t,n){r(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:`ipv4first`},(e,t)=>{if(e)return n(e);let r=new Map;for(let e of t)r.set(`${e.address}:${e.family}`,e);n(null,r.values())})}#i(e,t,n){let r=null,{records:i,offset:a}=t,o;if(this.dualStack?(n??(a==null||a===s?(t.offset=0,n=4):(t.offset++,n=(t.offset&1)==1?6:4)),o=i[n]!=null&&i[n].ips.length>0?i[n]:i[n===4?6:4]):o=i[n],o==null||o.ips.length===0)return r;o.offset==null||o.offset===s?o.offset=0:o.offset++;let c=o.offset%o.ips.length;return r=o.ips[c]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(o.ips.splice(c,1),this.pick(e,t,n)):r}setRecords(e,t){let n=Date.now(),r={records:{4:null,6:null}};for(let e of t){e.timestamp=n,e.ttl=typeof e.ttl==`number`?Math.min(e.ttl,this.#e):this.#e;let t=r.records[e.family]??{ips:[]};t.ips.push(e),r.records[e.family]=t}this.#n.set(e.hostname,r)}getHandler(e,t){return new DNSDispatchHandler(this,e,t)}},DNSDispatchHandler=class extends i{#e=null;#t=null;#n=null;#r=null;#i=null;constructor(e,{origin:t,handler:n,dispatch:r},i){super(n),this.#i=t,this.#r=n,this.#t={...i},this.#e=e,this.#n=r}onError(e){switch(e.code){case`ETIMEDOUT`:case`ECONNREFUSED`:if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(e,t)=>{if(e)return this.#r.onError(e);let n={...this.#t,origin:t};this.#n(n,this)});return}this.#r.onError(e);return;case`ENOTFOUND`:this.#e.deleteRecord(this.#i);default:this.#r.onError(e)}}};t.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!=`number`||e?.maxTTL<0))throw new a(`Invalid maxTTL. Must be a positive number`);if(e?.maxItems!=null&&(typeof e?.maxItems!=`number`||e?.maxItems<1))throw new a(`Invalid maxItems. Must be a positive number and greater than zero`);if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new a(`Invalid affinity. Must be either 4 or 6`);if(e?.dualStack!=null&&typeof e?.dualStack!=`boolean`)throw new a(`Invalid dualStack. Must be a boolean`);if(e?.lookup!=null&&typeof e?.lookup!=`function`)throw new a(`Invalid lookup. Must be a function`);if(e?.pick!=null&&typeof e?.pick!=`function`)throw new a(`Invalid pick. Must be a function`);let t=e?.dualStack??!0,r;r=t?e?.affinity??null:e?.affinity??4;let i=new DNSInstance({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:r,maxItems:e?.maxItems??1/0});return e=>function(t,r){let a=t.origin.constructor===URL?t.origin:new URL(t.origin);return n(a.hostname)===0?(i.runLookup(a,t,(n,o)=>{if(n)return r.onError(n);let s=null;s={...t,servername:a.hostname,origin:o,headers:{host:a.hostname,...t.headers}},e(s,i.getHandler({origin:a,dispatch:e,handler:r},t))}),!0):e(t,r)}}})),Gt=__commonJSMin(((e,t)=>{let{kConstruct:n}=Ie(),{kEnumerableProperty:r}=z(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=et(),{webidl:s}=$e(),c=R(`node:assert`),l=R(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function isHTTPWhiteSpaceCharCode(e){return e===10||e===13||e===9||e===32}function headerValueNormalize(e){let t=0,n=e.length;for(;n>t&&isHTTPWhiteSpaceCharCode(e.charCodeAt(n-1));)--n;for(;n>t&&isHTTPWhiteSpaceCharCode(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function fill(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function appendHeader(e,t,n){if(n=headerValueNormalize(n),!a(t))throw s.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:`Headers.append`,value:n,type:`header value`});if(h(e)===`immutable`)throw TypeError(`immutable`);return v(e).append(t,n,!1)}function compareHeaderName(e,t){return e[0]>1),t[s][0]<=l[0]?o=s+1:a=s;if(r!==s){for(i=r;i>o;)t[i]=t[--i];t[o]=l}}if(!n.next().done)throw TypeError(`Unreachable`);return t}{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(compareHeaderName)}}},p=class Headers{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new f,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),fill(this,e)))}append(e,t){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,2,`Headers.append`);let n=`Headers.append`;return e=s.converters.ByteString(e,n,`name`),t=s.converters.ByteString(t,n,`value`),appendHeader(this,e,t)}delete(e){if(s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.delete`),e=s.converters.ByteString(e,`Headers.delete`,`name`),!a(e))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:e,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.get`);let t=`Headers.get`;if(e=s.converters.ByteString(e,t,`name`),!a(e))throw s.errors.invalidArgument({prefix:t,value:e,type:`header name`});return this.#t.get(e,!1)}has(e){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,1,`Headers.has`);let t=`Headers.has`;if(e=s.converters.ByteString(e,t,`name`),!a(e))throw s.errors.invalidArgument({prefix:t,value:e,type:`header name`});return this.#t.contains(e,!1)}set(e,t){s.brandCheck(this,Headers),s.argumentLengthCheck(arguments,2,`Headers.set`);let n=`Headers.set`;if(e=s.converters.ByteString(e,n,`name`),t=s.converters.ByteString(t,n,`value`),t=headerValueNormalize(t),!a(e))throw s.errors.invalidArgument({prefix:n,value:e,type:`header name`});if(!o(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(e,t,!1)}getSetCookie(){s.brandCheck(this,Headers);let e=this.#t.cookies;return e?[...e]:[]}get[d](){if(this.#t[d])return this.#t[d];let e=[],t=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[d]=t;for(let r=0;r>`](e,t,n,r.bind(e)):s.converters[`record`](e,t,n)}throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence>`,`record`]})},t.exports={fill,compareHeaderName,Headers:p,HeadersList:f,getHeadersGuard:h,setHeadersGuard:g,setHeadersList:y,getHeadersList:v}})),Kt=__commonJSMin(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Gt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=at(),h=z(),g=R(`node:util`),{kEnumerableProperty:v}=h,{isValidReasonPhrase:y,isCancelled:b,isAborted:x,isBlobLike:S,serializeJavascriptValueToJSONString:C,isErrorLike:w,isomorphicEncode:T,environmentSettingsObject:E}=et(),{redirectStatusSet:D,nullBodyStatus:O}=Xe(),{kState:k,kHeaders:A}=tt(),{webidl:j}=$e(),{FormData:M}=rt(),{URLSerializer:N}=Qe(),{kConstruct:P}=Ie(),ee=R(`node:assert`),{types:F}=R(`node:util`),te=new TextEncoder(`utf-8`);var ne=class Response{static error(){return fromInnerResponse(makeNetworkError(),`immutable`)}static json(e,t={}){j.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=j.converters.ResponseInit(t));let n=te.encode(C(e)),r=c(n),i=fromInnerResponse(makeResponse({}),`response`);return initializeResponse(i,t,{body:r[0],type:`application/json`}),i}static redirect(e,t=302){j.argumentLengthCheck(arguments,1,`Response.redirect`),e=j.converters.USVString(e),t=j.converters[`unsigned short`](t);let n;try{n=new URL(e,E.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!D.has(t))throw RangeError(`Invalid status code ${t}`);let r=fromInnerResponse(makeResponse({}),`immutable`);r[k].status=t;let i=T(N(n));return r[k].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(j.util.markAsUncloneable(this),e===P)return;e!==null&&(e=j.converters.BodyInit(e)),t=j.converters.ResponseInit(t),this[k]=makeResponse({}),this[A]=new n(P),o(this[A],`response`),s(this[A],this[k].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}initializeResponse(this,t,r)}get type(){return j.brandCheck(this,Response),this[k].type}get url(){j.brandCheck(this,Response);let e=this[k].urlList,t=e[e.length-1]??null;return t===null?``:N(t,!0)}get redirected(){return j.brandCheck(this,Response),this[k].urlList.length>1}get status(){return j.brandCheck(this,Response),this[k].status}get ok(){return j.brandCheck(this,Response),this[k].status>=200&&this[k].status<=299}get statusText(){return j.brandCheck(this,Response),this[k].statusText}get headers(){return j.brandCheck(this,Response),this[A]}get body(){return j.brandCheck(this,Response),this[k].body?this[k].body.stream:null}get bodyUsed(){return j.brandCheck(this,Response),!!this[k].body&&h.isDisturbed(this[k].body.stream)}clone(){if(j.brandCheck(this,Response),p(this))throw j.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let e=cloneResponse(this[k]);return d&&this[k].body?.stream&&f.register(this,new WeakRef(this[k].body.stream)),fromInnerResponse(e,a(this[A]))}[g.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${g.formatWithOptions(t,n)}`}};u(ne),Object.defineProperties(ne.prototype,{type:v,url:v,status:v,ok:v,redirected:v,statusText:v,headers:v,clone:v,body:v,bodyUsed:v,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(ne,{json:v,redirect:v,error:v});function cloneResponse(e){if(e.internalResponse)return filterResponse(cloneResponse(e.internalResponse),e.type);let t=makeResponse({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function makeResponse(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:`default`,status:200,timingInfo:null,cacheState:``,statusText:``,...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function makeNetworkError(e){return makeResponse({type:`error`,status:0,error:w(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function isNetworkError(e){return e.type===`error`&&e.status===0}function makeFilteredResponse(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(e,n){return n in t?t[n]:e[n]},set(e,n,r){return ee(!(n in t)),e[n]=r,!0}})}function filterResponse(e,t){if(t===`basic`)return makeFilteredResponse(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return makeFilteredResponse(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return makeFilteredResponse(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return makeFilteredResponse(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});ee(!1)}function makeAppropriateNetworkError(e,t=null){return ee(b(e)),x(e)?makeNetworkError(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):makeNetworkError(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function initializeResponse(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`);if(`statusText`in t&&t.statusText!=null&&!y(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[k].status=t.status),`statusText`in t&&t.statusText!=null&&(e[k].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[A],t.headers),n){if(O.includes(e.status))throw j.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[k].body=n.body,n.type!=null&&!e[k].headersList.contains(`content-type`,!0)&&e[k].headersList.append(`content-type`,n.type,!0)}}function fromInnerResponse(e,t){let r=new ne(P);return r[k]=e,r[A]=new n(P),s(r[A],e.headersList),o(r[A],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}j.converters.ReadableStream=j.interfaceConverter(ReadableStream),j.converters.FormData=j.interfaceConverter(M),j.converters.URLSearchParams=j.interfaceConverter(URLSearchParams),j.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?j.converters.USVString(e,t,n):S(e)?j.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||F.isArrayBuffer(e)?j.converters.BufferSource(e,t,n):h.isFormDataLike(e)?j.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?j.converters.URLSearchParams(e,t,n):j.converters.DOMString(e,t,n)},j.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?j.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:j.converters.XMLHttpRequestBodyInit(e,t,n)},j.converters.ResponseInit=j.dictionaryConverter([{key:`status`,converter:j.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:j.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:j.converters.HeadersInit}]),t.exports={isNetworkError,makeNetworkError,makeResponse,makeAppropriateNetworkError,filterResponse,Response:ne,cloneResponse,fromInnerResponse}})),qt=__commonJSMin(((e,t)=>{let{kConnected:n,kSize:r}=Ie();var CompatWeakRef=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},CompatFinalizer=class{constructor(e){this.finalizer=e}register(e,t){e.on&&e.on(`disconnect`,()=>{e[n]===0&&e[r]===0&&this.finalizer(t)})}unregister(e){}};t.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith(`v18`)?(process._rawDebug(`Using compatibility WeakRef and FinalizationRegistry`),{WeakRef:CompatWeakRef,FinalizationRegistry:CompatFinalizer}):{WeakRef,FinalizationRegistry}}})),Jt=__commonJSMin(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=at(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Gt(),{FinalizationRegistry:p}=qt()(),h=z(),g=R(`node:util`),{isValidHTTPToken:v,sameOrigin:y,environmentSettingsObject:b}=et(),{forbiddenMethodsSet:x,corsSafeListedMethodsSet:S,referrerPolicy:C,requestRedirect:w,requestMode:T,requestCredentials:E,requestCache:D,requestDuplex:O}=Xe(),{kEnumerableProperty:k,normalizedMethodRecordsBase:A,normalizedMethodRecords:j}=h,{kHeaders:M,kSignal:N,kState:P,kDispatcher:ee}=tt(),{webidl:F}=$e(),{URLSerializer:te}=Qe(),{kConstruct:ne}=Ie(),re=R(`node:assert`),{getMaxListeners:I,setMaxListeners:ie,getEventListeners:ae,defaultMaxListeners:oe}=R(`node:events`),se=Symbol(`abortController`),ce=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),le=new WeakMap;function buildAbort(e){return abort;function abort(){let t=e.deref();if(t!==void 0){ce.unregister(abort),this.removeEventListener(`abort`,abort),t.abort(this.reason);let e=le.get(t.signal);if(e!==void 0){if(e.size!==0){for(let t of e){let e=t.deref();e!==void 0&&e.abort(this.reason)}e.clear()}le.delete(t.signal)}}}}let ue=!1;var de=class Request{constructor(e,t={}){if(F.util.markAsUncloneable(this),e===ne)return;let r=`Request constructor`;F.argumentLengthCheck(arguments,1,r),e=F.converters.RequestInfo(e,r,`input`),t=F.converters.RequestInit(t,r,`init`);let i=null,u=null,p=b.settingsObject.baseUrl,g=null;if(typeof e==`string`){this[ee]=t.dispatcher;let n;try{n=new URL(e,p)}catch(t){throw TypeError(`Failed to parse URL from `+e,{cause:t})}if(n.username||n.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+e);i=makeRequest({urlList:[n]}),u=`cors`}else this[ee]=t.dispatcher||e[ee],re(e instanceof Request),i=e[P],g=e[N];let C=b.settingsObject.origin,w=`client`;if(i.window?.constructor?.name===`EnvironmentSettingsObject`&&y(i.window,C)&&(w=i.window),t.window!=null)throw TypeError(`'window' option '${w}' must be null`);`window`in t&&(w=`no-window`),i=makeRequest({method:i.method,headersList:i.headersList,unsafeRequest:i.unsafeRequest,client:b.settingsObject,window:w,priority:i.priority,origin:i.origin,referrer:i.referrer,referrerPolicy:i.referrerPolicy,mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,integrity:i.integrity,keepalive:i.keepalive,reloadNavigation:i.reloadNavigation,historyNavigation:i.historyNavigation,urlList:[...i.urlList]});let T=Object.keys(t).length!==0;if(T&&(i.mode===`navigate`&&(i.mode=`same-origin`),i.reloadNavigation=!1,i.historyNavigation=!1,i.origin=`client`,i.referrer=`client`,i.referrerPolicy=``,i.url=i.urlList[i.urlList.length-1],i.urlList=[i.url]),t.referrer!==void 0){let e=t.referrer;if(e===``)i.referrer=`no-referrer`;else{let t;try{t=new URL(e,p)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||C&&!y(t,b.settingsObject.baseUrl)?i.referrer=`client`:i.referrer=t}}t.referrerPolicy!==void 0&&(i.referrerPolicy=t.referrerPolicy);let E;if(E=t.mode===void 0?u:t.mode,E===`navigate`)throw F.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(E!=null&&(i.mode=E),t.credentials!==void 0&&(i.credentials=t.credentials),t.cache!==void 0&&(i.cache=t.cache),i.cache===`only-if-cached`&&i.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(t.redirect!==void 0&&(i.redirect=t.redirect),t.integrity!=null&&(i.integrity=String(t.integrity)),t.keepalive!==void 0&&(i.keepalive=!!t.keepalive),t.method!==void 0){let e=t.method,n=j[e];if(n!==void 0)i.method=n;else{if(!v(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(x.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=A[t]??e,i.method=e}!ue&&i.method===`patch`&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:`UNDICI-FETCH-patch`}),ue=!0)}t.signal!==void 0&&(g=t.signal),this[P]=i;let D=new AbortController;if(this[N]=D.signal,g!=null){if(!g||typeof g.aborted!=`boolean`||typeof g.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(g.aborted)D.abort(g.reason);else{this[se]=D;let e=buildAbort(new WeakRef(D));try{(typeof I==`function`&&I(g)===oe||ae(g,`abort`).length>=oe)&&ie(1500,g)}catch{}h.addAbortListener(g,e),ce.register(D,{signal:g,abort:e},e)}}if(this[M]=new o(ne),d(this[M],i.headersList),l(this[M],`request`),E===`no-cors`){if(!S.has(i.method))throw TypeError(`'${i.method} is unsupported in no-cors mode.`);l(this[M],`request-no-cors`)}if(T){let e=f(this[M]),n=t.headers===void 0?new c(e):t.headers;if(e.clear(),n instanceof c){for(let{name:t,value:r}of n.rawValues())e.append(t,r,!1);e.cookies=n.cookies}else s(this[M],n)}let O=e instanceof Request?e[P].body:null;if((t.body!=null||O!=null)&&(i.method===`GET`||i.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let k=null;if(t.body!=null){let[e,r]=n(t.body,i.keepalive);k=e,r&&!f(this[M]).contains(`content-type`,!0)&&this[M].append(`content-type`,r)}let te=k??O;if(te!=null&&te.source==null){if(k!=null&&t.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(i.mode!==`same-origin`&&i.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);i.useCORSPreflightFlag=!0}let le=te;if(k==null&&O!=null){if(a(e))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let t=new TransformStream;O.stream.pipeThrough(t),le={source:O.source,length:O.length,stream:t.readable}}this[P].body=le}get method(){return F.brandCheck(this,Request),this[P].method}get url(){return F.brandCheck(this,Request),te(this[P].url)}get headers(){return F.brandCheck(this,Request),this[M]}get destination(){return F.brandCheck(this,Request),this[P].destination}get referrer(){return F.brandCheck(this,Request),this[P].referrer===`no-referrer`?``:this[P].referrer===`client`?`about:client`:this[P].referrer.toString()}get referrerPolicy(){return F.brandCheck(this,Request),this[P].referrerPolicy}get mode(){return F.brandCheck(this,Request),this[P].mode}get credentials(){return this[P].credentials}get cache(){return F.brandCheck(this,Request),this[P].cache}get redirect(){return F.brandCheck(this,Request),this[P].redirect}get integrity(){return F.brandCheck(this,Request),this[P].integrity}get keepalive(){return F.brandCheck(this,Request),this[P].keepalive}get isReloadNavigation(){return F.brandCheck(this,Request),this[P].reloadNavigation}get isHistoryNavigation(){return F.brandCheck(this,Request),this[P].historyNavigation}get signal(){return F.brandCheck(this,Request),this[N]}get body(){return F.brandCheck(this,Request),this[P].body?this[P].body.stream:null}get bodyUsed(){return F.brandCheck(this,Request),!!this[P].body&&h.isDisturbed(this[P].body.stream)}get duplex(){return F.brandCheck(this,Request),`half`}clone(){if(F.brandCheck(this,Request),a(this))throw TypeError(`unusable`);let e=cloneRequest(this[P]),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let e=le.get(this.signal);e===void 0&&(e=new Set,le.set(this.signal,e));let n=new WeakRef(t);e.add(n),h.addAbortListener(t.signal,buildAbort(n))}return fromInnerRequest(e,t.signal,u(this[M]))}[g.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${g.formatWithOptions(t,n)}`}};r(de);function makeRequest(e){return{method:e.method??`GET`,localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??``,window:e.window??`client`,keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??`all`,initiator:e.initiator??``,destination:e.destination??``,priority:e.priority??null,origin:e.origin??`client`,policyContainer:e.policyContainer??`client`,referrer:e.referrer??`client`,referrerPolicy:e.referrerPolicy??``,mode:e.mode??`no-cors`,useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??`same-origin`,useCredentials:e.useCredentials??!1,cache:e.cache??`default`,redirect:e.redirect??`follow`,integrity:e.integrity??``,cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??``,parserMetadata:e.parserMetadata??``,reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??`basic`,preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function cloneRequest(e){let t=makeRequest({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function fromInnerRequest(e,t,n){let r=new de(ne);return r[P]=e,r[N]=t,r[M]=new o(ne),d(r[M],e.headersList),l(r[M],n),r}Object.defineProperties(de.prototype,{method:k,url:k,headers:k,redirect:k,clone:k,signal:k,duplex:k,destination:k,body:k,bodyUsed:k,isHistoryNavigation:k,isReloadNavigation:k,keepalive:k,integrity:k,cache:k,credentials:k,attribute:k,referrerPolicy:k,referrer:k,mode:k,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),F.converters.Request=F.interfaceConverter(de),F.converters.RequestInfo=function(e,t,n){return typeof e==`string`?F.converters.USVString(e,t,n):e instanceof de?F.converters.Request(e,t,n):F.converters.USVString(e,t,n)},F.converters.AbortSignal=F.interfaceConverter(AbortSignal),F.converters.RequestInit=F.dictionaryConverter([{key:`method`,converter:F.converters.ByteString},{key:`headers`,converter:F.converters.HeadersInit},{key:`body`,converter:F.nullableConverter(F.converters.BodyInit)},{key:`referrer`,converter:F.converters.USVString},{key:`referrerPolicy`,converter:F.converters.DOMString,allowedValues:C},{key:`mode`,converter:F.converters.DOMString,allowedValues:T},{key:`credentials`,converter:F.converters.DOMString,allowedValues:E},{key:`cache`,converter:F.converters.DOMString,allowedValues:D},{key:`redirect`,converter:F.converters.DOMString,allowedValues:w},{key:`integrity`,converter:F.converters.DOMString},{key:`keepalive`,converter:F.converters.boolean},{key:`signal`,converter:F.nullableConverter(e=>F.converters.AbortSignal(e,`RequestInit`,`signal`,{strict:!1}))},{key:`window`,converter:F.converters.any},{key:`duplex`,converter:F.converters.DOMString,allowedValues:O},{key:`dispatcher`,converter:F.converters.any}]),t.exports={Request:de,makeRequest,fromInnerRequest,cloneRequest}})),Yt=__commonJSMin(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=Kt(),{HeadersList:s}=Gt(),{Request:c,cloneRequest:l}=Jt(),u=R(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:h,TAOCheck:g,appendRequestOriginHeader:v,responseLocationURL:y,requestCurrentURL:b,setRequestReferrerPolicyOnRedirect:x,tryUpgradeRequestToAPotentiallyTrustworthyURL:S,createOpaqueTimingInfo:C,appendFetchMetadata:w,corsCheck:T,crossOriginResourcePolicyCheck:E,determineRequestsReferrer:D,coarsenedSharedCurrentTime:O,createDeferredPromise:k,isBlobLike:A,sameOrigin:j,isCancelled:M,isAborted:N,isErrorLike:P,fullyReadBody:ee,readableStreamClose:F,isomorphicEncode:te,urlIsLocal:ne,urlIsHttpHttpsScheme:re,urlHasHttpsScheme:I,clampAndCoarsenConnectionTimingInfo:ie,simpleRangeHeaderValue:ae,buildContentRange:oe,createInflate:se,extractMimeType:ce}=et(),{kState:le,kDispatcher:ue}=tt(),de=R(`node:assert`),{safelyExtractBody:fe,extractBody:pe}=at(),{redirectStatusSet:me,nullBodyStatus:L,safeMethodsSet:he,requestBodyHeader:ge,subresourceSet:_e}=Xe(),ve=R(`node:events`),{Readable:ye,pipeline:be,finished:xe}=R(`node:stream`),{addAbortListener:Se,isErrored:Ce,isReadable:we,bufferToLowerCasedHeaderName:Te}=z(),{dataURLProcessor:Ee,serializeAMimeType:De,minimizeSupportedMimeType:Oe}=Qe(),{getGlobalDispatcher:ke}=zt(),{webidl:Ae}=$e(),{STATUS_CODES:je}=R(`node:http`),Me=[`GET`,`HEAD`],Ne=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,Pe;var Fetch=class extends ve{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`}terminate(e){this.state===`ongoing`&&(this.state=`terminated`,this.connection?.destroy(e),this.emit(`terminated`,e))}abort(e){this.state===`ongoing`&&(this.state=`aborted`,e||=new DOMException(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function handleFetchDone(e){finalizeAndReportTiming(e,`fetch`)}function fetch(e,t=void 0){Ae.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=k(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[le];if(r.signal.aborted)return abortFetch(n,i,null,r.signal.reason),n.promise;i.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(i.serviceWorkers=`none`);let a=null,s=!1,l=null;return Se(r.signal,()=>{s=!0,de(l!=null),l.abort(r.signal.reason);let e=a?.deref();abortFetch(n,i,e,r.signal.reason)}),l=fetching({request:i,processResponseEndOfBody:handleFetchDone,processResponse:e=>{if(!s){if(e.aborted){abortFetch(n,i,a,l.serializedAbortReason);return}if(e.type===`error`){n.reject(TypeError(`fetch failed`,{cause:e.error}));return}a=new WeakRef(o(e,`immutable`)),n.resolve(a.deref()),n=null}},dispatcher:r[ue]}),n.promise}function finalizeAndReportTiming(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;re(n)&&r!==null&&(e.timingAllowPassed||(r=C({startTime:r.startTime}),i=``),r.endTime=O(),e.timingInfo=r,Fe(r,n.href,t,globalThis,i))}let Fe=performance.markResourceTiming;function abortFetch(e,t,n,r){if(e&&e.reject(r),t.body!=null&&we(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[le];i.body!=null&&we(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function fetching({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=ke()}){de(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=O(l),d=C({startTime:u}),h={controller:new Fetch(s),request:e,timingInfo:d,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return de(!e.body||e.body.stream),e.window===`client`&&(e.window=e.client?.globalObject?.constructor?.name===`Window`?e.client:`no-window`),e.origin===`client`&&(e.origin=e.client.origin),e.policyContainer===`client`&&(e.policyContainer=e.client==null?f():p(e.client.policyContainer)),e.headersList.contains(`accept`,!0)||e.headersList.append(`accept`,`*/*`,!0),e.headersList.contains(`accept-language`,!0)||e.headersList.append(`accept-language`,`*`,!0),e.priority,_e.has(e.destination),mainFetch(h).catch(e=>{h.controller.terminate(e)}),h.controller}async function mainFetch(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!ne(b(r))&&(a=n(`local URLs only`)),S(r),h(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=D(r)),a===null&&(a=await(async()=>{let t=b(r);return j(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await schemeFetch(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await schemeFetch(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):re(b(r))?(r.responseTainting=`cors`,await httpFetch(e)):n(`URL scheme must be a HTTP(S) scheme`)})()),t)return a;a.status!==0&&!a.internalResponse&&(r.responseTainting,r.responseTainting===`basic`?a=i(a,`basic`):r.responseTainting===`cors`?a=i(a,`cors`):r.responseTainting===`opaque`?a=i(a,`opaque`):de(!1));let o=a.status===0?a:a.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(a.timingAllowPassed=!0),a.type===`opaque`&&o.status===206&&o.rangeRequested&&!r.headers.contains(`range`,!0)&&(a=o=n()),a.status!==0&&(r.method===`HEAD`||r.method===`CONNECT`||L.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let processBodyError=t=>fetchFinale(e,n(t));if(r.responseTainting===`opaque`||a.body==null){processBodyError(a.error);return}await ee(a.body,t=>{if(!d(t,r.integrity)){processBodyError(`integrity mismatch`);return}a.body=fe(t)[0],fetchFinale(e,a)},processBodyError)}else fetchFinale(e,a)}function schemeFetch(e){if(M(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=b(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{Pe||=R(`node:buffer`).resolveObjectURL;let e=b(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=Pe(e.toString());if(t.method!==`GET`||!A(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=te(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=t.headersList.get(`range`,!0),a=ae(e,!0);if(a===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:s,rangeEndValue:l}=a;if(s===null)s=o-l,l=s+l-1;else{if(s>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(l===null||l>=o)&&(l=o-1)}let u=r.slice(s,l,c);i.body=pe(u)[0];let d=te(`${u.size}`),f=oe(s,l,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,d,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,f,!0)}else{let e=pe(r);i.statusText=`OK`,i.body=e[0],i.headersList.set(`content-length`,s,!0),i.headersList.set(`content-type`,c,!0)}return Promise.resolve(i)}case`data:`:{let e=b(t),r=Ee(e);if(r===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let i=De(r.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:i}]],body:fe(r.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return httpFetch(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function finalizeResponse(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function fetchFinale(e,t){let n=e.timingInfo,processResponseEndOfBody=()=>{let r=Date.now();e.request.destination===`document`&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!==`https:`)return;n.endTime=r;let i=t.cacheState,a=t.bodyInfo;t.timingAllowPassed||(n=C(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=ce(t.headersList);e!==`failure`&&(a.contentType=Oe(e))}e.request.initiatorType!=null&&Fe(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let processResponseEndOfBodyTask=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>processResponseEndOfBodyTask())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let r=t.type===`error`?t:t.internalResponse??t;r.body==null?processResponseEndOfBody():xe(r.body.stream,()=>{processResponseEndOfBody()})}async function httpFetch(e){let t=e.request,r=null,i=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=r=await httpNetworkOrCacheFetch(e),t.responseTainting===`cors`&&T(t,r)===`failure`)return n(`cors failure`);g(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&E(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(me.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(void 0,!1),t.redirect===`error`?r=n(`unexpected redirect`):t.redirect===`manual`?r=i:t.redirect===`follow`?r=await httpRedirectFetch(e,r):de(!1)),r.timingInfo=a,r)}function httpRedirectFetch(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=y(i,b(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!re(a))return Promise.resolve(n(`URL scheme must be a HTTP(S) scheme`));if(r.redirectCount===20)return Promise.resolve(n(`redirect count exceeded`));if(r.redirectCount+=1,r.mode===`cors`&&(a.username||a.password)&&!j(r,a))return Promise.resolve(n(`cross origin not allowed for request mode "cors"`));if(r.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(n(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(n());if([301,302].includes(i.status)&&r.method===`POST`||i.status===303&&!Me.includes(r.method)){r.method=`GET`,r.body=null;for(let e of ge)r.headersList.delete(e)}j(b(r),a)||(r.headersList.delete(`authorization`,!0),r.headersList.delete(`proxy-authorization`,!0),r.headersList.delete(`cookie`,!0),r.headersList.delete(`host`,!0)),r.body!=null&&(de(r.body.source!=null),r.body=fe(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=O(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),x(r,i),mainFetch(e,!0)}async function httpNetworkOrCacheFetch(e,t=!1,i=!1){let a=e.request,o=null,s=null,c=null;a.window===`no-window`&&a.redirect===`error`?(o=e,s=a):(s=l(a),o={...e},o.request=s);let u=a.credentials===`include`||a.credentials===`same-origin`&&a.responseTainting===`basic`,d=s.body?s.body.length:null,f=null;if(s.body==null&&[`POST`,`PUT`].includes(s.method)&&(f=`0`),d!=null&&(f=te(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,te(s.referrer.href),!0),v(s),w(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,Ne),s.cache==="default"&&(s.headersList.contains(`if-modified-since`,!0)||s.headersList.contains(`if-none-match`,!0)||s.headersList.contains(`if-unmodified-since`,!0)||s.headersList.contains(`if-match`,!0)||s.headersList.contains(`if-range`,!0))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`,!0)&&s.headersList.append(`cache-control`,`max-age=0`,!0),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`,!0)||s.headersList.append(`pragma`,`no-cache`,!0),s.headersList.contains(`cache-control`,!0)||s.headersList.append(`cache-control`,`no-cache`,!0)),s.headersList.contains(`range`,!0)&&s.headersList.append(`accept-encoding`,`identity`,!0),s.headersList.contains(`accept-encoding`,!0)||(I(b(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate`,!0):s.headersList.append(`accept-encoding`,`gzip, deflate`,!0)),s.headersList.delete(`host`,!0),s.cache=`no-store`,s.cache!==`no-store`&&s.cache,c==null){if(s.cache===`only-if-cached`)return n(`only if cached`);let e=await httpNetworkFetch(o,u,i);!he.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`,!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=u,c.status===407)return a.window===`no-window`?n():M(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(M(e))return r(e);e.controller.connection.destroy(),c=await httpNetworkOrCacheFetch(e,t,!0)}return c}async function httpNetworkFetch(e,t=!1,i=!1){de(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException(`The operation was aborted.`,`AbortError`)))}};let o=e.request,c=null,l=e.timingInfo;o.cache=`no-store`,o.mode;let d=null;if(o.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(o.body!=null){let processBodyChunk=async function*(t){M(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},processEndOfBody=()=>{M(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},processBodyError=t=>{M(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*processBodyChunk(e);processEndOfBody()}catch(e){processBodyError(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await dispatch({body:d});if(o)c=a({status:n,statusText:r,headersList:i,socket:o});else{let o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),c=a({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),r(e,t)):n(t)}let pullAlgorithm=async()=>{await e.controller.resume()},cancelAlgorithm=t=>{M(e)||e.controller.abort(t)},f=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await pullAlgorithm(e)},async cancel(e){await cancelAlgorithm(e)},type:`bytes`});c.body={stream:f,source:null,length:null},e.controller.onAborted=onAborted,e.controller.on(`terminated`,onAborted),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(N(e))break;t=n?void 0:r}catch(r){e.controller.ended&&!l.encodedBodySize?t=void 0:(t=r,n=!0)}if(t===void 0){F(e.controller.controller),finalizeResponse(e,c);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}let r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),Ce(f)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function onAborted(t){N(e)?(c.aborted=!0,we(f)&&e.controller.controller.error(e.controller.serializedAbortReason)):we(f)&&e.controller.controller.error(TypeError(`terminated`,{cause:P(t)?t:void 0})),e.controller.connection.destroy()}return c;function dispatch({body:t}){let n=b(o),r=e.controller.dispatcher;return new Promise((i,a)=>r.dispatch({path:n.pathname+n.search,origin:n.origin,method:o.method,body:r.isMockActive?o.body&&(o.body.source||o.body.stream):t,headers:o.headersList.entries,maxRedirections:0,upgrade:o.mode===`websocket`?`websocket`:void 0},{body:null,abort:null,onConnect(t){let{connection:n}=e.controller;l.finalConnectionTimingInfo=ie(void 0,l.postRedirectStartTime,e.crossOriginIsolatedCapability),n.destroyed?t(new DOMException(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,t),this.abort=n.abort=t),l.finalNetworkRequestStartTime=O(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=O(e.crossOriginIsolatedCapability)},onHeaders(e,t,n,r){if(e<200)return;let c=``,l=new s;for(let e=0;e5)return a(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)),!0;for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n===`x-gzip`||n===`gzip`)d.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`deflate`)d.push(se({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if(n===`br`)d.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{d.length=0;break}}}let p=this.onError.bind(this);return i({status:e,statusText:r,headersList:l,body:d.length?be(this.body,...d,e=>{e&&this.onError(e)}).on(`error`,p):this.body.on(`error`,p)}),!0},onData(t){if(e.controller.dump)return;let n=t;return l.encodedBodySize+=n.byteLength,this.body.push(n)},onComplete(){this.abort&&e.controller.off(`terminated`,this.abort),e.controller.onAborted&&e.controller.off(`terminated`,e.controller.onAborted),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off(`terminated`,this.abort),this.body?.destroy(t),e.controller.terminate(t),a(t)},onUpgrade(e,t,n){if(e!==101)return;let r=new s;for(let e=0;e{t.exports={kState:Symbol(`FileReader state`),kResult:Symbol(`FileReader result`),kError:Symbol(`FileReader error`),kLastProgressEventFired:Symbol(`FileReader last progress event fired timestamp`),kEvents:Symbol(`FileReader events`),kAborted:Symbol(`FileReader aborted`)}})),Zt=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),r=Symbol(`ProgressEvent state`);var i=class ProgressEvent extends Event{constructor(e,t={}){e=n.converters.DOMString(e,`ProgressEvent constructor`,`type`),t=n.converters.ProgressEventInit(t??{}),super(e,t),this[r]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return n.brandCheck(this,ProgressEvent),this[r].lengthComputable}get loaded(){return n.brandCheck(this,ProgressEvent),this[r].loaded}get total(){return n.brandCheck(this,ProgressEvent),this[r].total}};n.converters.ProgressEventInit=n.dictionaryConverter([{key:`lengthComputable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`loaded`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`total`,converter:n.converters[`unsigned long long`],defaultValue:()=>0},{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}]),t.exports={ProgressEvent:i}})),Qt=__commonJSMin(((e,t)=>{function getEncoding(e){if(!e)return`failure`;switch(e.trim().toLowerCase()){case`unicode-1-1-utf-8`:case`unicode11utf8`:case`unicode20utf8`:case`utf-8`:case`utf8`:case`x-unicode20utf8`:return`UTF-8`;case`866`:case`cp866`:case`csibm866`:case`ibm866`:return`IBM866`;case`csisolatin2`:case`iso-8859-2`:case`iso-ir-101`:case`iso8859-2`:case`iso88592`:case`iso_8859-2`:case`iso_8859-2:1987`:case`l2`:case`latin2`:return`ISO-8859-2`;case`csisolatin3`:case`iso-8859-3`:case`iso-ir-109`:case`iso8859-3`:case`iso88593`:case`iso_8859-3`:case`iso_8859-3:1988`:case`l3`:case`latin3`:return`ISO-8859-3`;case`csisolatin4`:case`iso-8859-4`:case`iso-ir-110`:case`iso8859-4`:case`iso88594`:case`iso_8859-4`:case`iso_8859-4:1988`:case`l4`:case`latin4`:return`ISO-8859-4`;case`csisolatincyrillic`:case`cyrillic`:case`iso-8859-5`:case`iso-ir-144`:case`iso8859-5`:case`iso88595`:case`iso_8859-5`:case`iso_8859-5:1988`:return`ISO-8859-5`;case`arabic`:case`asmo-708`:case`csiso88596e`:case`csiso88596i`:case`csisolatinarabic`:case`ecma-114`:case`iso-8859-6`:case`iso-8859-6-e`:case`iso-8859-6-i`:case`iso-ir-127`:case`iso8859-6`:case`iso88596`:case`iso_8859-6`:case`iso_8859-6:1987`:return`ISO-8859-6`;case`csisolatingreek`:case`ecma-118`:case`elot_928`:case`greek`:case`greek8`:case`iso-8859-7`:case`iso-ir-126`:case`iso8859-7`:case`iso88597`:case`iso_8859-7`:case`iso_8859-7:1987`:case`sun_eu_greek`:return`ISO-8859-7`;case`csiso88598e`:case`csisolatinhebrew`:case`hebrew`:case`iso-8859-8`:case`iso-8859-8-e`:case`iso-ir-138`:case`iso8859-8`:case`iso88598`:case`iso_8859-8`:case`iso_8859-8:1988`:case`visual`:return`ISO-8859-8`;case`csiso88598i`:case`iso-8859-8-i`:case`logical`:return`ISO-8859-8-I`;case`csisolatin6`:case`iso-8859-10`:case`iso-ir-157`:case`iso8859-10`:case`iso885910`:case`l6`:case`latin6`:return`ISO-8859-10`;case`iso-8859-13`:case`iso8859-13`:case`iso885913`:return`ISO-8859-13`;case`iso-8859-14`:case`iso8859-14`:case`iso885914`:return`ISO-8859-14`;case`csisolatin9`:case`iso-8859-15`:case`iso8859-15`:case`iso885915`:case`iso_8859-15`:case`l9`:return`ISO-8859-15`;case`iso-8859-16`:return`ISO-8859-16`;case`cskoi8r`:case`koi`:case`koi8`:case`koi8-r`:case`koi8_r`:return`KOI8-R`;case`koi8-ru`:case`koi8-u`:return`KOI8-U`;case`csmacintosh`:case`mac`:case`macintosh`:case`x-mac-roman`:return`macintosh`;case`iso-8859-11`:case`iso8859-11`:case`iso885911`:case`tis-620`:case`windows-874`:return`windows-874`;case`cp1250`:case`windows-1250`:case`x-cp1250`:return`windows-1250`;case`cp1251`:case`windows-1251`:case`x-cp1251`:return`windows-1251`;case`ansi_x3.4-1968`:case`ascii`:case`cp1252`:case`cp819`:case`csisolatin1`:case`ibm819`:case`iso-8859-1`:case`iso-ir-100`:case`iso8859-1`:case`iso88591`:case`iso_8859-1`:case`iso_8859-1:1987`:case`l1`:case`latin1`:case`us-ascii`:case`windows-1252`:case`x-cp1252`:return`windows-1252`;case`cp1253`:case`windows-1253`:case`x-cp1253`:return`windows-1253`;case`cp1254`:case`csisolatin5`:case`iso-8859-9`:case`iso-ir-148`:case`iso8859-9`:case`iso88599`:case`iso_8859-9`:case`iso_8859-9:1989`:case`l5`:case`latin5`:case`windows-1254`:case`x-cp1254`:return`windows-1254`;case`cp1255`:case`windows-1255`:case`x-cp1255`:return`windows-1255`;case`cp1256`:case`windows-1256`:case`x-cp1256`:return`windows-1256`;case`cp1257`:case`windows-1257`:case`x-cp1257`:return`windows-1257`;case`cp1258`:case`windows-1258`:case`x-cp1258`:return`windows-1258`;case`x-mac-cyrillic`:case`x-mac-ukrainian`:return`x-mac-cyrillic`;case`chinese`:case`csgb2312`:case`csiso58gb231280`:case`gb2312`:case`gb_2312`:case`gb_2312-80`:case`gbk`:case`iso-ir-58`:case`x-gbk`:return`GBK`;case`gb18030`:return`gb18030`;case`big5`:case`big5-hkscs`:case`cn-big5`:case`csbig5`:case`x-x-big5`:return`Big5`;case`cseucpkdfmtjapanese`:case`euc-jp`:case`x-euc-jp`:return`EUC-JP`;case`csiso2022jp`:case`iso-2022-jp`:return`ISO-2022-JP`;case`csshiftjis`:case`ms932`:case`ms_kanji`:case`shift-jis`:case`shift_jis`:case`sjis`:case`windows-31j`:case`x-sjis`:return`Shift_JIS`;case`cseuckr`:case`csksc56011987`:case`euc-kr`:case`iso-ir-149`:case`korean`:case`ks_c_5601-1987`:case`ks_c_5601-1989`:case`ksc5601`:case`ksc_5601`:case`windows-949`:return`EUC-KR`;case`csiso2022kr`:case`hz-gb-2312`:case`iso-2022-cn`:case`iso-2022-cn-ext`:case`iso-2022-kr`:case`replacement`:return`replacement`;case`unicodefffe`:case`utf-16be`:return`UTF-16BE`;case`csunicode`:case`iso-10646-ucs-2`:case`ucs-2`:case`unicode`:case`unicodefeff`:case`utf-16`:case`utf-16le`:return`UTF-16LE`;case`x-user-defined`:return`x-user-defined`;default:return`failure`}}t.exports={getEncoding}})),$t=__commonJSMin(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Xt(),{ProgressEvent:s}=Zt(),{getEncoding:c}=Qt(),{serializeAMimeType:l,parseMIMEType:u}=Qe(),{types:d}=R(`node:util`),{StringDecoder:f}=R(`string_decoder`),{btoa:p}=R(`node:buffer`),h={enumerable:!0,writable:!1,configurable:!1};function readOperation(e,t,s,c){if(e[n]===`loading`)throw new DOMException(`Invalid state`,`InvalidStateError`);e[n]=`loading`,e[i]=null,e[r]=null;let l=t.stream().getReader(),u=[],f=l.read(),p=!0;(async()=>{for(;!e[a];)try{let{done:h,value:g}=await f;if(p&&!e[a]&&queueMicrotask(()=>{fireAProgressEvent(`loadstart`,e)}),p=!1,!h&&d.isUint8Array(g))u.push(g),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{fireAProgressEvent(`progress`,e)})),f=l.read();else if(h){queueMicrotask(()=>{e[n]=`done`;try{let n=packageData(u,s,t.type,c);if(e[a])return;e[i]=n,fireAProgressEvent(`load`,e)}catch(t){e[r]=t,fireAProgressEvent(`error`,e)}e[n]!==`loading`&&fireAProgressEvent(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,fireAProgressEvent(`error`,e),e[n]!==`loading`&&fireAProgressEvent(`loadend`,e)});break}})()}function fireAProgressEvent(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function packageData(e,t,n,r){switch(t){case`DataURL`:{let t=`data:`,r=u(n||`application/octet-stream`);r!==`failure`&&(t+=l(r)),t+=`;base64,`;let i=new f(`latin1`);for(let n of e)t+=p(i.write(n));return t+=p(i.end()),t}case`Text`:{let t=`failure`;if(r&&(t=c(r)),t===`failure`&&n){let e=u(n);e!==`failure`&&(t=c(e.parameters.get(`charset`)))}return t===`failure`&&(t=`UTF-8`),decode(e,t)}case`ArrayBuffer`:return combineByteSequences(e).buffer;case`BinaryString`:{let t=``,n=new f(`latin1`);for(let r of e)t+=n.write(r);return t+=n.end(),t}}}function decode(e,t){let n=combineByteSequences(e),r=BOMSniffing(n),i=0;r!==null&&(t=r,i=r===`UTF-8`?3:2);let a=n.slice(i);return new TextDecoder(t).decode(a)}function BOMSniffing(e){let[t,n,r]=e;return t===239&&n===187&&r===191?`UTF-8`:t===254&&n===255?`UTF-16BE`:t===255&&n===254?`UTF-16LE`:null}function combineByteSequences(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=0;return e.reduce((e,t)=>(e.set(t,n),n+=t.byteLength,e),new Uint8Array(t))}t.exports={staticPropertyDescriptors:h,readOperation,fireAProgressEvent}})),en=__commonJSMin(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=$t(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Xt(),{webidl:u}=$e(),{kEnumerableProperty:d}=z();var f=class FileReader extends EventTarget{constructor(){super(),this[a]=`empty`,this[s]=null,this[o]=null,this[c]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`ArrayBuffer`)}readAsBinaryString(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`BinaryString`)}readAsText(e,t=void 0){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),e=u.converters.Blob(e,{strict:!1}),t!==void 0&&(t=u.converters.DOMString(t,`FileReader.readAsText`,`encoding`)),r(this,e,`Text`,t)}readAsDataURL(e){u.brandCheck(this,FileReader),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),e=u.converters.Blob(e,{strict:!1}),r(this,e,`DataURL`)}abort(){if(this[a]===`empty`||this[a]===`done`){this[s]=null;return}this[a]===`loading`&&(this[a]=`done`,this[s]=null),this[l]=!0,i(`abort`,this),this[a]!==`loading`&&i(`loadend`,this)}get readyState(){switch(u.brandCheck(this,FileReader),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,FileReader),this[s]}get error(){return u.brandCheck(this,FileReader),this[o]}get onloadend(){return u.brandCheck(this,FileReader),this[c].loadend}set onloadend(e){u.brandCheck(this,FileReader),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof e==`function`?(this[c].loadend=e,this.addEventListener(`loadend`,e)):this[c].loadend=null}get onerror(){return u.brandCheck(this,FileReader),this[c].error}set onerror(e){u.brandCheck(this,FileReader),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof e==`function`?(this[c].error=e,this.addEventListener(`error`,e)):this[c].error=null}get onloadstart(){return u.brandCheck(this,FileReader),this[c].loadstart}set onloadstart(e){u.brandCheck(this,FileReader),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof e==`function`?(this[c].loadstart=e,this.addEventListener(`loadstart`,e)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,FileReader),this[c].progress}set onprogress(e){u.brandCheck(this,FileReader),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof e==`function`?(this[c].progress=e,this.addEventListener(`progress`,e)):this[c].progress=null}get onload(){return u.brandCheck(this,FileReader),this[c].load}set onload(e){u.brandCheck(this,FileReader),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof e==`function`?(this[c].load=e,this.addEventListener(`load`,e)):this[c].load=null}get onabort(){return u.brandCheck(this,FileReader),this[c].abort}set onabort(e){u.brandCheck(this,FileReader),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof e==`function`?(this[c].abort=e,this.addEventListener(`abort`,e)):this[c].abort=null}};f.EMPTY=f.prototype.EMPTY=0,f.LOADING=f.prototype.LOADING=1,f.DONE=f.prototype.DONE=2,Object.defineProperties(f.prototype,{EMPTY:n,LOADING:n,DONE:n,readAsArrayBuffer:d,readAsBinaryString:d,readAsText:d,readAsDataURL:d,abort:d,readyState:d,result:d,error:d,onloadstart:d,onprogress:d,onload:d,onabort:d,onerror:d,onloadend:d,[Symbol.toStringTag]:{value:`FileReader`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(f,{EMPTY:n,LOADING:n,DONE:n}),t.exports={FileReader:f}})),tn=__commonJSMin(((e,t)=>{t.exports={kConstruct:Ie().kConstruct}})),nn=__commonJSMin(((e,t)=>{let n=R(`node:assert`),{URLSerializer:r}=Qe(),{isValidHeaderName:i}=et();function urlEquals(e,t,n=!1){return r(e,n)===r(t,n)}function getFieldValues(e){n(e!==null);let t=[];for(let n of e.split(`,`))n=n.trim(),i(n)&&t.push(n);return t}t.exports={urlEquals,getFieldValues}})),rn=__commonJSMin(((e,t)=>{let{kConstruct:n}=tn(),{urlEquals:r,getFieldValues:i}=nn(),{kEnumerableProperty:a,isDisturbed:o}=z(),{webidl:s}=$e(),{Response:c,cloneResponse:l,fromInnerResponse:u}=Kt(),{Request:d,fromInnerRequest:f}=Jt(),{kState:p}=tt(),{fetching:h}=Yt(),{urlIsHttpHttpsScheme:g,createDeferredPromise:v,readAllBytes:y}=et(),b=R(`node:assert`);var x=class Cache{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,t={}){s.brandCheck(this,Cache);let n=`Cache.match`;s.argumentLengthCheck(arguments,1,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.CacheQueryOptions(t,n,`options`);let r=this.#i(e,t,1);if(r.length!==0)return r[0]}async matchAll(e=void 0,t={}){s.brandCheck(this,Cache);let n=`Cache.matchAll`;return e!==void 0&&(e=s.converters.RequestInfo(e,n,`request`)),t=s.converters.CacheQueryOptions(t,n,`options`),this.#i(e,t)}async add(e){s.brandCheck(this,Cache);let t=`Cache.add`;s.argumentLengthCheck(arguments,1,t),e=s.converters.RequestInfo(e,t,`request`);let n=[e];return await this.addAll(n)}async addAll(e){s.brandCheck(this,Cache);let t=`Cache.addAll`;s.argumentLengthCheck(arguments,1,t);let n=[],r=[];for(let n of e){if(n===void 0)throw s.errors.conversionFailed({prefix:t,argument:`Argument 1`,types:[`undefined is not allowed`]});if(n=s.converters.RequestInfo(n),typeof n==`string`)continue;let e=n[p];if(!g(e.url)||e.method!==`GET`)throw s.errors.exception({header:t,message:`Expected http/s scheme when method is not GET.`})}let a=[];for(let o of e){let e=new d(o)[p];if(!g(e.url))throw s.errors.exception({header:t,message:`Expected http/s scheme.`});e.initiator=`fetch`,e.destination=`subresource`,r.push(e);let c=v();a.push(h({request:e,processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)c.reject(s.errors.exception({header:`Cache.addAll`,message:`Received an invalid status code or the request failed.`}));else if(e.headersList.contains(`vary`)){let t=i(e.headersList.get(`vary`));for(let e of t)if(e===`*`){c.reject(s.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of a)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),n.push(c.promise)}let o=await Promise.all(n),c=[],l=0;for(let e of o){let t={type:`put`,request:r[l],response:e};c.push(t),l++}let u=v(),f=null;try{this.#t(c)}catch(e){f=e}return queueMicrotask(()=>{f===null?u.resolve(void 0):u.reject(f)}),u.promise}async put(e,t){s.brandCheck(this,Cache);let n=`Cache.put`;s.argumentLengthCheck(arguments,2,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.Response(t,n,`response`);let r=null;if(r=e instanceof d?e[p]:new d(e)[p],!g(r.url)||r.method!==`GET`)throw s.errors.exception({header:n,message:`Expected an http/s scheme when method is not GET`});let a=t[p];if(a.status===206)throw s.errors.exception({header:n,message:`Got 206 status`});if(a.headersList.contains(`vary`)){let e=i(a.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:n,message:`Got * vary field value`})}if(a.body&&(o(a.body.stream)||a.body.stream.locked))throw s.errors.exception({header:n,message:`Response body is locked or disturbed`});let c=l(a),u=v();if(a.body!=null){let e=a.body.stream.getReader();y(e).then(u.resolve,u.reject)}else u.resolve(void 0);let f=[],h={type:`put`,request:r,response:c};f.push(h);let b=await u.promise;c.body!=null&&(c.body.source=b);let x=v(),S=null;try{this.#t(f)}catch(e){S=e}return queueMicrotask(()=>{S===null?x.resolve():x.reject(S)}),x.promise}async delete(e,t={}){s.brandCheck(this,Cache);let n=`Cache.delete`;s.argumentLengthCheck(arguments,1,n),e=s.converters.RequestInfo(e,n,`request`),t=s.converters.CacheQueryOptions(t,n,`options`);let r=null;if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return!1}else b(typeof e==`string`),r=new d(e)[p];let i=[],a={type:`delete`,request:r,options:t};i.push(a);let o=v(),c=null,l;try{l=this.#t(i)}catch(e){c=e}return queueMicrotask(()=>{c===null?o.resolve(!!l?.length):o.reject(c)}),o.promise}async keys(e=void 0,t={}){s.brandCheck(this,Cache);let n=`Cache.keys`;e!==void 0&&(e=s.converters.RequestInfo(e,n,`request`)),t=s.converters.CacheQueryOptions(t,n,`options`);let r=null;if(e!==void 0){if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p])}let i=v(),a=[];if(e===void 0)for(let e of this.#e)a.push(e[0]);else{let e=this.#n(r,t);for(let t of e)a.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of a){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}i.resolve(Object.freeze(e))}),i.promise}#t(e){let t=this.#e,n=[...t],r=[],i=[];try{for(let n of e){if(n.type!==`delete`&&n.type!==`put`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(n.type===`delete`&&n.response!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`delete operation should not have an associated response`});if(this.#n(n.request,n.options,r).length)throw new DOMException(`???`,`InvalidStateError`);let e;if(n.type===`delete`){if(e=this.#n(n.request,n.options),e.length===0)return[];for(let n of e){let e=t.indexOf(n);b(e!==-1),t.splice(e,1)}}else if(n.type===`put`){if(n.response==null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let i=n.request;if(!g(i.url))throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(i.method!==`GET`)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(n.options!=null)throw s.errors.exception({header:`Cache.#batchCacheOperations`,message:`options must not be defined`});e=this.#n(n.request);for(let n of e){let e=t.indexOf(n);b(e!==-1),t.splice(e,1)}t.push([n.request,n.response]),r.push([n.request,n.response])}i.push([n.request,n.response])}return i}catch(e){throw this.#e.length=0,this.#e=n,e}}#n(e,t,n){let r=[],i=n??this.#e;for(let n of i){let[i,a]=n;this.#r(e,i,a,t)&&r.push(n)}return r}#r(e,t,n=null,a){let o=new URL(e.url),s=new URL(t.url);if(a?.ignoreSearch&&(s.search=``,o.search=``),!r(o,s,!0))return!1;if(n==null||a?.ignoreVary||!n.headersList.contains(`vary`))return!0;let c=i(n.headersList.get(`vary`));for(let n of c)if(n===`*`||t.headersList.get(n)!==e.headersList.get(n))return!1;return!0}#i(e,t,n=1/0){let r=null;if(e!==void 0){if(e instanceof d){if(r=e[p],r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=new d(e)[p])}let i=[];if(e===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,t);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=u(e,`immutable`);if(a.push(t.clone()),a.length>=n)break}return Object.freeze(a)}};Object.defineProperties(x.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let S=[{key:`ignoreSearch`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreMethod`,converter:s.converters.boolean,defaultValue:()=>!1},{key:`ignoreVary`,converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.CacheQueryOptions=s.dictionaryConverter(S),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...S,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:x}})),an=__commonJSMin(((e,t)=>{let{kConstruct:n}=tn(),{Cache:r}=rn(),{webidl:i}=$e(),{kEnumerableProperty:a}=z();var o=class CacheStorage{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(e,t={}){if(i.brandCheck(this,CacheStorage),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),e=i.converters.RequestInfo(e),t=i.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(this.#e.has(t.cacheName)){let i=this.#e.get(t.cacheName);return await new r(n,i).match(e,t)}}else for(let i of this.#e.values()){let a=await new r(n,i).match(e,t);if(a!==void 0)return a}}async has(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.has(e)}async open(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.has(e)){let t=this.#e.get(e);return new r(n,t)}let a=[];return this.#e.set(e,a),new r(n,a)}async delete(e){i.brandCheck(this,CacheStorage);let t=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,t),e=i.converters.DOMString(e,t,`cacheName`),this.#e.delete(e)}async keys(){return i.brandCheck(this,CacheStorage),[...this.#e.keys()]}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CacheStorage`,configurable:!0},match:a,has:a,open:a,delete:a,keys:a}),t.exports={CacheStorage:o}})),on=__commonJSMin(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),sn=__commonJSMin(((e,t)=>{function isCTLExcludingHtab(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function validateCookieName(e){for(let t=0;t126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw Error(`Invalid cookie name`)}}function validateCookieValue(e){let t=e.length,n=0;if(e[0]===`"`){if(t===1||e[t-1]!==`"`)throw Error(`Invalid cookie value`);--t,++n}for(;n126||t===34||t===44||t===59||t===92)throw Error(`Invalid cookie value`)}}function validateCookiePath(e){for(let t=0;t126||n===59)throw Error(`Invalid cookie path`)}}function isLetterOrDigit(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function validateCookieDomain(e){if(e===` `)return;if(e.length>255)throw Error(`Invalid cookie domain`);let t=0;for(let n=0;n63)throw Error(`Invalid cookie domain`)}if(t===0||e.charCodeAt(e.length-1)===45)throw Error(`Invalid cookie domain`)}let n=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],r=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],i=Array(61).fill(0).map((e,t)=>t.toString().padStart(2,`0`));function toIMFDate(e){return typeof e==`number`&&(e=new Date(e)),`${n[e.getUTCDay()]}, ${i[e.getUTCDate()]} ${r[e.getUTCMonth()]} ${e.getUTCFullYear()} ${i[e.getUTCHours()]}:${i[e.getUTCMinutes()]}:${i[e.getUTCSeconds()]} GMT`}function validateCookieMaxAge(e){if(e<0)throw Error(`Invalid cookie max-age`)}function stringify(e){if(e.name.length===0)return null;validateCookieName(e.name),validateCookieValue(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith(`__Secure-`)&&(e.secure=!0),e.name.startsWith(`__Host-`)&&(e.secure=!0,e.domain=null,e.path=`/`),e.secure&&t.push(`Secure`),e.httpOnly&&t.push(`HttpOnly`),typeof e.maxAge==`number`&&(validateCookieMaxAge(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(validateCookieDomain(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(validateCookiePath(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${toIMFDate(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes(`=`))throw Error(`Invalid unparsed`);let[e,...r]=n.split(`=`),i=e.trim(),a=r.join(`=`);validateCookieName(i),validateCookieValue(a),t.push(`${i}=${a}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab,validateCookieName,validateCookiePath,validateCookieValue,toIMFDate,stringify}})),cn=__commonJSMin(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=on(),{isCTLExcludingHtab:i}=sn(),{collectASequenceOfCodePointsFast:a}=Qe(),o=R(`node:assert`);function parseSetCookie(e){if(i(e))return null;let t=``,r=``,o=``,s=``;if(e.includes(`;`)){let n={position:0};t=a(`;`,e,n),r=e.slice(n.position)}else t=e;if(!t.includes(`=`))s=t;else{let e={position:0};o=a(`=`,t,e),s=t.slice(e.position+1)}return o=o.trim(),s=s.trim(),o.length+s.length>n?null:{name:o,value:s,...parseUnparsedAttributes(r)}}function parseUnparsedAttributes(e,t={}){if(e.length===0)return t;o(e[0]===`;`),e=e.slice(1);let n=``;e.includes(`;`)?(n=a(`;`,e,{position:0}),e=e.slice(n.length)):(n=e,e=``);let i=``,s=``;if(n.includes(`=`)){let e={position:0};i=a(`=`,n,e),s=n.slice(e.position+1)}else i=n;if(i=i.trim(),s=s.trim(),s.length>r)return parseUnparsedAttributes(e,t);let c=i.toLowerCase();if(c===`expires`)t.expires=new Date(s);else if(c===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return parseUnparsedAttributes(e,t);t.maxAge=Number(s)}else if(c===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(c===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(c===`secure`)t.secure=!0;else if(c===`httponly`)t.httpOnly=!0;else if(c===`samesite`){let e=s.toLowerCase();e===`none`?t.sameSite=`None`:e===`strict`?t.sameSite=`Strict`:e===`lax`&&(t.sameSite=`Lax`)}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return parseUnparsedAttributes(e,t)}t.exports={parseSetCookie,parseUnparsedAttributes}})),ln=__commonJSMin(((e,t)=>{let{parseSetCookie:n}=cn(),{stringify:r}=sn(),{webidl:i}=$e(),{Headers:a}=Gt();function getCookies(e){i.argumentLengthCheck(arguments,1,`getCookies`),i.brandCheck(e,a,{strict:!1});let t=e.get(`cookie`),n={};if(!t)return n;for(let e of t.split(`;`)){let[t,...r]=e.split(`=`);n[t.trim()]=r.join(`=`)}return n}function deleteCookie(e,t,n){i.brandCheck(e,a,{strict:!1});let r=`deleteCookie`;i.argumentLengthCheck(arguments,2,r),t=i.converters.DOMString(t,r,`name`),n=i.converters.DeleteCookieAttributes(n),setCookie(e,{name:t,value:``,expires:new Date(0),...n})}function getSetCookies(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function setCookie(e,t){i.argumentLengthCheck(arguments,2,`setCookie`),i.brandCheck(e,a,{strict:!1}),t=i.converters.Cookie(t);let n=r(t);n&&e.append(`Set-Cookie`,n)}i.converters.DeleteCookieAttributes=i.dictionaryConverter([{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null}]),i.converters.Cookie=i.dictionaryConverter([{converter:i.converters.DOMString,key:`name`},{converter:i.converters.DOMString,key:`value`},{converter:i.nullableConverter(e=>typeof e==`number`?i.converters[`unsigned long long`](e):new Date(e)),key:`expires`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters[`long long`]),key:`maxAge`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`secure`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`httpOnly`,defaultValue:()=>null},{converter:i.converters.USVString,key:`sameSite`,allowedValues:[`Strict`,`Lax`,`None`]},{converter:i.sequenceConverter(i.converters.DOMString),key:`unparsed`,defaultValue:()=>[]}]),t.exports={getCookies,deleteCookie,getSetCookies,setCookie}})),un=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),{kEnumerableProperty:r}=z(),{kConstruct:i}=Ie(),{MessagePort:a}=R(`node:worker_threads`);var o=class MessageEvent extends Event{#e;constructor(e,t={}){if(e===i){super(arguments[1],arguments[2]),n.util.markAsUncloneable(this);return}let r=`MessageEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.MessageEventInit(t,r,`eventInitDict`),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get data(){return n.brandCheck(this,MessageEvent),this.#e.data}get origin(){return n.brandCheck(this,MessageEvent),this.#e.origin}get lastEventId(){return n.brandCheck(this,MessageEvent),this.#e.lastEventId}get source(){return n.brandCheck(this,MessageEvent),this.#e.source}get ports(){return n.brandCheck(this,MessageEvent),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,t=!1,r=!1,i=null,a=``,o=``,s=null,c=[]){return n.brandCheck(this,MessageEvent),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new MessageEvent(e,{bubbles:t,cancelable:r,data:i,origin:a,lastEventId:o,source:s,ports:c})}static createFastMessageEvent(e,t){let n=new MessageEvent(i,e,t);return n.#e=t,n.#e.data??=null,n.#e.origin??=``,n.#e.lastEventId??=``,n.#e.source??=null,n.#e.ports??=[],n}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class CloseEvent extends Event{#e;constructor(e,t={}){let r=`CloseEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get wasClean(){return n.brandCheck(this,CloseEvent),this.#e.wasClean}get code(){return n.brandCheck(this,CloseEvent),this.#e.code}get reason(){return n.brandCheck(this,CloseEvent),this.#e.reason}},l=class ErrorEvent extends Event{#e;constructor(e,t){let r=`ErrorEvent constructor`;n.argumentLengthCheck(arguments,1,r),super(e,t),n.util.markAsUncloneable(this),e=n.converters.DOMString(e,r,`type`),t=n.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return n.brandCheck(this,ErrorEvent),this.#e.message}get filename(){return n.brandCheck(this,ErrorEvent),this.#e.filename}get lineno(){return n.brandCheck(this,ErrorEvent),this.#e.lineno}get colno(){return n.brandCheck(this,ErrorEvent),this.#e.colno}get error(){return n.brandCheck(this,ErrorEvent),this.#e.error}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(l.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(a),n.converters[`sequence`]=n.sequenceConverter(n.converters.MessagePort);let u=[{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}];n.converters.MessageEventInit=n.dictionaryConverter([...u,{key:`data`,converter:n.converters.any,defaultValue:()=>null},{key:`origin`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lastEventId`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`source`,converter:n.nullableConverter(n.converters.MessagePort),defaultValue:()=>null},{key:`ports`,converter:n.converters[`sequence`],defaultValue:()=>[]}]),n.converters.CloseEventInit=n.dictionaryConverter([...u,{key:`wasClean`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`code`,converter:n.converters[`unsigned short`],defaultValue:()=>0},{key:`reason`,converter:n.converters.USVString,defaultValue:()=>``}]),n.converters.ErrorEventInit=n.dictionaryConverter([...u,{key:`message`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`filename`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lineno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`colno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`error`,converter:n.converters.any}]),t.exports={MessageEvent:o,CloseEvent:c,ErrorEvent:l,createFastMessageEvent:s}})),dn=__commonJSMin(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,sentCloseFrameState:{NOT_SENT:0,PROCESSING:1,SENT:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:2**16-1,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{string:1,typedArray:2,arrayBuffer:3,blob:4}}})),pn=__commonJSMin(((e,t)=>{t.exports={kWebSocketURL:Symbol(`url`),kReadyState:Symbol(`ready state`),kController:Symbol(`controller`),kResponse:Symbol(`response`),kBinaryType:Symbol(`binary type`),kSentClose:Symbol(`sent close`),kReceivedClose:Symbol(`received close`),kByteParser:Symbol(`byte parser`)}})),mn=__commonJSMin(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=pn(),{states:s,opcodes:c}=dn(),{ErrorEvent:l,createFastMessageEvent:u}=un(),{isUtf8:d}=R(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=Qe();function isConnecting(e){return e[n]===s.CONNECTING}function isEstablished(e){return e[n]===s.OPEN}function isClosing(e){return e[n]===s.CLOSING}function isClosed(e){return e[n]===s.CLOSED}function fireEvent(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function websocketMessageReceived(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=v(r)}catch{failWebsocketConnection(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):toArrayBuffer(r));fireEvent(`message`,e,u,{origin:e[o].origin,data:i})}function toArrayBuffer(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function isValidSubprotocol(e){if(e.length===0)return!1;for(let t=0;t126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function isValidStatusCode(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function failWebsocketConnection(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&fireEvent(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function isControlFrame(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function isContinuationFrame(e){return e===c.CONTINUATION}function isTextBinaryFrame(e){return e===c.TEXT||e===c.BINARY}function isValidOpcode(e){return isTextBinaryFrame(e)||isContinuationFrame(e)||isControlFrame(e)}function parseExtensions(e){let t={position:0},n=new Map;for(;t.position57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}let h=typeof process.versions.icu==`string`,g=h?new TextDecoder(`utf-8`,{fatal:!0}):void 0,v=h?g.decode.bind(g):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting,isEstablished,isClosing,isClosed,fireEvent,isValidSubprotocol,isValidStatusCode,failWebsocketConnection,websocketMessageReceived,utf8Decode:v,isControlFrame,isContinuationFrame,isTextBinaryFrame,isValidOpcode,parseExtensions,isValidClientWindowBits}})),hn=__commonJSMin(((e,t)=>{let{maxUnsigned16Bit:n}=dn(),r=16386,i,a=null,o=r;try{i=R(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;t */ -t.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e}createFrame(e){let t=this.frameData,r=generateMask(),i=t?.byteLength??0,a=i,o=6;i>n?(o+=8,a=127):i>125&&(o+=2,a=126);let s=Buffer.allocUnsafe(i+o);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e,s[o-4]=r[0],s[o-3]=r[1],s[o-2]=r[2],s[o-1]=r[3],s[1]=a,a===126?s.writeUInt16BE(i,2):a===127&&(s[2]=s[3]=0,s.writeUIntBE(i,4,6)),s[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=dn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=fn(),{fireEvent:f,failWebsocketConnection:p,isClosing:h,isClosed:g,isEstablished:v,parseExtensions:y}=pn(),{channels:b}=Be(),{CloseEvent:x}=un(),{makeRequest:S}=Jt(),{fetching:C}=Yt(),{Headers:w,getHeadersList:T}=Gt(),{getDecodeSplit:E}=et(),{WebsocketFrameSend:D}=mn(),O;try{O=R(`node:crypto`)}catch{}function establishWebSocketConnection(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=S({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=T(new w(o.headers)));let l=O.randomBytes(16).toString(`base64`);c.headersList.append(`sec-websocket-key`,l),c.headersList.append(`sec-websocket-version`,`13`);for(let e of t)c.headersList.append(`sec-websocket-protocol`,e);return c.headersList.append(`sec-websocket-extensions`,`permessage-deflate; client_max_window_bits`),C({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(e){if(e.type===`error`||e.status!==101){p(i,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){p(i,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){p(i,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){p(i,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==O.createHash(`sha1`).update(l+n).digest(`base64`)){p(i,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let r=e.headersList.get(`Sec-WebSocket-Extensions`),o;if(r!==null&&(o=y(r),!o.has(`permessage-deflate`))){p(i,`Sec-WebSocket-Extensions header does not match.`);return}let s=e.headersList.get(`Sec-WebSocket-Protocol`);if(s!==null&&!E(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,onSocketData),e.socket.on(`close`,onSocketClose),e.socket.on(`error`,onSocketError),b.open.hasSubscribers&&b.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function closeWebSocketConnection(e,t,n,l){if(!(h(e)||g(e))){if(!v(e))p(e,`Connection was closed before it was established.`),e[s]=r.CLOSING;else if(e[c]===i.NOT_SENT){e[c]=i.PROCESSING;let u=new D;t!==void 0&&n===void 0?(u.frameData=Buffer.allocUnsafe(2),u.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(u.frameData=Buffer.allocUnsafe(2+l),u.frameData.writeUInt16BE(t,0),u.frameData.write(n,2,`utf-8`)):u.frameData=a,e[d].socket.write(u.createFrame(o.CLOSE)),e[c]=i.SENT,e[s]=r.CLOSING}else e[s]=r.CLOSING}}function onSocketData(e){this.ws[l].write(e)||this.pause()}function onSocketClose(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,onSocketData),t.socket.off(`close`,onSocketClose),t.socket.off(`error`,onSocketError);let n=e[c]===i.SENT&&e[u],a=1005,o=``,p=e[l].closingInfo;p&&!p.error?(a=p.code??1005,o=p.reason):e[u]||(a=1006),e[s]=r.CLOSED,f(`close`,e,(e,t)=>new x(e,t),{wasClean:n,code:a,reason:o}),b.close.hasSubscribers&&b.close.publish({websocket:e,code:a,reason:o})}function onSocketError(e){let{ws:t}=this;t[s]=r.CLOSING,b.socketError.hasSubscribers&&b.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection,closeWebSocketConnection}})),gn=__commonJSMin(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=R(`node:zlib`),{isValidClientWindowBits:i}=pn(),{MessageSizeExceededError:a}=Le(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=0;constructor(e,t){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`),this.#n=t.maxPayloadSize}decompress(e,t,l){if(!this.#e){let e=r;if(this.#t.serverMaxWindowBits){if(!i(this.#t.serverMaxWindowBits)){l(Error(`Invalid server_max_window_bits`));return}e=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=n({windowBits:e})}catch(e){l(e);return}this.#e[s]=[],this.#e[c]=0,this.#e.on(`data`,e=>{if(this.#e[c]+=e.length,this.#n>0&&this.#e[c]>this.#n){l(new a),this.#e.removeAllListeners(),this.#e=null;return}this.#e[s].push(e)}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,l(null,e)})}}}})),_n=__commonJSMin(((e,t)=>{let{Writable:n}=R(`node:stream`),r=R(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=dn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=fn(),{channels:p}=Be(),{isValidStatusCode:h,isValidOpcode:g,failWebsocketConnection:v,websocketMessageReceived:y,utf8Decode:b,isControlFrame:x,isTextBinaryFrame:S,isContinuationFrame:C}=pn(),{WebsocketFrameSend:w}=mn(),{closeWebSocketConnection:T}=hn(),{PerMessageDeflate:E}=gn(),{MessageSizeExceededError:D}=Le();function failWebsocketConnectionWithCode(e,t,n){T(e,t,n,Buffer.byteLength(n)),v(e,n)}t.exports={ByteParser:class extends n{#e=[];#t=0;#n=0;#r=!1;#i=i.INFO;#a={};#o=[];#s;#c;#l;constructor(e,t,n={}){super(),this.ws=e,this.#s=t??new Map,this.#c=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#s.has(`permessage-deflate`)&&this.#s.set(`permessage-deflate`,new E(t,n))}_write(e,t,n){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(n)}#u(){return this.#l>0&&!x(this.#a.opcode)&&this.#a.payloadLength+this.#t>this.#l?(failWebsocketConnectionWithCode(this.ws,1009,`Payload size exceeds maximum allowed size`),!1):!0}run(e){for(;this.#r;)if(this.#i===i.INFO){if(this.#n<2)return e();let t=this.consume(2),n=!!(t[0]&128),r=t[0]&15,o=(t[1]&128)==128,s=!n&&r!==a.CONTINUATION,c=t[1]&127,l=t[0]&64,u=t[0]&32,d=t[0]&16;if(!g(r))return v(this.ws,`Invalid opcode received`),e();if(o)return v(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#s.has(`permessage-deflate`)){v(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){v(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!S(r)){v(this.ws,`Invalid frame type was fragmented.`);return}if(S(r)&&this.#o.length>0){v(this.ws,`Expected continuation frame`);return}if(this.#a.fragmented&&s){v(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&x(r)){v(this.ws,`Control frame either too large or fragmented`);return}if(C(r)&&this.#o.length===0&&!this.#a.compressed){v(this.ws,`Unexpected continuation frame`);return}if(c<=125){if(this.#a.payloadLength=c,this.#i=i.READ_DATA,!this.#u())return}else c===126?this.#i=i.PAYLOADLENGTH_16:c===127&&(this.#i=i.PAYLOADLENGTH_64);S(r)&&(this.#a.binaryType=r,this.#a.compressed=l!==0),this.#a.opcode=r,this.#a.masked=o,this.#a.fin=n,this.#a.fragmented=s}else if(this.#i===i.PAYLOADLENGTH_16){if(this.#n<2)return e();let t=this.consume(2);if(this.#a.payloadLength=t.readUInt16BE(0),this.#i=i.READ_DATA,!this.#u())return}else if(this.#i===i.PAYLOADLENGTH_64){if(this.#n<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){v(this.ws,`Received payload length > 2^31 bytes.`);return}if(this.#a.payloadLength=r,this.#i=i.READ_DATA,!this.#u())return}else if(this.#i===i.READ_DATA){if(this.#n{if(t){let e=t instanceof D?1009:1007;failWebsocketConnectionWithCode(this.ws,e,t.message);return}if(this.writeFragments(n)){if(this.#l>0&&this.#t>this.#l){failWebsocketConnectionWithCode(this.ws,1009,new D().message);return}if(!this.#a.fin){this.#i=i.INFO,this.#r=!0,this.run(e);return}y(this.ws,this.#a.binaryType,this.consumeFragments()),this.#r=!0,this.#i=i.INFO,this.run(e)}}),this.#r=!1;break}else{if(!this.writeFragments(t))return;if(this.#l>0&&this.#t>this.#l){failWebsocketConnectionWithCode(this.ws,1009,new D().message);return}!this.#a.fragmented&&this.#a.fin&&y(this.ws,this.#a.binaryType,this.consumeFragments()),this.#i=i.INFO}}}consume(e){if(e>this.#n)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#n-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let r=this.#e[0],{length:i}=r;if(i+n===e){t.set(this.#e.shift(),n);break}if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}t.set(this.#e.shift(),n),n+=r.length}return this.#n-=e,t}writeFragments(e){return this.#c>0&&this.#o.length===this.#c?(failWebsocketConnectionWithCode(this.ws,1008,`Too many message fragments`),!1):(this.#t+=e.length,this.#o.push(e),!0)}consumeFragments(){let e=this.#o;if(e.length===1)return this.#t=0,e.shift();let t=Buffer.concat(e,this.#t);return this.#o=[],this.#t=0,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!h(t))return{code:1002,reason:`Invalid status code`,error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=b(n)}catch{return{code:1007,reason:`Invalid UTF-8`,error:!0}}return{code:t,reason:n,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:n}=this.#a;if(t===a.CLOSE){if(n===1)return v(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#a.closeInfo=this.parseCloseBody(e),this.#a.closeInfo.error){let{code:e,reason:t}=this.#a.closeInfo;return T(this.ws,e,t,t.length),v(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#a.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#a.closeInfo.code,0));let t=new w(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[u]=c.SENT)})}return this.ws[l]=o.CLOSING,this.ws[f]=!0,!1}if(t===a.PING){if(!this.ws[f]){let t=new w(e);this.ws[d].socket.write(t.createFrame(a.PONG)),p.ping.hasSubscribers&&p.ping.publish({payload:e})}}else t===a.PONG&&p.pong.hasSubscribers&&p.pong.publish({payload:e});return!0}get closingInfo(){return this.#a.closeInfo}}}})),vn=__commonJSMin(((e,t)=>{let{WebsocketFrameSend:n}=mn(),{opcodes:r,sendHints:i}=dn(),a=dt(),o=Buffer[Symbol.species];var SendQueue=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=createFrame(e,n);if(!this.#t)this.#n.write(r,t);else{let e={promise:null,callback:t,frame:r};this.#e.push(e)}return}let r={promise:e.arrayBuffer().then(e=>{r.promise=null,r.frame=createFrame(e,n)}),callback:t,frame:null};this.#e.push(r),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#n.write(t.frame,t.callback),t.callback=t.frame=null}this.#t=!1}};function createFrame(e,t){return new n(toBuffer(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function toBuffer(e,t){switch(t){case i.string:return Buffer.from(e);case i.arrayBuffer:case i.blob:return new o(e);case i.typedArray:return new o(e.buffer,e.byteOffset,e.byteLength)}}t.exports={SendQueue}})),yn=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),{URLSerializer:r}=Qe(),{environmentSettingsObject:i}=et(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=dn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:h,kByteParser:g}=fn(),{isConnecting:v,isEstablished:y,isClosing:b,isValidSubprotocol:x,fireEvent:S}=pn(),{establishWebSocketConnection:C,closeWebSocketConnection:w}=hn(),{ByteParser:T}=_n(),{kEnumerableProperty:E,isBlobLike:D}=z(),{getGlobalDispatcher:O}=zt(),{types:k}=R(`node:util`),{ErrorEvent:A,CloseEvent:j}=un(),{SendQueue:M}=vn();var N=class WebSocket extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(e,t=[]){super(),n.util.markAsUncloneable(this);let r=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,r);let a=n.converters[`DOMString or sequence or WebSocketInit`](t,r,`options`);e=n.converters.USVString(e,r,`url`),t=a.protocols;let o=i.settingsObject.baseUrl,c;try{c=new URL(e,o)}catch(e){throw new DOMException(e,`SyntaxError`)}if(c.protocol===`http:`?c.protocol=`ws:`:c.protocol===`https:`&&(c.protocol=`wss:`),c.protocol!==`ws:`&&c.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,`SyntaxError`);if(c.hash||c.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof t==`string`&&(t=[t]),t.length!==new Set(t.map(e=>e.toLowerCase())).size||t.length>0&&!t.every(e=>x(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(c.href);let p=i.settingsObject;this[d]=C(c,t,p,this,(e,t)=>this.#a(e,t),a),this[u]=WebSocket.CONNECTING,this[h]=s.NOT_SENT,this[f]=`blob`}close(e=void 0,t=void 0){n.brandCheck(this,WebSocket);let r=`WebSocket.close`;if(e!==void 0&&(e=n.converters[`unsigned short`](e,r,`code`,{clamp:!0})),t!==void 0&&(t=n.converters.USVString(t,r,`reason`)),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let i=0;if(t!==void 0&&(i=Buffer.byteLength(t),i>123))throw new DOMException(`Reason must be less than 123 bytes; received ${i}`,`SyntaxError`);w(this,e,t,i)}send(e){n.brandCheck(this,WebSocket);let t=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,t),e=n.converters.WebSocketSendData(e,t,`data`),v(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!y(this)||b(this))){if(typeof e==`string`){let t=Buffer.byteLength(e);this.#t+=t,this.#i.add(e,()=>{this.#t-=t},c.string)}else k.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},c.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},c.typedArray)):D(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},c.blob))}}get readyState(){return n.brandCheck(this,WebSocket),this[u]}get bufferedAmount(){return n.brandCheck(this,WebSocket),this.#t}get url(){return n.brandCheck(this,WebSocket),r(this[l])}get extensions(){return n.brandCheck(this,WebSocket),this.#r}get protocol(){return n.brandCheck(this,WebSocket),this.#n}get onopen(){return n.brandCheck(this,WebSocket),this.#e.open}set onopen(e){n.brandCheck(this,WebSocket),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof e==`function`?(this.#e.open=e,this.addEventListener(`open`,e)):this.#e.open=null}get onerror(){return n.brandCheck(this,WebSocket),this.#e.error}set onerror(e){n.brandCheck(this,WebSocket),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}get onclose(){return n.brandCheck(this,WebSocket),this.#e.close}set onclose(e){n.brandCheck(this,WebSocket),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof e==`function`?(this.#e.close=e,this.addEventListener(`close`,e)):this.#e.close=null}get onmessage(){return n.brandCheck(this,WebSocket),this.#e.message}set onmessage(e){n.brandCheck(this,WebSocket),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof e==`function`?(this.#e.message=e,this.addEventListener(`message`,e)):this.#e.message=null}get binaryType(){return n.brandCheck(this,WebSocket),this[f]}set binaryType(e){n.brandCheck(this,WebSocket),e!==`blob`&&e!==`arraybuffer`?this[f]=`blob`:this[f]=e}#a(e,t){this[p]=e;let n=this[d]?.dispatcher?.webSocketOptions,r=n?.maxFragments,i=n?.maxPayloadSize,a=new T(this,t,{maxFragments:r,maxPayloadSize:i});a.on(`drain`,onParserDrain),a.on(`error`,onParserError.bind(this)),e.socket.ws=this,this[g]=a,this.#i=new M(e.socket),this[u]=o.OPEN;let s=e.headersList.get(`sec-websocket-extensions`);s!==null&&(this.#r=s);let c=e.headersList.get(`sec-websocket-protocol`);c!==null&&(this.#n=c),S(`open`,this)}};N.CONNECTING=N.prototype.CONNECTING=o.CONNECTING,N.OPEN=N.prototype.OPEN=o.OPEN,N.CLOSING=N.prototype.CLOSING=o.CLOSING,N.CLOSED=N.prototype.CLOSED=o.CLOSED,Object.defineProperties(N.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:E,readyState:E,bufferedAmount:E,onopen:E,onerror:E,onclose:E,close:E,onmessage:E,binaryType:E,send:E,extensions:E,protocol:E,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(N,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e,t,r){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e,t,r)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],defaultValue:()=>[]},{key:`dispatcher`,converter:n.converters.any,defaultValue:()=>O()},{key:`headers`,converter:n.nullableConverter(n.converters.HeadersInit)}]),n.converters[`DOMString or sequence or WebSocketInit`]=function(e){return n.util.Type(e)===`Object`&&!(Symbol.iterator in e)?n.converters.WebSocketInit(e):{protocols:n.converters[`DOMString or sequence`](e)}},n.converters.WebSocketSendData=function(e){if(n.util.Type(e)===`Object`){if(D(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||k.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function onParserDrain(){this.ws[p].socket.resume()}function onParserError(e){let t,n;e instanceof j?(t=e.reason,n=e.code):t=e.message,S(`error`,this,()=>new A(`error`,{error:e,message:t})),w(this,n)}t.exports={WebSocket:N}})),bn=__commonJSMin(((e,t)=>{function isValidLastEventId(e){return e.indexOf(`\0`)===-1}function isASCIINumber(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function delay(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId,isASCIINumber,delay}})),xn=__commonJSMin(((e,t)=>{let{Transform:n}=R(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=bn(),a=[239,187,191];t.exports={EventSourceStream:class extends n{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,n){if(e.length===0){n();return}if(this.buffer=this.buffer?Buffer.concat([this.buffer,e]):e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===a[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1}for(;this.pos0&&(t[a]=o)}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&i(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||`message`,options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}})),Sn=__commonJSMin(((e,t)=>{let{pipeline:n}=R(`node:stream`),{fetching:r}=Yt(),{makeRequest:i}=Jt(),{webidl:a}=$e(),{EventSourceStream:o}=xn(),{parseMIMEType:s}=Qe(),{createFastMessageEvent:c}=un(),{isNetworkError:l}=Kt(),{delay:u}=bn(),{kEnumerableProperty:d}=z(),{environmentSettingsObject:f}=et(),p=!1,h=3e3;var g=class EventSource extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=0;#i=null;#a=null;#o;#s;constructor(e,t={}){super(),a.util.markAsUncloneable(this);let n=`EventSource constructor`;a.argumentLengthCheck(arguments,1,n),p||(p=!0,process.emitWarning(`EventSource is experimental, expect them to change at any time.`,{code:`UNDICI-ES`})),e=a.converters.USVString(e,n,`url`),t=a.converters.EventSourceInitDict(t,n,`eventSourceInitDict`),this.#o=t.dispatcher,this.#s={lastEventId:``,reconnectionTime:h};let r=f,o;try{o=new URL(e,r.settingsObject.baseUrl),this.#s.origin=o.origin}catch(e){throw new DOMException(e,`SyntaxError`)}this.#t=o.href;let s=`anonymous`;t.withCredentials&&(s=`use-credentials`,this.#n=!0);let c={redirect:`follow`,keepalive:!0,mode:`cors`,credentials:s===`anonymous`?`same-origin`:`omit`,referrer:`no-referrer`};c.client=f.settingsObject,c.headersList=[[`accept`,{name:`accept`,value:`text/event-stream`}]],c.cache=`no-store`,c.initiator=`other`,c.urlList=[new URL(this.#t)],this.#i=i(c),this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===2)return;this.#r=0;let e={request:this.#i,dispatcher:this.#o};e.processResponseEndOfBody=e=>{l(e)&&(this.dispatchEvent(new Event(`error`)),this.close()),this.#l()},e.processResponse=e=>{if(l(e)){if(e.aborted){this.close(),this.dispatchEvent(new Event(`error`));return}this.#l();return}let t=e.headersList.get(`content-type`,!0),r=t===null?`failure`:s(t),i=r!==`failure`&&r.essence===`text/event-stream`;if(e.status!==200||i===!1){this.close(),this.dispatchEvent(new Event(`error`));return}this.#r=1,this.dispatchEvent(new Event(`open`)),this.#s.origin=e.urlList[e.urlList.length-1].origin;let a=new o({eventSourceSettings:this.#s,push:e=>{this.dispatchEvent(c(e.type,e.options))}});n(e.body.stream,a,e=>{e?.aborted===!1&&(this.close(),this.dispatchEvent(new Event(`error`)))})},this.#a=r(e)}async#l(){this.#r!==2&&(this.#r=0,this.dispatchEvent(new Event(`error`)),await u(this.#s.reconnectionTime),this.#r===0&&(this.#s.lastEventId.length&&this.#i.headersList.set(`last-event-id`,this.#s.lastEventId,!0),this.#c()))}close(){a.brandCheck(this,EventSource),this.#r!==2&&(this.#r=2,this.#a.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof e==`function`?(this.#e.open=e,this.addEventListener(`open`,e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof e==`function`?(this.#e.message=e,this.addEventListener(`message`,e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}};let v={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(g,v),Object.defineProperties(g.prototype,v),Object.defineProperties(g.prototype,{close:d,onerror:d,onmessage:d,onopen:d,readyState:d,url:d,withCredentials:d}),a.converters.EventSourceInitDict=a.dictionaryConverter([{key:`withCredentials`,converter:a.converters.boolean,defaultValue:()=>!1},{key:`dispatcher`,converter:a.converters.any}]),t.exports={EventSource:g,defaultReconnectionTime:h}})),Cn=__commonJSMin(((e,t)=>{let n=ut(),r=He(),i=mt(),a=ht(),o=gt(),s=_t(),c=vt(),l=bt(),u=Le(),d=z(),{InvalidArgumentError:f}=u,p=kt(),h=Ge(),g=Pt(),v=Rt(),y=Ft(),b=At(),x=yt(),{getGlobalDispatcher:S,setGlobalDispatcher:C}=zt(),w=Bt(),T=ct(),E=lt();Object.assign(r.prototype,p),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=i,t.exports.BalancedPool=a,t.exports.Agent=o,t.exports.ProxyAgent=s,t.exports.EnvHttpProxyAgent=c,t.exports.RetryAgent=l,t.exports.RetryHandler=x,t.exports.DecoratorHandler=w,t.exports.RedirectHandler=T,t.exports.createRedirectInterceptor=E,t.exports.interceptors={redirect:Vt(),retry:Ht(),dump:Ut(),dns:Wt()},t.exports.buildConnector=h,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function makeDispatcher(e){return(t,n,r)=>{if(typeof n==`function`&&(r=n,n=null),!t||typeof t!=`string`&&typeof t!=`object`&&!(t instanceof URL))throw new f(`invalid url`);if(n!=null&&typeof n!=`object`)throw new f(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new f(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=d.parseURL(t);let{agent:i,dispatcher:a=S()}=n;if(i)throw new f(`unsupported opts.agent. Did you mean opts.client?`);return e.call(a,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?`PUT`:`GET`)},r)}}t.exports.setGlobalDispatcher=C,t.exports.getGlobalDispatcher=S;let D=Yt().fetch;t.exports.fetch=async function(e,t=void 0){try{return await D(e,t)}catch(e){throw e&&typeof e==`object`&&Error.captureStackTrace(e),e}},t.exports.Headers=Gt().Headers,t.exports.Response=Kt().Response,t.exports.Request=Jt().Request,t.exports.FormData=rt().FormData,t.exports.File=globalThis.File??R(`node:buffer`).File,t.exports.FileReader=en().FileReader;let{setGlobalOrigin:O,getGlobalOrigin:k}=Ze();t.exports.setGlobalOrigin=O,t.exports.getGlobalOrigin=k;let{CacheStorage:A}=an(),{kConstruct:j}=tn();t.exports.caches=new A(j);let{deleteCookie:M,getCookies:N,getSetCookies:P,setCookie:ee}=ln();t.exports.deleteCookie=M,t.exports.getCookies=N,t.exports.getSetCookies=P,t.exports.setCookie=ee;let{parseMIMEType:F,serializeAMimeType:te}=Qe();t.exports.parseMIMEType=F,t.exports.serializeAMimeType=te;let{CloseEvent:ne,ErrorEvent:re,MessageEvent:I}=un();t.exports.WebSocket=yn().WebSocket,t.exports.CloseEvent=ne,t.exports.ErrorEvent=re,t.exports.MessageEvent=I,t.exports.request=makeDispatcher(p.request),t.exports.stream=makeDispatcher(p.stream),t.exports.pipeline=makeDispatcher(p.pipeline),t.exports.connect=makeDispatcher(p.connect),t.exports.upgrade=makeDispatcher(p.upgrade),t.exports.MockClient=g,t.exports.MockPool=y,t.exports.MockAgent=v,t.exports.mockErrors=b;let{EventSource:ie}=Sn();t.exports.EventSource=ie})),wn=__toESM(Fe(),1),Tn=Cn(),__awaiter$23=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},En;(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`})(En||={});var Dn;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(Dn||={});var On;(function(e){e.ApplicationJson=`application/json`})(On||={});const kn=[En.MovedPermanently,En.ResourceMoved,En.SeeOther,En.TemporaryRedirect,En.PermanentRedirect],An=[En.BadGateway,En.ServiceUnavailable,En.GatewayTimeout],jn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var Mn=class HttpClientError extends Error{constructor(e,t){super(e),this.name=`HttpClientError`,this.statusCode=t,Object.setPrototypeOf(this,HttpClientError.prototype)}},HttpClientResponse=class{constructor(e){this.message=e}readBody(){return __awaiter$23(this,void 0,void 0,function*(){return new Promise(e=>__awaiter$23(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())})}))})}readBodyBuffer(){return __awaiter$23(this,void 0,void 0,function*(){return new Promise(e=>__awaiter$23(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},HttpClient=class{constructor(e,t,n){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=this._getUserAgentWithOrchestrationId(e),this.handlers=t||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return __awaiter$23(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return __awaiter$23(this,arguments,void 0,function*(e,t={}){t[Dn.Accept]=this._getExistingOrDefaultHeader(t,Dn.Accept,On.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[Dn.Accept]=this._getExistingOrDefaultHeader(n,Dn.Accept,On.ApplicationJson),n[Dn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,On.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[Dn.Accept]=this._getExistingOrDefaultHeader(n,Dn.Accept,On.ApplicationJson),n[Dn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,On.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[Dn.Accept]=this._getExistingOrDefaultHeader(n,Dn.Accept,On.ApplicationJson),n[Dn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,On.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return __awaiter$23(this,void 0,void 0,function*(){if(this._disposed)throw Error(`Client has already been disposed.`);let i=new URL(t),a=this._prepareRequest(e,i,r),o=this._allowRetries&&jn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===En.Unauthorized){let e;for(let t of this.handlers)if(t.canHandleAuthentication(c)){e=t;break}return e?e.handleAuthentication(this,a,n):c}let t=this._maxRedirects;for(;c.message.statusCode&&kn.includes(c.message.statusCode)&&this._allowRedirects&&t>0;){let o=c.message.headers.location;if(!o)break;let s=new URL(o);if(i.protocol===`https:`&&i.protocol!==s.protocol&&!this._allowRedirectDowngrade)throw 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.`);if(yield c.readBody(),s.hostname!==i.hostname)for(let e in r)e.toLowerCase()===`authorization`&&delete r[e];a=this._prepareRequest(e,s,r),c=yield this.requestRaw(a,n),t--}if(!c.message.statusCode||!An.includes(c.message.statusCode))return c;s+=1,s{function callbackForResult(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,callbackForResult)})})}requestRawWithCallback(e,t,n){typeof t==`string`&&(e.options.headers||(e.options.headers={}),e.options.headers[`Content-Length`]=Buffer.byteLength(t,`utf8`));let r=!1;function handleResult(e,t){r||(r=!0,n(e,t))}let i=e.httpModule.request(e.options,e=>{handleResult(void 0,new HttpClientResponse(e))}),a;i.on(`socket`,e=>{a=e}),i.setTimeout(this._socketTimeout||18e4,()=>{a&&a.end(),handleResult(Error(`Request timeout: ${e.options.path}`))}),i.on(`error`,function(e){handleResult(e)}),t&&typeof t==`string`&&i.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){i.end()}),t.pipe(i)):i.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=getProxyUrl(t);if(n&&n.hostname)return this._getProxyAgentDispatcher(t,n)}_prepareRequest(e,t,n){let r={};r.parsedUrl=t;let i=r.parsedUrl.protocol===`https:`;r.httpModule=i?f:d;let a=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):a,r.options.path=(r.parsedUrl.pathname||``)+(r.parsedUrl.search||``),r.options.method=e,r.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(r.options.headers[`user-agent`]=this.userAgent),r.options.agent=this._getAgent(r.parsedUrl),this.handlers)for(let e of this.handlers)e.prepareRequest(r.options);return r}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{})):lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=lowercaseKeys(this.requestOptions.headers)[t];e&&(r=typeof e==`number`?e.toString():e)}let i=e[t];return i===void 0?r===void 0?n:r:typeof i==`number`?i.toString():i}_getExistingOrDefaultContentTypeHeader(e,t){let n;if(this.requestOptions&&this.requestOptions.headers){let e=lowercaseKeys(this.requestOptions.headers)[Dn.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[Dn.ContentType];return r===void 0?n===void 0?t:n:typeof r==`number`?String(r):Array.isArray(r)?r.join(`, `):r}_getAgent(e){let t,n=getProxyUrl(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,a=100;if(this.requestOptions&&(a=this.requestOptions.maxSockets||d.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:a,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,o=n.protocol===`https:`;r=i?o?wn.httpsOverHttps:wn.httpsOverHttp:o?wn.httpOverHttps:wn.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new f.Agent(e):new d.Agent(e),this._agent=t}return i&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;let r=e.protocol===`https:`;return n=new Tn.ProxyAgent(Object.assign({uri:t.href,pipelining:+!!this._keepAlive},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString(`base64`)}`})),this._proxyAgentDispatcher=n,r&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}_getUserAgentWithOrchestrationId(e){let t=e||`actions/http-client`,n=process.env.ACTIONS_ORCHESTRATION_ID;return n?`${t} actions_orchestration_id/${n.replace(/[^a-z0-9_.-]/gi,`_`)}`:t}_performExponentialBackoff(e){return __awaiter$23(this,void 0,void 0,function*(){e=Math.min(10,e);let t=5*2**e;return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return __awaiter$23(this,void 0,void 0,function*(){return new Promise((n,r)=>__awaiter$23(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===En.NotFound&&n(a);function dateTimeDeserializer(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let o,s;try{s=yield e.readBody(),s&&s.length>0&&(o=t&&t.deserializeDates?JSON.parse(s,dateTimeDeserializer):JSON.parse(s),a.result=o),a.headers=e.message.headers}catch{}if(i>299){let e;e=o&&o.message?o.message:s&&s.length>0?s:`Failed request: (${i})`;let t=new Mn(e,i);t.result=a.result,r(t)}else n(a)}))})}};const lowercaseKeys=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var __awaiter$22=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},BearerCredentialHandler=class{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!1}handleAuthentication(){return __awaiter$22(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},__awaiter$20=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{access:Nn,appendFile:Pn,writeFile:Fn}=c,In=`GITHUB_STEP_SUMMARY`;new class{constructor(){this._buffer=``}filePath(){return __awaiter$20(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[In];if(!e)throw Error(`Unable to find environment variable for $${In}. Check if your runtime environment supports job summaries.`);try{yield Nn(e,o.R_OK|o.W_OK)}catch{throw Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,n={}){let r=Object.entries(n).map(([e,t])=>` ${e}="${t}"`).join(``);return t?`<${e}${r}>${t}`:`<${e}${r}>`}write(e){return __awaiter$20(this,void 0,void 0,function*(){let t=!!e?.overwrite,n=yield this.filePath();return yield(t?Fn:Pn)(n,this._buffer,{encoding:`utf8`}),this.emptyBuffer()})}clear(){return __awaiter$20(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer=``,this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(r)}addCodeBlock(e,t){let n=Object.assign({},t&&{lang:t}),r=this.wrap(`pre`,this.wrap(`code`,e),n);return this.addRaw(r).addEOL()}addList(e,t=!1){let n=t?`ol`:`ul`,r=e.map(e=>this.wrap(`li`,e)).join(``),i=this.wrap(n,r);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(e=>{let t=e.map(e=>{if(typeof e==`string`)return this.wrap(`td`,e);let{header:t,data:n,colspan:r,rowspan:i}=e,a=t?`th`:`td`,o=Object.assign(Object.assign({},r&&{colspan:r}),i&&{rowspan:i});return this.wrap(a,n,o)}).join(``);return this.wrap(`tr`,t)}).join(``),n=this.wrap(`table`,t);return this.addRaw(n).addEOL()}addDetails(e,t){let n=this.wrap(`details`,this.wrap(`summary`,e)+t);return this.addRaw(n).addEOL()}addImage(e,t,n){let{width:r,height:i}=n||{},a=Object.assign(Object.assign({},r&&{width:r}),i&&{height:i}),o=this.wrap(`img`,null,Object.assign({src:e,alt:t},a));return this.addRaw(o).addEOL()}addHeading(e,t){let n=`h${t}`,r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].includes(n)?n:`h1`,i=this.wrap(r,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap(`hr`,null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap(`br`,null);return this.addRaw(e).addEOL()}addQuote(e,t){let n=Object.assign({},t&&{cite:t}),r=this.wrap(`blockquote`,e,n);return this.addRaw(r).addEOL()}addLink(e,t){let n=this.wrap(`a`,e,{href:t});return this.addRaw(n).addEOL()}};var __awaiter$19=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{chmod:Ln,copyFile:Rn,lstat:zn,mkdir:Bn,open:Vn,readdir:Hn,rename:Un,rm:Wn,rmdir:Gn,stat:Kn,symlink:qn,unlink:Jn}=a.promises,Yn=process.platform===`win32`;a.constants.O_RDONLY;function exists(e){return __awaiter$19(this,void 0,void 0,function*(){try{yield Kn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function isRooted(e){if(e=normalizeSeparators$2(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Yn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function tryGetExecutablePath(e,t){return __awaiter$19(this,void 0,void 0,function*(){let n;try{n=yield Kn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Yn){let n=u.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(isUnixExecutable(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield Kn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Yn){try{let t=u.dirname(e),n=u.basename(e).toUpperCase();for(let r of yield Hn(t))if(n===r.toUpperCase()){e=u.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}if(isUnixExecutable(n))return e}}return``})}function normalizeSeparators$2(e){return e||=``,Yn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==void 0&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==void 0&&e.uid===process.getuid()}var __awaiter$18=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function mkdirP(e){return __awaiter$18(this,void 0,void 0,function*(){v(e,`a path argument must be provided`),yield Bn(e,{recursive:!0})})}function which(e,t){return __awaiter$18(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield which(e,!1);if(!t)throw Error(Yn?`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.`:`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}let n=yield findInPath(e);return n&&n.length>0?n[0]:``})}function findInPath(e){return __awaiter$18(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Yn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(u.delimiter))e&&t.push(e);if(isRooted(e)){let n=yield tryGetExecutablePath(e,t);return n?[n]:[]}if(e.includes(u.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(u.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield tryGetExecutablePath(u.join(i,e),t);n&&r.push(n)}return r})}var __awaiter$17=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const Xn=process.platform===`win32`;var ToolRunner=class extends p.EventEmitter{constructor(e,t,n){if(super(),!e)throw Error(`Parameter 'toolPath' cannot be null or empty.`);this.toolPath=e,this.args=t||[],this.options=n||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let n=this._getSpawnFileName(),r=this._getSpawnArgs(e),i=t?``:`[command]`;if(Xn){if(this._isCmdFile()){i+=n;for(let e of r)i+=` ${e}`}else if(e.windowsVerbatimArguments){i+=`"${n}"`;for(let e of r)i+=` ${e}`}else{i+=this._windowsQuoteCmdArg(n);for(let e of r)i+=` ${this._windowsQuoteCmdArg(e)}`}}else{i+=n;for(let e of r)i+=` ${e}`}return i}_processLineBuffer(e,n,r){try{let i=n+e.toString(),a=i.indexOf(t.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+t.EOL.length),a=i.indexOf(t.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return Xn&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(Xn&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let n of this.args)t+=` `,t+=e.windowsVerbatimArguments?n:this._windowsQuoteCmdArg(n);return t+=`"`,[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,`.CMD`)||this._endsWith(e,`.BAT`)}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return`""`;let t=[` `,` `,`&`,`(`,`)`,`[`,`]`,`{`,`}`,`^`,`=`,`;`,`!`,`'`,`+`,`,`,"`",`~`,`|`,`<`,`>`,`"`],n=!1;for(let r of e)if(t.some(e=>e===r)){n=!0;break}if(!n)return e;let r=`"`,i=!0;for(let t=e.length;t>0;t--)r+=e[t-1],i&&e[t-1]===`\\`?r+=`\\`:e[t-1]===`"`?(i=!0,r+=`"`):i=!1;return r+=`"`,r.split(``).reverse().join(``)}_uvQuoteCmdArg(e){if(!e)return`""`;if(!e.includes(` `)&&!e.includes(` `)&&!e.includes(`"`))return e;if(!e.includes(`"`)&&!e.includes(`\\`))return`"${e}"`;let t=`"`,n=!0;for(let r=e.length;r>0;r--)t+=e[r-1],n&&e[r-1]===`\\`?t+=`\\`:e[r-1]===`"`?(n=!0,t+=`\\`):n=!1;return t+=`"`,t.split(``).reverse().join(``)}_cloneExecOptions(e){e||={};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e||={};let n={};return n.cwd=e.cwd,n.env=e.env,n.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(n.argv0=`"${t}"`),n}exec(){return __awaiter$17(this,void 0,void 0,function*(){return!isRooted(this.toolPath)&&(this.toolPath.includes(`/`)||Xn&&this.toolPath.includes(`\\`))&&(this.toolPath=u.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield which(this.toolPath,!0),new Promise((e,n)=>__awaiter$17(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug(`arguments:`);for(let e of this.args)this._debug(` ${e}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+t.EOL);let i=new Zn(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield exists(this.options.cwd)))return n(Error(`The cwd: ${this.options.cwd} does not exist!`));let a=this._getSpawnFileName(),o=M.spawn(a,this._getSpawnArgs(r),this._getSpawnOptions(this.options,a)),s=``;o.stdout&&o.stdout.on(`data`,e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)})});let c=``;if(o.stderr&&o.stderr.on(`data`,e=>{i.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)})}),o.on(`error`,e=>{i.processError=e.message,i.processExited=!0,i.processClosed=!0,i.CheckComplete()}),o.on(`exit`,e=>{i.processExitCode=e,i.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),i.CheckComplete()}),o.on(`close`,e=>{i.processExitCode=e,i.processExited=!0,i.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),i.CheckComplete()}),i.on(`done`,(t,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),t?n(t):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function argStringToArray(e){let t=[],n=!1,r=!1,i=``;function append(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let a=0;a0&&(t.push(i),i=``);continue}append(o)}return i.length>0&&t.push(i.trim()),t}var Zn=class ExecState extends p.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError=``,this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error(`toolPath must not be empty`);this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=N(ExecState.HandleTimeout,this.delay,this)))}_debug(e){this.emit(`debug`,e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&=(clearTimeout(this.timeout),null),this.done=!0,this.emit(`done`,e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},__awaiter$16=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function exec(e,t,n){return __awaiter$16(this,void 0,void 0,function*(){let r=argStringToArray(e);if(r.length===0)throw Error(`Parameter 'commandLine' cannot be null or empty.`);let i=r[0];return t=r.slice(1).concat(t||[]),new ToolRunner(i,t,n).exec()})}function getExecOutput(e,t,n){return __awaiter$16(this,void 0,void 0,function*(){let r=``,i=``,a=new j(`utf8`),o=new j(`utf8`),s=n?.listeners?.stdout,c=n?.listeners?.stderr,l=Object.assign(Object.assign({},n?.listeners),{stdout:e=>{r+=a.write(e),s&&s(e)},stderr:e=>{i+=o.write(e),c&&c(e)}}),u=yield exec(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}n.platform(),n.arch();var Qn;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(Qn||={});function exportVariable(e,t){let n=toCommandValue(t);if(process.env[e]=n,process.env.GITHUB_ENV)return issueFileCommand(`ENV`,prepareKeyValueMessage(e,t));issueCommand(`set-env`,{name:e},n)}function setSecret(e){issueCommand(`add-mask`,{},e)}function addPath(e){process.env.GITHUB_PATH?issueFileCommand(`PATH`,e):issueCommand(`add-path`,{},e),process.env.PATH=`${e}${u.delimiter}${process.env.PATH}`}function getInput(e,t){let n=process.env[`INPUT_${e.replace(/ /g,`_`).toUpperCase()}`]||``;if(t&&t.required&&!n)throw Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?n:n.trim()}function getBooleanInput(e,t){let n=[`true`,`True`,`TRUE`],r=[`false`,`False`,`FALSE`],i=getInput(e,t);if(n.includes(i))return!0;if(r.includes(i))return!1;throw TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\nSupport boolean input list: \`true | True | TRUE | false | False | FALSE\``)}function setOutput(e,n){if(process.env.GITHUB_OUTPUT)return issueFileCommand(`OUTPUT`,prepareKeyValueMessage(e,n));process.stdout.write(t.EOL),issueCommand(`set-output`,{name:e},toCommandValue(n))}function setFailed(e){process.exitCode=Qn.Failure,error(e)}function isDebug(){return process.env.RUNNER_DEBUG===`1`}function debug(e){issueCommand(`debug`,{},e)}function error(e,t={}){issueCommand(`error`,toCommandProperties(t),e instanceof Error?e.toString():e)}function warning(e,t={}){issueCommand(`warning`,toCommandProperties(t),e instanceof Error?e.toString():e)}function info(e){process.stdout.write(e+t.EOL)}function startGroup(e){issue(`group`,e)}function endGroup(){issue(`endgroup`)}function saveState(e,t){if(process.env.GITHUB_STATE)return issueFileCommand(`STATE`,prepareKeyValueMessage(e,t));issueCommand(`save-state`,{name:e},toCommandValue(t))}function getState(e){return process.env[`STATE_${e}`]||``}var B=__commonJSMin((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),isAlias=e=>!!e&&typeof e==`object`&&e[s]===t,isDocument=e=>!!e&&typeof e==`object`&&e[s]===n,isMap=e=>!!e&&typeof e==`object`&&e[s]===r,isPair=e=>!!e&&typeof e==`object`&&e[s]===i,isScalar=e=>!!e&&typeof e==`object`&&e[s]===a,isSeq=e=>!!e&&typeof e==`object`&&e[s]===o;function isCollection(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function isNode(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor,e.isAlias=isAlias,e.isCollection=isCollection,e.isDocument=isDocument,e.isMap=isMap,e.isNode=isNode,e.isPair=isPair,e.isScalar=isScalar,e.isSeq=isSeq})),$n=__commonJSMin((e=>{var t=B();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function visit(e,n){let r=initVisitor(n);t.isDocument(e)?visit_(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):visit_(null,e,r,Object.freeze([]))}visit.BREAK=n,visit.SKIP=r,visit.REMOVE=i;function visit_(e,r,a,o){let s=callVisitor(e,r,a,o);if(t.isNode(s)||t.isPair(s))return replaceNode(e,o,s),visit_(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e{var t=B(),n=$n();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var i=class Directives{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Directives.defaultYaml,e),this.tags=Object.assign({},Directives.defaultTags,t)}clone(){let e=new Directives(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:Directives.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},Directives.defaultTags)}return e}add(e,t){this.atNextDocument&&=(this.yaml={explicit:Directives.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},Directives.defaultTags),!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case`%TAG`:{if(n.length!==2&&(t(0,`%TAG directive should contain exactly two parts`),n.length<2))return!1;let[e,r]=n;return this.tags[e]=r,!0}case`%YAML`:{if(this.yaml.explicit=!0,n.length!==1)return t(0,`%YAML directive should contain exactly one part`),!1;let[e]=n;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let n=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,n),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+escapeTagName(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)(t!==`!!`||n!==`tag:yaml.org,2002:`)&&(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(` -`)}};i.defaultYaml={explicit:!1,version:`1.2`},i.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=i})),tr=__commonJSMin((e=>{var t=B(),n=$n();function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function anchorNames(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function findNewAnchor(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function createNodeAnchors(e,n){let r=[],i=new Map,a=null;return{onAnchor:t=>{r.push(t),a??=anchorNames(e);let i=findNewAnchor(n,a);return a.add(i),i},setAnchors:()=>{for(let e of r){let n=i.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:i}}e.anchorIsValid=anchorIsValid,e.anchorNames=anchorNames,e.createNodeAnchors=createNodeAnchors,e.findNewAnchor=findNewAnchor})),nr=__commonJSMin((e=>{function applyReviver(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t{var t=B();function toJS(e,n,r){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),r));if(e&&typeof e.toJSON==`function`){if(!r||!t.hasAnchor(e))return e.toJSON(n,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(e,i),r.onCreate=e=>{i.res=e,delete r.onCreate};let a=e.toJSON(n,r);return r.onCreate&&r.onCreate(a),a}return typeof e==`bigint`&&!r?.keep?Number(e):e}e.toJS=toJS})),ir=__commonJSMin((e=>{var t=nr(),n=B(),r=rr();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),ar=__commonJSMin((e=>{var t=tr(),n=$n(),r=B(),i=ir(),a=rr(),Alias=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let s=n.get(o);if(s||=(a.toJS(o,null,t),n.get(o)),s?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=getAliasCount(r,o,n)),s.count*s.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return s.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function getAliasCount(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=getAliasCount(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=getAliasCount(e,t.key,n),i=getAliasCount(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=Alias})),or=__commonJSMin((e=>{var t=B(),n=ir(),r=rr();let isScalarValue=e=>!e||typeof e!=`function`&&typeof e!=`object`;var Scalar=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};Scalar.BLOCK_FOLDED=`BLOCK_FOLDED`,Scalar.BLOCK_LITERAL=`BLOCK_LITERAL`,Scalar.PLAIN=`PLAIN`,Scalar.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Scalar.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=Scalar,e.isScalarValue=isScalarValue})),sr=__commonJSMin((e=>{var t=ar(),n=B(),r=or();function findTagObject(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,i,a){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=a.schema[n.MAP].createNode?.(a.schema,null,a);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:o,onAnchor:s,onTagObj:c,schema:l,sourceObjects:u}=a,d;if(o&&e&&typeof e==`object`){if(d=u.get(e),d)return d.anchor??(d.anchor=s(e)),new t.Alias(d.anchor);d={anchor:null,node:null},u.set(e,d)}i?.startsWith(`!!`)&&(i=`tag:yaml.org,2002:`+i.slice(2));let f=findTagObject(e,i,l.tags);if(!f){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return d&&(d.node=t),t}f=e instanceof Map?l[n.MAP]:Symbol.iterator in Object(e)?l[n.SEQ]:l[n.MAP]}c&&(c(f),delete a.onTagObj);let p=f?.createNode?f.createNode(a.schema,e,a):typeof f?.nodeClass?.from==`function`?f.nodeClass.from(a.schema,e,a):new r.Scalar(e);return i?p.tag=i:f.default||(p.tag=f.tag),d&&(d.node=p),p}e.createNode=createNode})),cr=__commonJSMin((e=>{var t=sr(),n=B(),r=ir();function collectionFromPath(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let isEmptyPath=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{let[r,...i]=e,a=this.get(r,!0);if(n.isCollection(a))a.addIn(i,t);else if(a===void 0&&this.schema)this.set(r,collectionFromPath(this.schema,i,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...i]=e;if(i.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(i,t);else if(e===void 0&&this.schema)this.set(r,collectionFromPath(this.schema,i,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}},e.collectionFromPath=collectionFromPath,e.isEmptyPath=isEmptyPath})),lr=__commonJSMin((e=>{let stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function indentComment(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=indentComment,e.lineComment=(e,t,n)=>e.endsWith(` +t.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e}createFrame(e){let t=this.frameData,r=generateMask(),i=t?.byteLength??0,a=i,o=6;i>n?(o+=8,a=127):i>125&&(o+=2,a=126);let s=Buffer.allocUnsafe(i+o);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e,s[o-4]=r[0],s[o-3]=r[1],s[o-2]=r[2],s[o-1]=r[3],s[1]=a,a===126?s.writeUInt16BE(i,2):a===127&&(s[2]=s[3]=0,s.writeUIntBE(i,4,6)),s[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=dn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=pn(),{fireEvent:f,failWebsocketConnection:p,isClosing:h,isClosed:g,isEstablished:v,parseExtensions:y}=mn(),{channels:b}=Be(),{CloseEvent:x}=un(),{makeRequest:S}=Jt(),{fetching:C}=Yt(),{Headers:w,getHeadersList:T}=Gt(),{getDecodeSplit:E}=et(),{WebsocketFrameSend:D}=hn(),O;try{O=R(`node:crypto`)}catch{}function establishWebSocketConnection(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=S({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=T(new w(o.headers)));let l=O.randomBytes(16).toString(`base64`);c.headersList.append(`sec-websocket-key`,l),c.headersList.append(`sec-websocket-version`,`13`);for(let e of t)c.headersList.append(`sec-websocket-protocol`,e);return c.headersList.append(`sec-websocket-extensions`,`permessage-deflate; client_max_window_bits`),C({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(e){if(e.type===`error`||e.status!==101){p(i,`Received network error or non-101 status code.`);return}if(t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){p(i,`Server did not respond with sent protocols.`);return}if(e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){p(i,`Server did not set Upgrade header to "websocket".`);return}if(e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){p(i,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==O.createHash(`sha1`).update(l+n).digest(`base64`)){p(i,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let r=e.headersList.get(`Sec-WebSocket-Extensions`),o;if(r!==null&&(o=y(r),!o.has(`permessage-deflate`))){p(i,`Sec-WebSocket-Extensions header does not match.`);return}let s=e.headersList.get(`Sec-WebSocket-Protocol`);if(s!==null&&!E(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,onSocketData),e.socket.on(`close`,onSocketClose),e.socket.on(`error`,onSocketError),b.open.hasSubscribers&&b.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function closeWebSocketConnection(e,t,n,l){if(!(h(e)||g(e))){if(!v(e))p(e,`Connection was closed before it was established.`),e[s]=r.CLOSING;else if(e[c]===i.NOT_SENT){e[c]=i.PROCESSING;let u=new D;t!==void 0&&n===void 0?(u.frameData=Buffer.allocUnsafe(2),u.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(u.frameData=Buffer.allocUnsafe(2+l),u.frameData.writeUInt16BE(t,0),u.frameData.write(n,2,`utf-8`)):u.frameData=a,e[d].socket.write(u.createFrame(o.CLOSE)),e[c]=i.SENT,e[s]=r.CLOSING}else e[s]=r.CLOSING}}function onSocketData(e){this.ws[l].write(e)||this.pause()}function onSocketClose(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,onSocketData),t.socket.off(`close`,onSocketClose),t.socket.off(`error`,onSocketError);let n=e[c]===i.SENT&&e[u],a=1005,o=``,p=e[l].closingInfo;p&&!p.error?(a=p.code??1005,o=p.reason):e[u]||(a=1006),e[s]=r.CLOSED,f(`close`,e,(e,t)=>new x(e,t),{wasClean:n,code:a,reason:o}),b.close.hasSubscribers&&b.close.publish({websocket:e,code:a,reason:o})}function onSocketError(e){let{ws:t}=this;t[s]=r.CLOSING,b.socketError.hasSubscribers&&b.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection,closeWebSocketConnection}})),_n=__commonJSMin(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=R(`node:zlib`),{isValidClientWindowBits:i}=mn(),{MessageSizeExceededError:a}=Le(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=0;constructor(e,t){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`),this.#n=t.maxPayloadSize}decompress(e,t,l){if(!this.#e){let e=r;if(this.#t.serverMaxWindowBits){if(!i(this.#t.serverMaxWindowBits)){l(Error(`Invalid server_max_window_bits`));return}e=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=n({windowBits:e})}catch(e){l(e);return}this.#e[s]=[],this.#e[c]=0,this.#e.on(`data`,e=>{if(this.#e[c]+=e.length,this.#n>0&&this.#e[c]>this.#n){l(new a),this.#e.removeAllListeners(),this.#e=null;return}this.#e[s].push(e)}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,l(null,e)})}}}})),vn=__commonJSMin(((e,t)=>{let{Writable:n}=R(`node:stream`),r=R(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=dn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=pn(),{channels:p}=Be(),{isValidStatusCode:h,isValidOpcode:g,failWebsocketConnection:v,websocketMessageReceived:y,utf8Decode:b,isControlFrame:x,isTextBinaryFrame:S,isContinuationFrame:C}=mn(),{WebsocketFrameSend:w}=hn(),{closeWebSocketConnection:T}=gn(),{PerMessageDeflate:E}=_n(),{MessageSizeExceededError:D}=Le();function failWebsocketConnectionWithCode(e,t,n){T(e,t,n,Buffer.byteLength(n)),v(e,n)}t.exports={ByteParser:class extends n{#e=[];#t=0;#n=0;#r=!1;#i=i.INFO;#a={};#o=[];#s;#c;#l;constructor(e,t,n={}){super(),this.ws=e,this.#s=t??new Map,this.#c=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#s.has(`permessage-deflate`)&&this.#s.set(`permessage-deflate`,new E(t,n))}_write(e,t,n){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(n)}#u(){return this.#l>0&&!x(this.#a.opcode)&&this.#a.payloadLength+this.#t>this.#l?(failWebsocketConnectionWithCode(this.ws,1009,`Payload size exceeds maximum allowed size`),!1):!0}run(e){for(;this.#r;)if(this.#i===i.INFO){if(this.#n<2)return e();let t=this.consume(2),n=!!(t[0]&128),r=t[0]&15,o=(t[1]&128)==128,s=!n&&r!==a.CONTINUATION,c=t[1]&127,l=t[0]&64,u=t[0]&32,d=t[0]&16;if(!g(r))return v(this.ws,`Invalid opcode received`),e();if(o)return v(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#s.has(`permessage-deflate`)){v(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){v(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!S(r)){v(this.ws,`Invalid frame type was fragmented.`);return}if(S(r)&&this.#o.length>0){v(this.ws,`Expected continuation frame`);return}if(this.#a.fragmented&&s){v(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&x(r)){v(this.ws,`Control frame either too large or fragmented`);return}if(C(r)&&this.#o.length===0&&!this.#a.compressed){v(this.ws,`Unexpected continuation frame`);return}if(c<=125){if(this.#a.payloadLength=c,this.#i=i.READ_DATA,!this.#u())return}else c===126?this.#i=i.PAYLOADLENGTH_16:c===127&&(this.#i=i.PAYLOADLENGTH_64);S(r)&&(this.#a.binaryType=r,this.#a.compressed=l!==0),this.#a.opcode=r,this.#a.masked=o,this.#a.fin=n,this.#a.fragmented=s}else if(this.#i===i.PAYLOADLENGTH_16){if(this.#n<2)return e();let t=this.consume(2);if(this.#a.payloadLength=t.readUInt16BE(0),this.#i=i.READ_DATA,!this.#u())return}else if(this.#i===i.PAYLOADLENGTH_64){if(this.#n<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){v(this.ws,`Received payload length > 2^31 bytes.`);return}if(this.#a.payloadLength=r,this.#i=i.READ_DATA,!this.#u())return}else if(this.#i===i.READ_DATA){if(this.#n{if(t){let e=t instanceof D?1009:1007;failWebsocketConnectionWithCode(this.ws,e,t.message);return}if(this.writeFragments(n)){if(this.#l>0&&this.#t>this.#l){failWebsocketConnectionWithCode(this.ws,1009,new D().message);return}if(!this.#a.fin){this.#i=i.INFO,this.#r=!0,this.run(e);return}y(this.ws,this.#a.binaryType,this.consumeFragments()),this.#r=!0,this.#i=i.INFO,this.run(e)}}),this.#r=!1;break}else{if(!this.writeFragments(t))return;if(this.#l>0&&this.#t>this.#l){failWebsocketConnectionWithCode(this.ws,1009,new D().message);return}!this.#a.fragmented&&this.#a.fin&&y(this.ws,this.#a.binaryType,this.consumeFragments()),this.#i=i.INFO}}}consume(e){if(e>this.#n)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#n-=this.#e[0].length,this.#e.shift();let t=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let r=this.#e[0],{length:i}=r;if(i+n===e){t.set(this.#e.shift(),n);break}if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}t.set(this.#e.shift(),n),n+=r.length}return this.#n-=e,t}writeFragments(e){return this.#c>0&&this.#o.length===this.#c?(failWebsocketConnectionWithCode(this.ws,1008,`Too many message fragments`),!1):(this.#t+=e.length,this.#o.push(e),!0)}consumeFragments(){let e=this.#o;if(e.length===1)return this.#t=0,e.shift();let t=Buffer.concat(e,this.#t);return this.#o=[],this.#t=0,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!h(t))return{code:1002,reason:`Invalid status code`,error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=b(n)}catch{return{code:1007,reason:`Invalid UTF-8`,error:!0}}return{code:t,reason:n,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:n}=this.#a;if(t===a.CLOSE){if(n===1)return v(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#a.closeInfo=this.parseCloseBody(e),this.#a.closeInfo.error){let{code:e,reason:t}=this.#a.closeInfo;return T(this.ws,e,t,t.length),v(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#a.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#a.closeInfo.code,0));let t=new w(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),e=>{e||(this.ws[u]=c.SENT)})}return this.ws[l]=o.CLOSING,this.ws[f]=!0,!1}if(t===a.PING){if(!this.ws[f]){let t=new w(e);this.ws[d].socket.write(t.createFrame(a.PONG)),p.ping.hasSubscribers&&p.ping.publish({payload:e})}}else t===a.PONG&&p.pong.hasSubscribers&&p.pong.publish({payload:e});return!0}get closingInfo(){return this.#a.closeInfo}}}})),yn=__commonJSMin(((e,t)=>{let{WebsocketFrameSend:n}=hn(),{opcodes:r,sendHints:i}=dn(),a=dt(),o=Buffer[Symbol.species];var SendQueue=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=createFrame(e,n);if(!this.#t)this.#n.write(r,t);else{let e={promise:null,callback:t,frame:r};this.#e.push(e)}return}let r={promise:e.arrayBuffer().then(e=>{r.promise=null,r.frame=createFrame(e,n)}),callback:t,frame:null};this.#e.push(r),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#n.write(t.frame,t.callback),t.callback=t.frame=null}this.#t=!1}};function createFrame(e,t){return new n(toBuffer(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function toBuffer(e,t){switch(t){case i.string:return Buffer.from(e);case i.arrayBuffer:case i.blob:return new o(e);case i.typedArray:return new o(e.buffer,e.byteOffset,e.byteLength)}}t.exports={SendQueue}})),bn=__commonJSMin(((e,t)=>{let{webidl:n}=$e(),{URLSerializer:r}=Qe(),{environmentSettingsObject:i}=et(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=dn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:h,kByteParser:g}=pn(),{isConnecting:v,isEstablished:y,isClosing:b,isValidSubprotocol:x,fireEvent:S}=mn(),{establishWebSocketConnection:C,closeWebSocketConnection:w}=gn(),{ByteParser:T}=vn(),{kEnumerableProperty:E,isBlobLike:D}=z(),{getGlobalDispatcher:O}=zt(),{types:k}=R(`node:util`),{ErrorEvent:A,CloseEvent:j}=un(),{SendQueue:M}=yn();var N=class WebSocket extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(e,t=[]){super(),n.util.markAsUncloneable(this);let r=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,r);let a=n.converters[`DOMString or sequence or WebSocketInit`](t,r,`options`);e=n.converters.USVString(e,r,`url`),t=a.protocols;let o=i.settingsObject.baseUrl,c;try{c=new URL(e,o)}catch(e){throw new DOMException(e,`SyntaxError`)}if(c.protocol===`http:`?c.protocol=`ws:`:c.protocol===`https:`&&(c.protocol=`wss:`),c.protocol!==`ws:`&&c.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,`SyntaxError`);if(c.hash||c.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof t==`string`&&(t=[t]),t.length!==new Set(t.map(e=>e.toLowerCase())).size||t.length>0&&!t.every(e=>x(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(c.href);let p=i.settingsObject;this[d]=C(c,t,p,this,(e,t)=>this.#a(e,t),a),this[u]=WebSocket.CONNECTING,this[h]=s.NOT_SENT,this[f]=`blob`}close(e=void 0,t=void 0){n.brandCheck(this,WebSocket);let r=`WebSocket.close`;if(e!==void 0&&(e=n.converters[`unsigned short`](e,r,`code`,{clamp:!0})),t!==void 0&&(t=n.converters.USVString(t,r,`reason`)),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let i=0;if(t!==void 0&&(i=Buffer.byteLength(t),i>123))throw new DOMException(`Reason must be less than 123 bytes; received ${i}`,`SyntaxError`);w(this,e,t,i)}send(e){n.brandCheck(this,WebSocket);let t=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,t),e=n.converters.WebSocketSendData(e,t,`data`),v(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!y(this)||b(this))){if(typeof e==`string`){let t=Buffer.byteLength(e);this.#t+=t,this.#i.add(e,()=>{this.#t-=t},c.string)}else k.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},c.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},c.typedArray)):D(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},c.blob))}}get readyState(){return n.brandCheck(this,WebSocket),this[u]}get bufferedAmount(){return n.brandCheck(this,WebSocket),this.#t}get url(){return n.brandCheck(this,WebSocket),r(this[l])}get extensions(){return n.brandCheck(this,WebSocket),this.#r}get protocol(){return n.brandCheck(this,WebSocket),this.#n}get onopen(){return n.brandCheck(this,WebSocket),this.#e.open}set onopen(e){n.brandCheck(this,WebSocket),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof e==`function`?(this.#e.open=e,this.addEventListener(`open`,e)):this.#e.open=null}get onerror(){return n.brandCheck(this,WebSocket),this.#e.error}set onerror(e){n.brandCheck(this,WebSocket),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}get onclose(){return n.brandCheck(this,WebSocket),this.#e.close}set onclose(e){n.brandCheck(this,WebSocket),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof e==`function`?(this.#e.close=e,this.addEventListener(`close`,e)):this.#e.close=null}get onmessage(){return n.brandCheck(this,WebSocket),this.#e.message}set onmessage(e){n.brandCheck(this,WebSocket),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof e==`function`?(this.#e.message=e,this.addEventListener(`message`,e)):this.#e.message=null}get binaryType(){return n.brandCheck(this,WebSocket),this[f]}set binaryType(e){n.brandCheck(this,WebSocket),e!==`blob`&&e!==`arraybuffer`?this[f]=`blob`:this[f]=e}#a(e,t){this[p]=e;let n=this[d]?.dispatcher?.webSocketOptions,r=n?.maxFragments,i=n?.maxPayloadSize,a=new T(this,t,{maxFragments:r,maxPayloadSize:i});a.on(`drain`,onParserDrain),a.on(`error`,onParserError.bind(this)),e.socket.ws=this,this[g]=a,this.#i=new M(e.socket),this[u]=o.OPEN;let s=e.headersList.get(`sec-websocket-extensions`);s!==null&&(this.#r=s);let c=e.headersList.get(`sec-websocket-protocol`);c!==null&&(this.#n=c),S(`open`,this)}};N.CONNECTING=N.prototype.CONNECTING=o.CONNECTING,N.OPEN=N.prototype.OPEN=o.OPEN,N.CLOSING=N.prototype.CLOSING=o.CLOSING,N.CLOSED=N.prototype.CLOSED=o.CLOSED,Object.defineProperties(N.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:E,readyState:E,bufferedAmount:E,onopen:E,onerror:E,onclose:E,close:E,onmessage:E,binaryType:E,send:E,extensions:E,protocol:E,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(N,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a}),n.converters[`sequence`]=n.sequenceConverter(n.converters.DOMString),n.converters[`DOMString or sequence`]=function(e,t,r){return n.util.Type(e)===`Object`&&Symbol.iterator in e?n.converters[`sequence`](e):n.converters.DOMString(e,t,r)},n.converters.WebSocketInit=n.dictionaryConverter([{key:`protocols`,converter:n.converters[`DOMString or sequence`],defaultValue:()=>[]},{key:`dispatcher`,converter:n.converters.any,defaultValue:()=>O()},{key:`headers`,converter:n.nullableConverter(n.converters.HeadersInit)}]),n.converters[`DOMString or sequence or WebSocketInit`]=function(e){return n.util.Type(e)===`Object`&&!(Symbol.iterator in e)?n.converters.WebSocketInit(e):{protocols:n.converters[`DOMString or sequence`](e)}},n.converters.WebSocketSendData=function(e){if(n.util.Type(e)===`Object`){if(D(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||k.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function onParserDrain(){this.ws[p].socket.resume()}function onParserError(e){let t,n;e instanceof j?(t=e.reason,n=e.code):t=e.message,S(`error`,this,()=>new A(`error`,{error:e,message:t})),w(this,n)}t.exports={WebSocket:N}})),xn=__commonJSMin(((e,t)=>{function isValidLastEventId(e){return e.indexOf(`\0`)===-1}function isASCIINumber(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function delay(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId,isASCIINumber,delay}})),Sn=__commonJSMin(((e,t)=>{let{Transform:n}=R(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=xn(),a=[239,187,191];t.exports={EventSourceStream:class extends n{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,n){if(e.length===0){n();return}if(this.buffer=this.buffer?Buffer.concat([this.buffer,e]):e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===a[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===a[0]&&this.buffer[1]===a[1]&&this.buffer[2]===a[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1}for(;this.pos0&&(t[a]=o)}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&i(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||`message`,options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}})),Cn=__commonJSMin(((e,t)=>{let{pipeline:n}=R(`node:stream`),{fetching:r}=Yt(),{makeRequest:i}=Jt(),{webidl:a}=$e(),{EventSourceStream:o}=Sn(),{parseMIMEType:s}=Qe(),{createFastMessageEvent:c}=un(),{isNetworkError:l}=Kt(),{delay:u}=xn(),{kEnumerableProperty:d}=z(),{environmentSettingsObject:f}=et(),p=!1,h=3e3;var g=class EventSource extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#r=0;#i=null;#a=null;#o;#s;constructor(e,t={}){super(),a.util.markAsUncloneable(this);let n=`EventSource constructor`;a.argumentLengthCheck(arguments,1,n),p||(p=!0,process.emitWarning(`EventSource is experimental, expect them to change at any time.`,{code:`UNDICI-ES`})),e=a.converters.USVString(e,n,`url`),t=a.converters.EventSourceInitDict(t,n,`eventSourceInitDict`),this.#o=t.dispatcher,this.#s={lastEventId:``,reconnectionTime:h};let r=f,o;try{o=new URL(e,r.settingsObject.baseUrl),this.#s.origin=o.origin}catch(e){throw new DOMException(e,`SyntaxError`)}this.#t=o.href;let s=`anonymous`;t.withCredentials&&(s=`use-credentials`,this.#n=!0);let c={redirect:`follow`,keepalive:!0,mode:`cors`,credentials:s===`anonymous`?`same-origin`:`omit`,referrer:`no-referrer`};c.client=f.settingsObject,c.headersList=[[`accept`,{name:`accept`,value:`text/event-stream`}]],c.cache=`no-store`,c.initiator=`other`,c.urlList=[new URL(this.#t)],this.#i=i(c),this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===2)return;this.#r=0;let e={request:this.#i,dispatcher:this.#o};e.processResponseEndOfBody=e=>{l(e)&&(this.dispatchEvent(new Event(`error`)),this.close()),this.#l()},e.processResponse=e=>{if(l(e)){if(e.aborted){this.close(),this.dispatchEvent(new Event(`error`));return}this.#l();return}let t=e.headersList.get(`content-type`,!0),r=t===null?`failure`:s(t),i=r!==`failure`&&r.essence===`text/event-stream`;if(e.status!==200||i===!1){this.close(),this.dispatchEvent(new Event(`error`));return}this.#r=1,this.dispatchEvent(new Event(`open`)),this.#s.origin=e.urlList[e.urlList.length-1].origin;let a=new o({eventSourceSettings:this.#s,push:e=>{this.dispatchEvent(c(e.type,e.options))}});n(e.body.stream,a,e=>{e?.aborted===!1&&(this.close(),this.dispatchEvent(new Event(`error`)))})},this.#a=r(e)}async#l(){this.#r!==2&&(this.#r=0,this.dispatchEvent(new Event(`error`)),await u(this.#s.reconnectionTime),this.#r===0&&(this.#s.lastEventId.length&&this.#i.headersList.set(`last-event-id`,this.#s.lastEventId,!0),this.#c()))}close(){a.brandCheck(this,EventSource),this.#r!==2&&(this.#r=2,this.#a.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof e==`function`?(this.#e.open=e,this.addEventListener(`open`,e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof e==`function`?(this.#e.message=e,this.addEventListener(`message`,e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof e==`function`?(this.#e.error=e,this.addEventListener(`error`,e)):this.#e.error=null}};let v={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(g,v),Object.defineProperties(g.prototype,v),Object.defineProperties(g.prototype,{close:d,onerror:d,onmessage:d,onopen:d,readyState:d,url:d,withCredentials:d}),a.converters.EventSourceInitDict=a.dictionaryConverter([{key:`withCredentials`,converter:a.converters.boolean,defaultValue:()=>!1},{key:`dispatcher`,converter:a.converters.any}]),t.exports={EventSource:g,defaultReconnectionTime:h}})),wn=__commonJSMin(((e,t)=>{let n=ut(),r=He(),i=mt(),a=ht(),o=gt(),s=_t(),c=vt(),l=bt(),u=Le(),d=z(),{InvalidArgumentError:f}=u,p=kt(),h=Ge(),g=Pt(),v=Rt(),y=Ft(),b=At(),x=yt(),{getGlobalDispatcher:S,setGlobalDispatcher:C}=zt(),w=Bt(),T=ct(),E=lt();Object.assign(r.prototype,p),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=i,t.exports.BalancedPool=a,t.exports.Agent=o,t.exports.ProxyAgent=s,t.exports.EnvHttpProxyAgent=c,t.exports.RetryAgent=l,t.exports.RetryHandler=x,t.exports.DecoratorHandler=w,t.exports.RedirectHandler=T,t.exports.createRedirectInterceptor=E,t.exports.interceptors={redirect:Vt(),retry:Ht(),dump:Ut(),dns:Wt()},t.exports.buildConnector=h,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function makeDispatcher(e){return(t,n,r)=>{if(typeof n==`function`&&(r=n,n=null),!t||typeof t!=`string`&&typeof t!=`object`&&!(t instanceof URL))throw new f(`invalid url`);if(n!=null&&typeof n!=`object`)throw new f(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new f(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=d.parseURL(t);let{agent:i,dispatcher:a=S()}=n;if(i)throw new f(`unsupported opts.agent. Did you mean opts.client?`);return e.call(a,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?`PUT`:`GET`)},r)}}t.exports.setGlobalDispatcher=C,t.exports.getGlobalDispatcher=S;let D=Yt().fetch;t.exports.fetch=async function(e,t=void 0){try{return await D(e,t)}catch(e){throw e&&typeof e==`object`&&Error.captureStackTrace(e),e}},t.exports.Headers=Gt().Headers,t.exports.Response=Kt().Response,t.exports.Request=Jt().Request,t.exports.FormData=rt().FormData,t.exports.File=globalThis.File??R(`node:buffer`).File,t.exports.FileReader=en().FileReader;let{setGlobalOrigin:O,getGlobalOrigin:k}=Ze();t.exports.setGlobalOrigin=O,t.exports.getGlobalOrigin=k;let{CacheStorage:A}=an(),{kConstruct:j}=tn();t.exports.caches=new A(j);let{deleteCookie:M,getCookies:N,getSetCookies:P,setCookie:ee}=ln();t.exports.deleteCookie=M,t.exports.getCookies=N,t.exports.getSetCookies=P,t.exports.setCookie=ee;let{parseMIMEType:F,serializeAMimeType:te}=Qe();t.exports.parseMIMEType=F,t.exports.serializeAMimeType=te;let{CloseEvent:ne,ErrorEvent:re,MessageEvent:I}=un();t.exports.WebSocket=bn().WebSocket,t.exports.CloseEvent=ne,t.exports.ErrorEvent=re,t.exports.MessageEvent=I,t.exports.request=makeDispatcher(p.request),t.exports.stream=makeDispatcher(p.stream),t.exports.pipeline=makeDispatcher(p.pipeline),t.exports.connect=makeDispatcher(p.connect),t.exports.upgrade=makeDispatcher(p.upgrade),t.exports.MockClient=g,t.exports.MockPool=y,t.exports.MockAgent=v,t.exports.mockErrors=b;let{EventSource:ie}=Cn();t.exports.EventSource=ie})),Tn=__toESM(Fe(),1),En=wn(),__awaiter$23=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},Dn;(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`})(Dn||={});var On;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(On||={});var kn;(function(e){e.ApplicationJson=`application/json`})(kn||={});const An=[Dn.MovedPermanently,Dn.ResourceMoved,Dn.SeeOther,Dn.TemporaryRedirect,Dn.PermanentRedirect],jn=[Dn.BadGateway,Dn.ServiceUnavailable,Dn.GatewayTimeout],Mn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var Nn=class HttpClientError extends Error{constructor(e,t){super(e),this.name=`HttpClientError`,this.statusCode=t,Object.setPrototypeOf(this,HttpClientError.prototype)}},HttpClientResponse=class{constructor(e){this.message=e}readBody(){return __awaiter$23(this,void 0,void 0,function*(){return new Promise(e=>__awaiter$23(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())})}))})}readBodyBuffer(){return __awaiter$23(this,void 0,void 0,function*(){return new Promise(e=>__awaiter$23(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},HttpClient=class{constructor(e,t,n){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=this._getUserAgentWithOrchestrationId(e),this.handlers=t||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return __awaiter$23(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return __awaiter$23(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return __awaiter$23(this,arguments,void 0,function*(e,t={}){t[On.Accept]=this._getExistingOrDefaultHeader(t,On.Accept,kn.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[On.Accept]=this._getExistingOrDefaultHeader(n,On.Accept,kn.ApplicationJson),n[On.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,kn.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[On.Accept]=this._getExistingOrDefaultHeader(n,On.Accept,kn.ApplicationJson),n[On.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,kn.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return __awaiter$23(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[On.Accept]=this._getExistingOrDefaultHeader(n,On.Accept,kn.ApplicationJson),n[On.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,kn.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return __awaiter$23(this,void 0,void 0,function*(){if(this._disposed)throw Error(`Client has already been disposed.`);let i=new URL(t),a=this._prepareRequest(e,i,r),o=this._allowRetries&&Mn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===Dn.Unauthorized){let e;for(let t of this.handlers)if(t.canHandleAuthentication(c)){e=t;break}return e?e.handleAuthentication(this,a,n):c}let t=this._maxRedirects;for(;c.message.statusCode&&An.includes(c.message.statusCode)&&this._allowRedirects&&t>0;){let o=c.message.headers.location;if(!o)break;let s=new URL(o);if(i.protocol===`https:`&&i.protocol!==s.protocol&&!this._allowRedirectDowngrade)throw 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.`);if(yield c.readBody(),s.hostname!==i.hostname)for(let e in r)e.toLowerCase()===`authorization`&&delete r[e];a=this._prepareRequest(e,s,r),c=yield this.requestRaw(a,n),t--}if(!c.message.statusCode||!jn.includes(c.message.statusCode))return c;s+=1,s{function callbackForResult(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,callbackForResult)})})}requestRawWithCallback(e,t,n){typeof t==`string`&&(e.options.headers||(e.options.headers={}),e.options.headers[`Content-Length`]=Buffer.byteLength(t,`utf8`));let r=!1;function handleResult(e,t){r||(r=!0,n(e,t))}let i=e.httpModule.request(e.options,e=>{handleResult(void 0,new HttpClientResponse(e))}),a;i.on(`socket`,e=>{a=e}),i.setTimeout(this._socketTimeout||18e4,()=>{a&&a.end(),handleResult(Error(`Request timeout: ${e.options.path}`))}),i.on(`error`,function(e){handleResult(e)}),t&&typeof t==`string`&&i.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){i.end()}),t.pipe(i)):i.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=getProxyUrl(t);if(n&&n.hostname)return this._getProxyAgentDispatcher(t,n)}_prepareRequest(e,t,n){let r={};r.parsedUrl=t;let i=r.parsedUrl.protocol===`https:`;r.httpModule=i?f:d;let a=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):a,r.options.path=(r.parsedUrl.pathname||``)+(r.parsedUrl.search||``),r.options.method=e,r.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(r.options.headers[`user-agent`]=this.userAgent),r.options.agent=this._getAgent(r.parsedUrl),this.handlers)for(let e of this.handlers)e.prepareRequest(r.options);return r}_mergeHeaders(e){return this.requestOptions&&this.requestOptions.headers?Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{})):lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=lowercaseKeys(this.requestOptions.headers)[t];e&&(r=typeof e==`number`?e.toString():e)}let i=e[t];return i===void 0?r===void 0?n:r:typeof i==`number`?i.toString():i}_getExistingOrDefaultContentTypeHeader(e,t){let n;if(this.requestOptions&&this.requestOptions.headers){let e=lowercaseKeys(this.requestOptions.headers)[On.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[On.ContentType];return r===void 0?n===void 0?t:n:typeof r==`number`?String(r):Array.isArray(r)?r.join(`, `):r}_getAgent(e){let t,n=getProxyUrl(e),r=n&&n.hostname;if(this._keepAlive&&r&&(t=this._proxyAgent),r||(t=this._agent),t)return t;let i=e.protocol===`https:`,a=100;if(this.requestOptions&&(a=this.requestOptions.maxSockets||d.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:a,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,o=n.protocol===`https:`;r=i?o?Tn.httpsOverHttps:Tn.httpsOverHttp:o?Tn.httpOverHttps:Tn.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new f.Agent(e):new d.Agent(e),this._agent=t}return i&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t}_getProxyAgentDispatcher(e,t){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;let r=e.protocol===`https:`;return n=new En.ProxyAgent(Object.assign({uri:t.href,pipelining:+!!this._keepAlive},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString(`base64`)}`})),this._proxyAgentDispatcher=n,r&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}_getUserAgentWithOrchestrationId(e){let t=e||`actions/http-client`,n=process.env.ACTIONS_ORCHESTRATION_ID;return n?`${t} actions_orchestration_id/${n.replace(/[^a-z0-9_.-]/gi,`_`)}`:t}_performExponentialBackoff(e){return __awaiter$23(this,void 0,void 0,function*(){e=Math.min(10,e);let t=5*2**e;return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return __awaiter$23(this,void 0,void 0,function*(){return new Promise((n,r)=>__awaiter$23(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===Dn.NotFound&&n(a);function dateTimeDeserializer(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let o,s;try{s=yield e.readBody(),s&&s.length>0&&(o=t&&t.deserializeDates?JSON.parse(s,dateTimeDeserializer):JSON.parse(s),a.result=o),a.headers=e.message.headers}catch{}if(i>299){let e;e=o&&o.message?o.message:s&&s.length>0?s:`Failed request: (${i})`;let t=new Nn(e,i);t.result=a.result,r(t)}else n(a)}))})}};const lowercaseKeys=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var __awaiter$22=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},BearerCredentialHandler=class{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!1}handleAuthentication(){return __awaiter$22(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},__awaiter$20=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{access:Pn,appendFile:Fn,writeFile:In}=c,Ln=`GITHUB_STEP_SUMMARY`;new class{constructor(){this._buffer=``}filePath(){return __awaiter$20(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[Ln];if(!e)throw Error(`Unable to find environment variable for $${Ln}. Check if your runtime environment supports job summaries.`);try{yield Pn(e,o.R_OK|o.W_OK)}catch{throw Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,n={}){let r=Object.entries(n).map(([e,t])=>` ${e}="${t}"`).join(``);return t?`<${e}${r}>${t}`:`<${e}${r}>`}write(e){return __awaiter$20(this,void 0,void 0,function*(){let t=!!e?.overwrite,n=yield this.filePath();return yield(t?In:Fn)(n,this._buffer,{encoding:`utf8`}),this.emptyBuffer()})}clear(){return __awaiter$20(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer=``,this}addRaw(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(r)}addCodeBlock(e,t){let n=Object.assign({},t&&{lang:t}),r=this.wrap(`pre`,this.wrap(`code`,e),n);return this.addRaw(r).addEOL()}addList(e,t=!1){let n=t?`ol`:`ul`,r=e.map(e=>this.wrap(`li`,e)).join(``),i=this.wrap(n,r);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(e=>{let t=e.map(e=>{if(typeof e==`string`)return this.wrap(`td`,e);let{header:t,data:n,colspan:r,rowspan:i}=e,a=t?`th`:`td`,o=Object.assign(Object.assign({},r&&{colspan:r}),i&&{rowspan:i});return this.wrap(a,n,o)}).join(``);return this.wrap(`tr`,t)}).join(``),n=this.wrap(`table`,t);return this.addRaw(n).addEOL()}addDetails(e,t){let n=this.wrap(`details`,this.wrap(`summary`,e)+t);return this.addRaw(n).addEOL()}addImage(e,t,n){let{width:r,height:i}=n||{},a=Object.assign(Object.assign({},r&&{width:r}),i&&{height:i}),o=this.wrap(`img`,null,Object.assign({src:e,alt:t},a));return this.addRaw(o).addEOL()}addHeading(e,t){let n=`h${t}`,r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].includes(n)?n:`h1`,i=this.wrap(r,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap(`hr`,null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap(`br`,null);return this.addRaw(e).addEOL()}addQuote(e,t){let n=Object.assign({},t&&{cite:t}),r=this.wrap(`blockquote`,e,n);return this.addRaw(r).addEOL()}addLink(e,t){let n=this.wrap(`a`,e,{href:t});return this.addRaw(n).addEOL()}};var __awaiter$19=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{chmod:Rn,copyFile:zn,lstat:Bn,mkdir:Vn,open:Hn,readdir:Un,rename:Wn,rm:Gn,rmdir:Kn,stat:qn,symlink:Jn,unlink:Yn}=a.promises,Xn=process.platform===`win32`;a.constants.O_RDONLY;function exists(e){return __awaiter$19(this,void 0,void 0,function*(){try{yield qn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function isRooted(e){if(e=normalizeSeparators$2(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Xn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function tryGetExecutablePath(e,t){return __awaiter$19(this,void 0,void 0,function*(){let n;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){let n=u.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(isUnixExecutable(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield qn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Xn){try{let t=u.dirname(e),n=u.basename(e).toUpperCase();for(let r of yield Un(t))if(n===r.toUpperCase()){e=u.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}if(isUnixExecutable(n))return e}}return``})}function normalizeSeparators$2(e){return e||=``,Xn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==void 0&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==void 0&&e.uid===process.getuid()}var __awaiter$18=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function mkdirP(e){return __awaiter$18(this,void 0,void 0,function*(){v(e,`a path argument must be provided`),yield Vn(e,{recursive:!0})})}function which(e,t){return __awaiter$18(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield which(e,!1);if(!t)throw Error(Xn?`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.`:`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}let n=yield findInPath(e);return n&&n.length>0?n[0]:``})}function findInPath(e){return __awaiter$18(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Xn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(u.delimiter))e&&t.push(e);if(isRooted(e)){let n=yield tryGetExecutablePath(e,t);return n?[n]:[]}if(e.includes(u.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(u.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield tryGetExecutablePath(u.join(i,e),t);n&&r.push(n)}return r})}var __awaiter$17=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const Zn=process.platform===`win32`;var ToolRunner=class extends p.EventEmitter{constructor(e,t,n){if(super(),!e)throw Error(`Parameter 'toolPath' cannot be null or empty.`);this.toolPath=e,this.args=t||[],this.options=n||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let n=this._getSpawnFileName(),r=this._getSpawnArgs(e),i=t?``:`[command]`;if(Zn){if(this._isCmdFile()){i+=n;for(let e of r)i+=` ${e}`}else if(e.windowsVerbatimArguments){i+=`"${n}"`;for(let e of r)i+=` ${e}`}else{i+=this._windowsQuoteCmdArg(n);for(let e of r)i+=` ${this._windowsQuoteCmdArg(e)}`}}else{i+=n;for(let e of r)i+=` ${e}`}return i}_processLineBuffer(e,n,r){try{let i=n+e.toString(),a=i.indexOf(t.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+t.EOL.length),a=i.indexOf(t.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return Zn&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(Zn&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let n of this.args)t+=` `,t+=e.windowsVerbatimArguments?n:this._windowsQuoteCmdArg(n);return t+=`"`,[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,`.CMD`)||this._endsWith(e,`.BAT`)}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return`""`;let t=[` `,` `,`&`,`(`,`)`,`[`,`]`,`{`,`}`,`^`,`=`,`;`,`!`,`'`,`+`,`,`,"`",`~`,`|`,`<`,`>`,`"`],n=!1;for(let r of e)if(t.some(e=>e===r)){n=!0;break}if(!n)return e;let r=`"`,i=!0;for(let t=e.length;t>0;t--)r+=e[t-1],i&&e[t-1]===`\\`?r+=`\\`:e[t-1]===`"`?(i=!0,r+=`"`):i=!1;return r+=`"`,r.split(``).reverse().join(``)}_uvQuoteCmdArg(e){if(!e)return`""`;if(!e.includes(` `)&&!e.includes(` `)&&!e.includes(`"`))return e;if(!e.includes(`"`)&&!e.includes(`\\`))return`"${e}"`;let t=`"`,n=!0;for(let r=e.length;r>0;r--)t+=e[r-1],n&&e[r-1]===`\\`?t+=`\\`:e[r-1]===`"`?(n=!0,t+=`\\`):n=!1;return t+=`"`,t.split(``).reverse().join(``)}_cloneExecOptions(e){e||={};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e||={};let n={};return n.cwd=e.cwd,n.env=e.env,n.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(n.argv0=`"${t}"`),n}exec(){return __awaiter$17(this,void 0,void 0,function*(){return!isRooted(this.toolPath)&&(this.toolPath.includes(`/`)||Zn&&this.toolPath.includes(`\\`))&&(this.toolPath=u.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield which(this.toolPath,!0),new Promise((e,n)=>__awaiter$17(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug(`arguments:`);for(let e of this.args)this._debug(` ${e}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+t.EOL);let i=new Qn(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield exists(this.options.cwd)))return n(Error(`The cwd: ${this.options.cwd} does not exist!`));let a=this._getSpawnFileName(),o=M.spawn(a,this._getSpawnArgs(r),this._getSpawnOptions(this.options,a)),s=``;o.stdout&&o.stdout.on(`data`,e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),s=this._processLineBuffer(e,s,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e)})});let c=``;if(o.stderr&&o.stderr.on(`data`,e=>{i.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(e),c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e)})}),o.on(`error`,e=>{i.processError=e.message,i.processExited=!0,i.processClosed=!0,i.CheckComplete()}),o.on(`exit`,e=>{i.processExitCode=e,i.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),i.CheckComplete()}),o.on(`close`,e=>{i.processExitCode=e,i.processExited=!0,i.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),i.CheckComplete()}),i.on(`done`,(t,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),t?n(t):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function argStringToArray(e){let t=[],n=!1,r=!1,i=``;function append(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let a=0;a0&&(t.push(i),i=``);continue}append(o)}return i.length>0&&t.push(i.trim()),t}var Qn=class ExecState extends p.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError=``,this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error(`toolPath must not be empty`);this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=N(ExecState.HandleTimeout,this.delay,this)))}_debug(e){this.emit(`debug`,e)}_setResult(){let e;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&=(clearTimeout(this.timeout),null),this.done=!0,this.emit(`done`,e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},__awaiter$16=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function exec(e,t,n){return __awaiter$16(this,void 0,void 0,function*(){let r=argStringToArray(e);if(r.length===0)throw Error(`Parameter 'commandLine' cannot be null or empty.`);let i=r[0];return t=r.slice(1).concat(t||[]),new ToolRunner(i,t,n).exec()})}function getExecOutput(e,t,n){return __awaiter$16(this,void 0,void 0,function*(){let r=``,i=``,a=new j(`utf8`),o=new j(`utf8`),s=n?.listeners?.stdout,c=n?.listeners?.stderr,l=Object.assign(Object.assign({},n?.listeners),{stdout:e=>{r+=a.write(e),s&&s(e)},stderr:e=>{i+=o.write(e),c&&c(e)}}),u=yield exec(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}n.platform(),n.arch();var $n;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})($n||={});function exportVariable(e,t){let n=toCommandValue(t);if(process.env[e]=n,process.env.GITHUB_ENV)return issueFileCommand(`ENV`,prepareKeyValueMessage(e,t));issueCommand(`set-env`,{name:e},n)}function setSecret(e){issueCommand(`add-mask`,{},e)}function addPath(e){process.env.GITHUB_PATH?issueFileCommand(`PATH`,e):issueCommand(`add-path`,{},e),process.env.PATH=`${e}${u.delimiter}${process.env.PATH}`}function getInput(e,t){let n=process.env[`INPUT_${e.replace(/ /g,`_`).toUpperCase()}`]||``;if(t&&t.required&&!n)throw Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?n:n.trim()}function getBooleanInput(e,t){let n=[`true`,`True`,`TRUE`],r=[`false`,`False`,`FALSE`],i=getInput(e,t);if(n.includes(i))return!0;if(r.includes(i))return!1;throw TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\nSupport boolean input list: \`true | True | TRUE | false | False | FALSE\``)}function setOutput(e,n){if(process.env.GITHUB_OUTPUT)return issueFileCommand(`OUTPUT`,prepareKeyValueMessage(e,n));process.stdout.write(t.EOL),issueCommand(`set-output`,{name:e},toCommandValue(n))}function setFailed(e){process.exitCode=$n.Failure,error(e)}function isDebug(){return process.env.RUNNER_DEBUG===`1`}function debug(e){issueCommand(`debug`,{},e)}function error(e,t={}){issueCommand(`error`,toCommandProperties(t),e instanceof Error?e.toString():e)}function warning(e,t={}){issueCommand(`warning`,toCommandProperties(t),e instanceof Error?e.toString():e)}function info(e){process.stdout.write(e+t.EOL)}function startGroup(e){issue(`group`,e)}function endGroup(){issue(`endgroup`)}function saveState(e,t){if(process.env.GITHUB_STATE)return issueFileCommand(`STATE`,prepareKeyValueMessage(e,t));issueCommand(`save-state`,{name:e},toCommandValue(t))}function getState(e){return process.env[`STATE_${e}`]||``}var B=__commonJSMin((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),isAlias=e=>!!e&&typeof e==`object`&&e[s]===t,isDocument=e=>!!e&&typeof e==`object`&&e[s]===n,isMap=e=>!!e&&typeof e==`object`&&e[s]===r,isPair=e=>!!e&&typeof e==`object`&&e[s]===i,isScalar=e=>!!e&&typeof e==`object`&&e[s]===a,isSeq=e=>!!e&&typeof e==`object`&&e[s]===o;function isCollection(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function isNode(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor,e.isAlias=isAlias,e.isCollection=isCollection,e.isDocument=isDocument,e.isMap=isMap,e.isNode=isNode,e.isPair=isPair,e.isScalar=isScalar,e.isSeq=isSeq})),er=__commonJSMin((e=>{var t=B();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function visit(e,n){let r=initVisitor(n);t.isDocument(e)?visit_(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):visit_(null,e,r,Object.freeze([]))}visit.BREAK=n,visit.SKIP=r,visit.REMOVE=i;function visit_(e,r,a,o){let s=callVisitor(e,r,a,o);if(t.isNode(s)||t.isPair(s))return replaceNode(e,o,s),visit_(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e{var t=B(),n=er();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},escapeTagName=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var i=class Directives{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Directives.defaultYaml,e),this.tags=Object.assign({},Directives.defaultTags,t)}clone(){let e=new Directives(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:Directives.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},Directives.defaultTags)}return e}add(e,t){this.atNextDocument&&=(this.yaml={explicit:Directives.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},Directives.defaultTags),!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case`%TAG`:{if(n.length!==2&&(t(0,`%TAG directive should contain exactly two parts`),n.length<2))return!1;let[e,r]=n;return this.tags[e]=r,!0}case`%YAML`:{if(this.yaml.explicit=!0,n.length!==1)return t(0,`%YAML directive should contain exactly one part`),!1;let[e]=n;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let n=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,n),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+escapeTagName(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)(t!==`!!`||n!==`tag:yaml.org,2002:`)&&(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(` +`)}};i.defaultYaml={explicit:!1,version:`1.2`},i.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=i})),nr=__commonJSMin((e=>{var t=B(),n=er();function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function anchorNames(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function findNewAnchor(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function createNodeAnchors(e,n){let r=[],i=new Map,a=null;return{onAnchor:t=>{r.push(t),a??=anchorNames(e);let i=findNewAnchor(n,a);return a.add(i),i},setAnchors:()=>{for(let e of r){let n=i.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:i}}e.anchorIsValid=anchorIsValid,e.anchorNames=anchorNames,e.createNodeAnchors=createNodeAnchors,e.findNewAnchor=findNewAnchor})),rr=__commonJSMin((e=>{function applyReviver(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t{var t=B();function toJS(e,n,r){if(Array.isArray(e))return e.map((e,t)=>toJS(e,String(t),r));if(e&&typeof e.toJSON==`function`){if(!r||!t.hasAnchor(e))return e.toJSON(n,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(e,i),r.onCreate=e=>{i.res=e,delete r.onCreate};let a=e.toJSON(n,r);return r.onCreate&&r.onCreate(a),a}return typeof e==`bigint`&&!r?.keep?Number(e):e}e.toJS=toJS})),ar=__commonJSMin((e=>{var t=rr(),n=B(),r=ir();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),or=__commonJSMin((e=>{var t=nr(),n=er(),r=B(),i=ar(),a=ir(),Alias=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let s=n.get(o);if(s||=(a.toJS(o,null,t),n.get(o)),s?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=getAliasCount(r,o,n)),s.count*s.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return s.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function getAliasCount(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=getAliasCount(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=getAliasCount(e,t.key,n),i=getAliasCount(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=Alias})),sr=__commonJSMin((e=>{var t=B(),n=ar(),r=ir();let isScalarValue=e=>!e||typeof e!=`function`&&typeof e!=`object`;var Scalar=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};Scalar.BLOCK_FOLDED=`BLOCK_FOLDED`,Scalar.BLOCK_LITERAL=`BLOCK_LITERAL`,Scalar.PLAIN=`PLAIN`,Scalar.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Scalar.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=Scalar,e.isScalarValue=isScalarValue})),cr=__commonJSMin((e=>{var t=or(),n=B(),r=sr();function findTagObject(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function createNode(e,i,a){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=a.schema[n.MAP].createNode?.(a.schema,null,a);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:o,onAnchor:s,onTagObj:c,schema:l,sourceObjects:u}=a,d;if(o&&e&&typeof e==`object`){if(d=u.get(e),d)return d.anchor??(d.anchor=s(e)),new t.Alias(d.anchor);d={anchor:null,node:null},u.set(e,d)}i?.startsWith(`!!`)&&(i=`tag:yaml.org,2002:`+i.slice(2));let f=findTagObject(e,i,l.tags);if(!f){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return d&&(d.node=t),t}f=e instanceof Map?l[n.MAP]:Symbol.iterator in Object(e)?l[n.SEQ]:l[n.MAP]}c&&(c(f),delete a.onTagObj);let p=f?.createNode?f.createNode(a.schema,e,a):typeof f?.nodeClass?.from==`function`?f.nodeClass.from(a.schema,e,a):new r.Scalar(e);return i?p.tag=i:f.default||(p.tag=f.tag),d&&(d.node=p),p}e.createNode=createNode})),lr=__commonJSMin((e=>{var t=cr(),n=B(),r=ar();function collectionFromPath(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let isEmptyPath=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{let[r,...i]=e,a=this.get(r,!0);if(n.isCollection(a))a.addIn(i,t);else if(a===void 0&&this.schema)this.set(r,collectionFromPath(this.schema,i,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...i]=e;if(i.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(i,t);else if(e===void 0&&this.schema)this.set(r,collectionFromPath(this.schema,i,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}},e.collectionFromPath=collectionFromPath,e.isEmptyPath=isEmptyPath})),ur=__commonJSMin((e=>{let stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function indentComment(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=indentComment,e.lineComment=(e,t,n)=>e.endsWith(` `)?indentComment(n,t):n.includes(` `)?` -`+indentComment(n,t):(e.endsWith(` `)?``:` `)+n,e.stringifyComment=stringifyComment})),ur=__commonJSMin((e=>{let t=`block`,n=`quoted`;function foldFlowLines(e,r,i=`flow`,{indentAtStart:a,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return e;oo-Math.max(2,s)?d.push(0):p=o-a);let h,g,v=!1,y=-1,b=-1,x=-1;i===t&&(y=consumeMoreIndentedLines(e,y,r.length),y!==-1&&(p=y+u));for(let a;a=e[y+=1];){if(i===n&&a===`\\`){switch(b=y,e[y+1]){case`x`:y+=3;break;case`u`:y+=5;break;case`U`:y+=9;break;default:y+=1}x=y}if(a===` +`+indentComment(n,t):(e.endsWith(` `)?``:` `)+n,e.stringifyComment=stringifyComment})),dr=__commonJSMin((e=>{let t=`block`,n=`quoted`;function foldFlowLines(e,r,i=`flow`,{indentAtStart:a,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return e;oo-Math.max(2,s)?d.push(0):p=o-a);let h,g,v=!1,y=-1,b=-1,x=-1;i===t&&(y=consumeMoreIndentedLines(e,y,r.length),y!==-1&&(p=y+u));for(let a;a=e[y+=1];){if(i===n&&a===`\\`){switch(b=y,e[y+1]){case`x`:y+=3;break;case`u`:y+=5;break;case`U`:y+=9;break;default:y+=1}x=y}if(a===` `)i===t&&(y=consumeMoreIndentedLines(e,y,r.length)),p=y+r.length+u,h=void 0;else{if(a===` `&&g&&g!==` `&&g!==` `&&g!==` `){let t=e[y+1];t&&t!==` `&&t!==` `&&t!==` `&&(h=y)}if(y>=p){if(h)d.push(h),p=h+u,h=void 0;else if(i===n){for(;g===` `||g===` `;)g=a,a=e[y+=1],v=!0;let t=y>x+1?y-2:b-1;if(f[t])return e;d.push(t),f[t]=!0,p=t+u,h=void 0}else v=!0}}g=a}if(v&&l&&l(),d.length===0)return e;c&&c();let S=e.slice(0,d[0]);for(let t=0;t{var t=or(),n=ur();let getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t{var t=sr(),n=dr();let getFoldOptions=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),containsDocumentMarker=e=>/^(%|---|\.\.\.)/m.test(e);function lineLengthOverLimit(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;tr)return!0;if(n=t+1,i-n<=r)return!1}return!0}function doubleQuotedString(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=t,a=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(containsDocumentMarker(e)?` `:``),s=``,c=0;for(let e=0,t=r[e];t;t=r[++e])if(t===` `&&r[e+1]===`\\`&&r[e+2]===`n`&&(s+=r.slice(c,e)+`\\ `,e+=1,c=e,t=`\\`),t===`\\`)switch(r[e+1]){case`u`:{s+=r.slice(c,e);let t=r.substr(e+2,4);switch(t){case`0000`:s+=`\\0`;break;case`0007`:s+=`\\a`;break;case`000b`:s+=`\\v`;break;case`001b`:s+=`\\e`;break;case`0085`:s+=`\\N`;break;case`00a0`:s+=`\\_`;break;case`2028`:s+=`\\L`;break;case`2029`:s+=`\\P`;break;default:t.substr(0,2)===`00`?s+=`\\x`+t.substr(2):s+=r.substr(e,6)}e+=5,c=e+1}break;case`n`:if(i||r[e+2]===`"`||r.length{r=!0});let c=n.foldFlowLines(`${C}${e}${v}`,f,n.FOLD_BLOCK,s);if(!r)return`>${w}\n${f}${c}`}return a=a.replace(/\n+/g,`$&${f}`),`|${w}\n${f}${C}${a}${v}`}function plainString(e,r,i,a){let{type:o,value:s}=e,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=r;if(l&&s.includes(` `)||f&&/[[\]{},]/.test(s))return quotedString(s,r);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` `)?quotedString(s,r):blockString(e,r,i,a);if(!l&&!f&&o!==t.Scalar.PLAIN&&s.includes(` -`))return blockString(e,r,i,a);if(containsDocumentMarker(s)){if(u===``)return r.forceBlockIndent=!0,blockString(e,r,i,a);if(l&&u===d)return quotedString(s,r)}let p=s.replace(/\n+/g,`$&\n${u}`);if(c){let test=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(p),{compat:e,tags:t}=r.doc.schema;if(t.some(test)||e?.some(test))return quotedString(s,r)}return l?p:n.foldFlowLines(p,u,n.FOLD_FLOW,getFoldOptions(r,!1))}function stringifyString(e,n,r,i){let{implicitKey:a,inFlow:o}=n,s=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:c}=e;c!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(c=t.Scalar.QUOTE_DOUBLE);let _stringify=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||o?quotedString(s.value,n):blockString(s,n,r,i);case t.Scalar.QUOTE_DOUBLE:return doubleQuotedString(s.value,n);case t.Scalar.QUOTE_SINGLE:return singleQuotedString(s.value,n);case t.Scalar.PLAIN:return plainString(s,n,r,i);default:return null}},l=_stringify(c);if(l===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(l=_stringify(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}e.stringifyString=stringifyString})),fr=__commonJSMin((e=>{var t=tr(),n=B(),r=lr(),i=dr();function createStringifyContext(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function getTagObject(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function stringifyProps(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function stringify(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o,s=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>o=e});o??=getTagObject(t.doc.schema.tags,s);let c=stringifyProps(s,o,t);c.length>0&&(t.indentAtStart=(t.indentAtStart??0)+c.length+1);let l=typeof o.stringify==`function`?o.stringify(s,t,r,a):n.isScalar(s)?i.stringifyString(s,t,r,a):s.toString(t,r,a);return c?n.isScalar(s)||l[0]===`{`||l[0]===`[`?`${c} ${l}`:`${c}\n${t.indent}${l}`:l}e.createStringifyContext=createStringifyContext,e.stringify=stringify})),pr=__commonJSMin((e=>{var t=B(),n=or(),r=fr(),i=lr();function stringifyPair({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:h,simpleKeys:g}}=o,v=t.isNode(e)&&e.comment||null;if(g){if(v)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let y=!g&&(!e||v&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(g||!l),indent:d+f});let b=!1,x=!1,S=r.stringify(e,o,()=>b=!0,()=>x=!0);if(!y&&!o.inFlow&&S.length>1024){if(g)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);y=!0}if(o.inFlow){if(l||a==null)return b&&s&&s(),S===``?`?`:y?`? ${S}`:S}else if(l&&!g||a==null&&y)return S=`? ${S}`,v&&!b?S+=i.lineComment(S,o.indent,p(v)):x&&c&&c(),S;b&&(v=null),y?(v&&(S+=i.lineComment(S,o.indent,p(v))),S=`? ${S}\n${d}:`):(S=`${S}:`,v&&(S+=i.lineComment(S,o.indent,p(v))));let C,w,T;t.isNode(a)?(C=!!a.spaceBefore,w=a.commentBefore,T=a.comment):(C=!1,w=null,T=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!y&&!v&&t.isScalar(a)&&(o.indentAtStart=S.length+1),x=!1,!h&&f.length>=2&&!o.inFlow&&!y&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let E=!1,D=r.stringify(a,o,()=>E=!0,()=>x=!0),O=` `;if(v||C||w){if(O=C?` +`))return blockString(e,r,i,a);if(containsDocumentMarker(s)){if(u===``)return r.forceBlockIndent=!0,blockString(e,r,i,a);if(l&&u===d)return quotedString(s,r)}let p=s.replace(/\n+/g,`$&\n${u}`);if(c){let test=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(p),{compat:e,tags:t}=r.doc.schema;if(t.some(test)||e?.some(test))return quotedString(s,r)}return l?p:n.foldFlowLines(p,u,n.FOLD_FLOW,getFoldOptions(r,!1))}function stringifyString(e,n,r,i){let{implicitKey:a,inFlow:o}=n,s=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:c}=e;c!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(c=t.Scalar.QUOTE_DOUBLE);let _stringify=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||o?quotedString(s.value,n):blockString(s,n,r,i);case t.Scalar.QUOTE_DOUBLE:return doubleQuotedString(s.value,n);case t.Scalar.QUOTE_SINGLE:return singleQuotedString(s.value,n);case t.Scalar.PLAIN:return plainString(s,n,r,i);default:return null}},l=_stringify(c);if(l===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(l=_stringify(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}e.stringifyString=stringifyString})),pr=__commonJSMin((e=>{var t=nr(),n=B(),r=ur(),i=fr();function createStringifyContext(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function getTagObject(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function stringifyProps(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function stringify(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o,s=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>o=e});o??=getTagObject(t.doc.schema.tags,s);let c=stringifyProps(s,o,t);c.length>0&&(t.indentAtStart=(t.indentAtStart??0)+c.length+1);let l=typeof o.stringify==`function`?o.stringify(s,t,r,a):n.isScalar(s)?i.stringifyString(s,t,r,a):s.toString(t,r,a);return c?n.isScalar(s)||l[0]===`{`||l[0]===`[`?`${c} ${l}`:`${c}\n${t.indent}${l}`:l}e.createStringifyContext=createStringifyContext,e.stringify=stringify})),mr=__commonJSMin((e=>{var t=B(),n=sr(),r=pr(),i=ur();function stringifyPair({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:h,simpleKeys:g}}=o,v=t.isNode(e)&&e.comment||null;if(g){if(v)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let y=!g&&(!e||v&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!y&&(g||!l),indent:d+f});let b=!1,x=!1,S=r.stringify(e,o,()=>b=!0,()=>x=!0);if(!y&&!o.inFlow&&S.length>1024){if(g)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);y=!0}if(o.inFlow){if(l||a==null)return b&&s&&s(),S===``?`?`:y?`? ${S}`:S}else if(l&&!g||a==null&&y)return S=`? ${S}`,v&&!b?S+=i.lineComment(S,o.indent,p(v)):x&&c&&c(),S;b&&(v=null),y?(v&&(S+=i.lineComment(S,o.indent,p(v))),S=`? ${S}\n${d}:`):(S=`${S}:`,v&&(S+=i.lineComment(S,o.indent,p(v))));let C,w,T;t.isNode(a)?(C=!!a.spaceBefore,w=a.commentBefore,T=a.comment):(C=!1,w=null,T=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!y&&!v&&t.isScalar(a)&&(o.indentAtStart=S.length+1),x=!1,!h&&f.length>=2&&!o.inFlow&&!y&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let E=!1,D=r.stringify(a,o,()=>E=!0,()=>x=!0),O=` `;if(v||C||w){if(O=C?` `:``,w){let e=p(w);O+=`\n${i.indentComment(e,o.indent)}`}D===``&&!o.inFlow?O===` `&&T&&(O=` `):O+=`\n${o.indent}`}else if(!y&&t.isCollection(a)){let e=D[0],t=D.indexOf(` `),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=D.indexOf(` `);e===`&`&&n!==-1&&n{var t=R(`process`);function debug(e,...t){e===`debug`&&console.log(...t)}function warn(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=debug,e.warn=warn})),hr=__commonJSMin((e=>{var t=B(),n=or();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:addMergeToJSMap}),stringify:()=>`<<`},isMergeKey=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function addMergeToJSMap(e,n,r){let i=resolveAliasValue(e,r);if(t.isSeq(i))for(let t of i.items)mergeValue(e,n,t);else if(Array.isArray(i))for(let t of i)mergeValue(e,n,t);else mergeValue(e,n,i)}function mergeValue(e,n,r){let i=resolveAliasValue(e,r);if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}function resolveAliasValue(e,n){return e&&t.isAlias(n)?n.resolve(e.doc,e):n}e.addMergeToJSMap=addMergeToJSMap,e.isMergeKey=isMergeKey,e.merge=r})),gr=__commonJSMin((e=>{var t=mr(),n=hr(),r=fr(),i=B(),a=rr();function addPairToJSMap(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=stringifyKey(r,n,e),s=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[i]=s}}return t}function stringifyKey(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=addPairToJSMap})),_r=__commonJSMin((e=>{var t=sr(),n=pr(),r=gr(),i=B();function createPair(e,n,r){return new a(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var a=class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return i.isNode(t)&&(t=t.clone(e)),i.isNode(n)&&(n=n.clone(e)),new Pair(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=a,e.createPair=createPair})),vr=__commonJSMin((e=>{var t=B(),n=fr(),r=lr();function stringifyCollection(e,t,n){return(t.inFlow??e.flow?stringifyFlowCollection:stringifyBlockCollection)(e,t,n)}function stringifyBlockCollection({comment:e,items:i},a,{blockItemPrefix:o,flowChars:s,itemIndent:c,onChompKeep:l,onComment:u}){let{indent:d,options:{commentString:f}}=a,p=Object.assign({},a,{indent:c,type:null}),h=!1,g=[];for(let e=0;el=null,()=>h=!0);l&&(u+=r.lineComment(u,c,f(l))),h&&l&&(h=!1),g.push(o+u)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let e=1;e{var t=R(`process`);function debug(e,...t){e===`debug`&&console.log(...t)}function warn(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=debug,e.warn=warn})),gr=__commonJSMin((e=>{var t=B(),n=sr();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:addMergeToJSMap}),stringify:()=>`<<`},isMergeKey=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function addMergeToJSMap(e,n,r){let i=resolveAliasValue(e,r);if(t.isSeq(i))for(let t of i.items)mergeValue(e,n,t);else if(Array.isArray(i))for(let t of i)mergeValue(e,n,t);else mergeValue(e,n,i)}function mergeValue(e,n,r){let i=resolveAliasValue(e,r);if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}function resolveAliasValue(e,n){return e&&t.isAlias(n)?n.resolve(e.doc,e):n}e.addMergeToJSMap=addMergeToJSMap,e.isMergeKey=isMergeKey,e.merge=r})),_r=__commonJSMin((e=>{var t=hr(),n=gr(),r=pr(),i=B(),a=ir();function addPairToJSMap(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=stringifyKey(r,n,e),s=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[i]=s}}return t}function stringifyKey(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=addPairToJSMap})),vr=__commonJSMin((e=>{var t=cr(),n=mr(),r=_r(),i=B();function createPair(e,n,r){return new a(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var a=class Pair{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return i.isNode(t)&&(t=t.clone(e)),i.isNode(n)&&(n=n.clone(e)),new Pair(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=a,e.createPair=createPair})),yr=__commonJSMin((e=>{var t=B(),n=pr(),r=ur();function stringifyCollection(e,t,n){return(t.inFlow??e.flow?stringifyFlowCollection:stringifyBlockCollection)(e,t,n)}function stringifyBlockCollection({comment:e,items:i},a,{blockItemPrefix:o,flowChars:s,itemIndent:c,onChompKeep:l,onComment:u}){let{indent:d,options:{commentString:f}}=a,p=Object.assign({},a,{indent:c,type:null}),h=!1,g=[];for(let e=0;el=null,()=>h=!0);l&&(u+=r.lineComment(u,c,f(l))),h&&l&&(h=!1),g.push(o+u)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let e=1;ec=null);f||=h.length>p||l.includes(` `),a0&&(f||=h.reduce((e,t)=>e+t.length+2,2)+(l.length+2)>i.options.lineWidth),f&&(l+=`,`)),c&&(l+=r.lineComment(l,o,u(c))),h.push(l),p=h.length}let{start:g,end:v}=a;if(h.length===0)return g+v;if(!f){let e=h.reduce((e,t)=>e+t.length+2,2);f=i.options.lineWidth>0&&e>i.options.lineWidth}if(f){let e=g;for(let t of h)e+=t?`\n${c}${s}${t}`:` -`;return`${e}\n${s}${v}`}return`${g}${l}${h.join(` `)}${l}${v}`}function addCommentBefore({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=stringifyCollection})),yr=__commonJSMin((e=>{var t=vr(),n=gr(),r=cr(),i=B(),a=_r(),o=or();function findPair(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),add=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)add(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))add(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=findPair(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(s){let e=this.items.findIndex(e=>s(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=findPair(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=findPair(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=findPair})),br=__commonJSMin((e=>{var t=B(),n=yr();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),xr=__commonJSMin((e=>{var t=sr(),n=vr(),r=cr(),i=B(),a=or(),o=rr(),YAMLSeq=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=asItemIndex(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=asItemIndex(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=asItemIndex(e);return typeof t==`number`&&t=0?t:null}e.YAMLSeq=YAMLSeq})),Sr=__commonJSMin((e=>{var t=B(),n=xr();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),Cr=__commonJSMin((e=>{var t=dr();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),wr=__commonJSMin((e=>{var t=or();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),Tr=__commonJSMin((e=>{var t=or();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),Er=__commonJSMin((e=>{function stringifyNumber({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}e.stringifyNumber=stringifyNumber})),Dr=__commonJSMin((e=>{var t=or(),n=Er();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Or=__commonJSMin((e=>{var t=Er();let intIdentify=e=>typeof e==`bigint`||Number.isInteger(e),intResolve=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function intStringify(e,n,r){let{value:i}=e;return intIdentify(i)&&i>=0?r+i.toString(n):t.stringifyNumber(e)}e.int={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>intResolve(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>intIdentify(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>intResolve(e,2,16,n),stringify:e=>intStringify(e,16,`0x`)},e.intOct={identify:e=>intIdentify(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>intResolve(e,2,8,n),stringify:e=>intStringify(e,8,`0o`)}})),kr=__commonJSMin((e=>{var t=br(),n=wr(),r=Sr(),i=Cr(),a=Tr(),o=Dr(),s=Or();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),Ar=__commonJSMin((e=>{var t=or(),n=br(),r=Sr();function intIdentify(e){return typeof e==`bigint`||Number.isInteger(e)}let stringifyJSON=({value:e})=>JSON.stringify(e),i=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:stringifyJSON},{identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];e.schema=[n.map,r.seq].concat(i,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),jr=__commonJSMin((e=>{var t=R(`buffer`),n=or(),r=dr();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e{var t=B(),n=_r(),r=or(),i=xr();function resolvePairs(e,i){if(t.isSeq(e))for(let a=0;a1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function createPairs(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e)){if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let a={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:resolvePairs,createNode:createPairs};e.createPairs=createPairs,e.pairs=a,e.resolvePairs=resolvePairs})),Nr=__commonJSMin((e=>{var t=B(),n=rr(),r=yr(),i=xr(),a=Mr(),o=class YAMLOMap extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=YAMLOMap.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),Pr=__commonJSMin((e=>{var t=or();function boolStringify({value:e,source:t},i){return t&&(e?n:r).test.test(t)?t:e?i.options.trueStr:i.options.falseStr}let n={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:boolStringify},r={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:boolStringify};e.falseTag=r,e.trueTag=n})),Fr=__commonJSMin((e=>{var t=or(),n=Er();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Ir=__commonJSMin((e=>{var t=Er();let intIdentify=e=>typeof e==`bigint`||Number.isInteger(e);function intResolve(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function intStringify(e,n,r){let{value:i}=e;if(intIdentify(i)){let e=i.toString(n);return i<0?`-`+r+e.substr(1):r+e}return t.stringifyNumber(e)}let n={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>intResolve(e,2,2,n),stringify:e=>intStringify(e,2,`0b`)},r={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>intResolve(e,1,8,n),stringify:e=>intStringify(e,8,`0`)},i={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>intResolve(e,0,10,n),stringify:t.stringifyNumber},a={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>intResolve(e,2,16,n),stringify:e=>intStringify(e,16,`0x`)};e.int=i,e.intBin=n,e.intHex=a,e.intOct=r})),Lr=__commonJSMin((e=>{var t=B(),n=_r(),r=yr(),i=class YAMLSet extends r.YAMLMap{constructor(e){super(e),this.tag=YAMLSet.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),Rr=__commonJSMin((e=>{var t=Er();function parseSexagesimal(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,num=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*num(60)+num(t),num(0));return n===`-`?num(-1)*i:i}function stringifySexagesimal(e){let{value:n}=e,num=e=>e;if(typeof n==`bigint`)num=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let r=``;n<0&&(r=`-`,n*=num(-1));let i=num(60),a=[n%i];return n<60?a.unshift(0):(n=(n-a[0])/i,a.unshift(n%i),n>=60&&(n=(n-a[0])/i,a.unshift(n))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let n={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>parseSexagesimal(e,n),stringify:stringifySexagesimal},r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,!1),stringify:stringifySexagesimal},i={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(i.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,a,o,s,c]=t.map(Number),l=t[7]?Number((t[7]+`00`).substr(1,3)):0,u=Date.UTC(n,r-1,a,o||0,s||0,c||0,l),d=t[8];if(d&&d!==`Z`){let e=parseSexagesimal(d,!1);Math.abs(e)<30&&(e*=60),u-=6e4*e}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=r,e.intTime=n,e.timestamp=i})),zr=__commonJSMin((e=>{var t=br(),n=wr(),r=Sr(),i=Cr(),a=jr(),o=Pr(),s=Fr(),c=Ir(),l=hr(),u=Nr(),d=Mr(),f=Lr(),p=Rr();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),Br=__commonJSMin((e=>{var t=br(),n=wr(),r=Sr(),i=Cr(),a=Tr(),o=Dr(),s=Or(),c=kr(),l=Ar(),u=jr(),d=hr(),f=Nr(),p=Mr(),h=zr(),g=Lr(),v=Rr();let y=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,h.schema],[`yaml-1.1`,h.schema]]),b={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:v.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:v.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:g.set,timestamp:v.timestamp},x={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":g.set,"tag:yaml.org,2002:timestamp":v.timestamp};function getTags(e,t,n){let r=y.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(y.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?b[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(b).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=x,e.getTags=getTags})),Vr=__commonJSMin((e=>{var t=B(),n=br(),r=Sr(),i=Cr(),a=Br();let sortMapEntriesByKey=(e,t)=>e.keyt.key);e.Schema=class Schema{constructor({compat:e,customTags:o,merge:s,resolveKnownTags:c,schema:l,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof l==`string`&&l||`core`,this.knownTags=c?a.coreKnownTags:{},this.tags=a.getTags(o,this.name,s),this.toStringOptions=d??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof u==`function`?u:u===!0?sortMapEntriesByKey:null}clone(){let e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}})),Hr=__commonJSMin((e=>{var t=B(),n=fr(),r=lr();function stringifyDocument(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd){if(e.comment){let t=c(e.comment);t.includes(` +`;return`${e}\n${s}${v}`}return`${g}${l}${h.join(` `)}${l}${v}`}function addCommentBefore({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=stringifyCollection})),br=__commonJSMin((e=>{var t=yr(),n=_r(),r=lr(),i=B(),a=vr(),o=sr();function findPair(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),add=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)add(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))add(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=findPair(this.items,n.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(s){let e=this.items.findIndex(e=>s(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=findPair(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=findPair(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=findPair})),xr=__commonJSMin((e=>{var t=B(),n=br();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),Sr=__commonJSMin((e=>{var t=cr(),n=yr(),r=lr(),i=B(),a=sr(),o=ir(),YAMLSeq=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=asItemIndex(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=asItemIndex(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=asItemIndex(e);return typeof t==`number`&&t=0?t:null}e.YAMLSeq=YAMLSeq})),Cr=__commonJSMin((e=>{var t=B(),n=Sr();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),wr=__commonJSMin((e=>{var t=fr();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),Tr=__commonJSMin((e=>{var t=sr();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),Er=__commonJSMin((e=>{var t=sr();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),Dr=__commonJSMin((e=>{function stringifyNumber({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}e.stringifyNumber=stringifyNumber})),Or=__commonJSMin((e=>{var t=sr(),n=Dr();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),kr=__commonJSMin((e=>{var t=Dr();let intIdentify=e=>typeof e==`bigint`||Number.isInteger(e),intResolve=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function intStringify(e,n,r){let{value:i}=e;return intIdentify(i)&&i>=0?r+i.toString(n):t.stringifyNumber(e)}e.int={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>intResolve(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>intIdentify(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>intResolve(e,2,16,n),stringify:e=>intStringify(e,16,`0x`)},e.intOct={identify:e=>intIdentify(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>intResolve(e,2,8,n),stringify:e=>intStringify(e,8,`0o`)}})),Ar=__commonJSMin((e=>{var t=xr(),n=Tr(),r=Cr(),i=wr(),a=Er(),o=Or(),s=kr();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),jr=__commonJSMin((e=>{var t=sr(),n=xr(),r=Cr();function intIdentify(e){return typeof e==`bigint`||Number.isInteger(e)}let stringifyJSON=({value:e})=>JSON.stringify(e),i=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:stringifyJSON},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:stringifyJSON},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:stringifyJSON},{identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>intIdentify(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:stringifyJSON}];e.schema=[n.map,r.seq].concat(i,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),Mr=__commonJSMin((e=>{var t=R(`buffer`),n=sr(),r=fr();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e{var t=B(),n=vr(),r=sr(),i=Sr();function resolvePairs(e,i){if(t.isSeq(e))for(let a=0;a1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function createPairs(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e)){if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let a={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:resolvePairs,createNode:createPairs};e.createPairs=createPairs,e.pairs=a,e.resolvePairs=resolvePairs})),Pr=__commonJSMin((e=>{var t=B(),n=ir(),r=br(),i=Sr(),a=Nr(),o=class YAMLOMap extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=YAMLOMap.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),Fr=__commonJSMin((e=>{var t=sr();function boolStringify({value:e,source:t},i){return t&&(e?n:r).test.test(t)?t:e?i.options.trueStr:i.options.falseStr}let n={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:boolStringify},r={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:boolStringify};e.falseTag=r,e.trueTag=n})),Ir=__commonJSMin((e=>{var t=sr(),n=Dr();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Lr=__commonJSMin((e=>{var t=Dr();let intIdentify=e=>typeof e==`bigint`||Number.isInteger(e);function intResolve(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function intStringify(e,n,r){let{value:i}=e;if(intIdentify(i)){let e=i.toString(n);return i<0?`-`+r+e.substr(1):r+e}return t.stringifyNumber(e)}let n={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>intResolve(e,2,2,n),stringify:e=>intStringify(e,2,`0b`)},r={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>intResolve(e,1,8,n),stringify:e=>intStringify(e,8,`0`)},i={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>intResolve(e,0,10,n),stringify:t.stringifyNumber},a={identify:intIdentify,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>intResolve(e,2,16,n),stringify:e=>intStringify(e,16,`0x`)};e.int=i,e.intBin=n,e.intHex=a,e.intOct=r})),Rr=__commonJSMin((e=>{var t=B(),n=vr(),r=br(),i=class YAMLSet extends r.YAMLMap{constructor(e){super(e),this.tag=YAMLSet.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),zr=__commonJSMin((e=>{var t=Dr();function parseSexagesimal(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,num=e=>t?BigInt(e):Number(e),i=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*num(60)+num(t),num(0));return n===`-`?num(-1)*i:i}function stringifySexagesimal(e){let{value:n}=e,num=e=>e;if(typeof n==`bigint`)num=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let r=``;n<0&&(r=`-`,n*=num(-1));let i=num(60),a=[n%i];return n<60?a.unshift(0):(n=(n-a[0])/i,a.unshift(n%i),n>=60&&(n=(n-a[0])/i,a.unshift(n))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let n={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>parseSexagesimal(e,n),stringify:stringifySexagesimal},r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>parseSexagesimal(e,!1),stringify:stringifySexagesimal},i={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(i.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,a,o,s,c]=t.map(Number),l=t[7]?Number((t[7]+`00`).substr(1,3)):0,u=Date.UTC(n,r-1,a,o||0,s||0,c||0,l),d=t[8];if(d&&d!==`Z`){let e=parseSexagesimal(d,!1);Math.abs(e)<30&&(e*=60),u-=6e4*e}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=r,e.intTime=n,e.timestamp=i})),Br=__commonJSMin((e=>{var t=xr(),n=Tr(),r=Cr(),i=wr(),a=Mr(),o=Fr(),s=Ir(),c=Lr(),l=gr(),u=Pr(),d=Nr(),f=Rr(),p=zr();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),Vr=__commonJSMin((e=>{var t=xr(),n=Tr(),r=Cr(),i=wr(),a=Er(),o=Or(),s=kr(),c=Ar(),l=jr(),u=Mr(),d=gr(),f=Pr(),p=Nr(),h=Br(),g=Rr(),v=zr();let y=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,h.schema],[`yaml-1.1`,h.schema]]),b={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:v.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:v.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:g.set,timestamp:v.timestamp},x={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":g.set,"tag:yaml.org,2002:timestamp":v.timestamp};function getTags(e,t,n){let r=y.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(y.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?b[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(b).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=x,e.getTags=getTags})),Hr=__commonJSMin((e=>{var t=B(),n=xr(),r=Cr(),i=wr(),a=Vr();let sortMapEntriesByKey=(e,t)=>e.keyt.key);e.Schema=class Schema{constructor({compat:e,customTags:o,merge:s,resolveKnownTags:c,schema:l,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof l==`string`&&l||`core`,this.knownTags=c?a.coreKnownTags:{},this.tags=a.getTags(o,this.name,s),this.toStringOptions=d??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof u==`function`?u:u===!0?sortMapEntriesByKey:null}clone(){let e=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}})),Ur=__commonJSMin((e=>{var t=B(),n=pr(),r=ur();function stringifyDocument(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd){if(e.comment){let t=c(e.comment);t.includes(` `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`)}else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(` `)+` -`}e.stringifyDocument=stringifyDocument})),Ur=__commonJSMin((e=>{var t=ar(),n=cr(),r=B(),i=_r(),a=rr(),o=Vr(),s=Hr(),c=tr(),l=nr(),u=sr(),d=er(),f=class Document{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){assertCollection(this.contents)&&this.contents.add(e)}addIn(e,t){assertCollection(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:h,sourceObjects:g}=c.createNodeAnchors(this,o||`a`),v={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:g},y=u.createNode(e,f,v);return s&&r.isCollection(y)&&(y.flow=!0),h(),y}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents!=null&&(this.contents=null,!0):assertCollection(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):assertCollection(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):assertCollection(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function assertCollection(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Wr=__commonJSMin((e=>{var YAMLError=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},YAMLParseError=class extends YAMLError{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},YAMLWarning=class extends YAMLError{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=YAMLError,e.YAMLParseError=YAMLParseError,e.YAMLWarning=YAMLWarning,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… -`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),Gr=__commonJSMin((e=>{function resolveProps(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,h=!1,g=null,v=null,y=null,b=null,x=null,S=null,C=null;for(let i of e)switch(h&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),g&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(g,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(g=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!S||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(v||y)&&(b=i),u=!0;break;case`anchor`:v&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),v=i,C??=i.offset,l=!1,u=!1,h=!0;break;case`tag`:y&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),y=i,C??=i.offset,l=!1,u=!1,h=!0;break;case n:(v||y)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),S&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),S=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){x&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),x=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let w=e[e.length-1],T=w?w.offset+w.source.length:i;return h&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),g&&(l&&g.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(g,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:x,found:S,spaceBefore:c,comment:d,hasNewline:p,anchor:v,tag:y,newlineAfterProp:b,end:T,start:C??T}}e.resolveProps=resolveProps})),Kr=__commonJSMin((e=>{function containsNewline(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` -`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(containsNewline(t.key)||containsNewline(t.value))return!0}return!1;default:return!0}}e.containsNewline=containsNewline})),qr=__commonJSMin((e=>{var t=Kr();function flowIndentCheck(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=flowIndentCheck})),Jr=__commonJSMin((e=>{var t=B();function mapIncludes(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=mapIncludes})),Yr=__commonJSMin((e=>{var t=_r(),n=yr(),r=Gr(),i=Kr(),a=qr(),o=Jr();let s=`All mapping items must start at the same column`;function resolveBlockMap({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new((f?.nodeClass)??n.YAMLMap)(l.schema);l.atRoot&&=!1;let h=u.offset,g=null;for(let n of u.items){let{start:f,key:v,sep:y,value:b}=n,x=r.resolveProps(f,{indicator:`explicit-key-ind`,next:v??y?.[0],offset:h,onError:d,parentIndent:u.indent,startOnNewline:!0}),S=!x.found;if(S){if(v&&(v.type===`block-seq`?d(h,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in v&&v.indent!==u.indent&&d(h,`BAD_INDENT`,s)),!x.anchor&&!x.tag&&!y){g=x.end,x.comment&&(p.comment?p.comment+=` +`}e.stringifyDocument=stringifyDocument})),Wr=__commonJSMin((e=>{var t=or(),n=lr(),r=B(),i=vr(),a=ir(),o=Hr(),s=Ur(),c=nr(),l=rr(),u=cr(),d=tr(),f=class Document{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(Document.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){assertCollection(this.contents)&&this.contents.add(e)}addIn(e,t){assertCollection(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:h,sourceObjects:g}=c.createNodeAnchors(this,o||`a`),v={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:g},y=u.createNode(e,f,v);return s&&r.isCollection(y)&&(y.flow=!0),h(),y}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents!=null&&(this.contents=null,!0):assertCollection(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):assertCollection(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):assertCollection(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function assertCollection(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Gr=__commonJSMin((e=>{var YAMLError=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},YAMLParseError=class extends YAMLError{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},YAMLWarning=class extends YAMLError{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=YAMLError,e.YAMLParseError=YAMLParseError,e.YAMLWarning=YAMLWarning,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… +`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),Kr=__commonJSMin((e=>{function resolveProps(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,h=!1,g=null,v=null,y=null,b=null,x=null,S=null,C=null;for(let i of e)switch(h&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),g&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(g,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(g=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!S||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(v||y)&&(b=i),u=!0;break;case`anchor`:v&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),v=i,C??=i.offset,l=!1,u=!1,h=!0;break;case`tag`:y&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),y=i,C??=i.offset,l=!1,u=!1,h=!0;break;case n:(v||y)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),S&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),S=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){x&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),x=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let w=e[e.length-1],T=w?w.offset+w.source.length:i;return h&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),g&&(l&&g.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(g,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:x,found:S,spaceBefore:c,comment:d,hasNewline:p,anchor:v,tag:y,newlineAfterProp:b,end:T,start:C??T}}e.resolveProps=resolveProps})),qr=__commonJSMin((e=>{function containsNewline(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` +`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(containsNewline(t.key)||containsNewline(t.value))return!0}return!1;default:return!0}}e.containsNewline=containsNewline})),Jr=__commonJSMin((e=>{var t=qr();function flowIndentCheck(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=flowIndentCheck})),Yr=__commonJSMin((e=>{var t=B();function mapIncludes(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=mapIncludes})),Xr=__commonJSMin((e=>{var t=vr(),n=br(),r=Kr(),i=qr(),a=Jr(),o=Yr();let s=`All mapping items must start at the same column`;function resolveBlockMap({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new((f?.nodeClass)??n.YAMLMap)(l.schema);l.atRoot&&=!1;let h=u.offset,g=null;for(let n of u.items){let{start:f,key:v,sep:y,value:b}=n,x=r.resolveProps(f,{indicator:`explicit-key-ind`,next:v??y?.[0],offset:h,onError:d,parentIndent:u.indent,startOnNewline:!0}),S=!x.found;if(S){if(v&&(v.type===`block-seq`?d(h,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in v&&v.indent!==u.indent&&d(h,`BAD_INDENT`,s)),!x.anchor&&!x.tag&&!y){g=x.end,x.comment&&(p.comment?p.comment+=` `+x.comment:p.comment=x.comment);continue}(x.newlineAfterProp||i.containsNewline(v))&&d(v??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else x.found?.indent!==u.indent&&d(h,`BAD_INDENT`,s);l.atKey=!0;let C=x.end,w=v?e(l,v,x,d):c(l,C,f,null,x,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),l.atKey=!1,o.mapIncludes(l,p.items,w)&&d(C,`DUPLICATE_KEY`,`Map keys must be unique`);let T=r.resolveProps(y??[],{indicator:`map-value-ind`,next:b,offset:w.range[2],onError:d,parentIndent:u.indent,startOnNewline:!v||v.type===`block-scalar`});if(h=T.end,T.found){S&&(b?.type===`block-map`&&!T.hasNewline&&d(h,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&x.start{var t=xr(),n=Gr(),r=qr();function resolveBlockSeq({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new((c?.nodeClass)??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found){if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=resolveBlockSeq})),Zr=__commonJSMin((e=>{function resolveEnd(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}e.resolveEnd=resolveEnd})),Qr=__commonJSMin((e=>{var t=B(),n=_r(),r=yr(),i=xr(),a=Zr(),o=Gr(),s=Kr(),c=Jr();let l=`Block collections are not allowed within flow collections`,isBlock=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function resolveFlowCollection({composeNode:e,composeEmptyNode:u},d,f,p,h){let g=f.start.source===`{`,v=g?`flow map`:`flow sequence`,y=new((h?.nodeClass)??(g?r.YAMLMap:i.YAMLSeq))(d.schema);y.flow=!0;let b=d.atRoot;b&&(d.atRoot=!1),d.atKey&&=!1;let x=f.offset+f.start.source.length;for(let i=0;i{var t=Sr(),n=Kr(),r=Jr();function resolveBlockSeq({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new((c?.nodeClass)??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found){if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=resolveBlockSeq})),Qr=__commonJSMin((e=>{function resolveEnd(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}e.resolveEnd=resolveEnd})),$r=__commonJSMin((e=>{var t=B(),n=vr(),r=br(),i=Sr(),a=Qr(),o=Kr(),s=qr(),c=Yr();let l=`Block collections are not allowed within flow collections`,isBlock=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function resolveFlowCollection({composeNode:e,composeEmptyNode:u},d,f,p,h){let g=f.start.source===`{`,v=g?`flow map`:`flow sequence`,y=new((h?.nodeClass)??(g?r.YAMLMap:i.YAMLSeq))(d.schema);y.flow=!0;let b=d.atRoot;b&&(d.atRoot=!1),d.atKey&&=!1;let x=f.offset+f.start.source.length;for(let i=0;i0){let e=a.resolveEnd(w,T,d.options.strict,p);e.comment&&(y.comment?y.comment+=` -`+e.comment:y.comment=e.comment),y.range=[f.offset,T,e.offset]}else y.range=[f.offset,T,T];return y}e.resolveFlowCollection=resolveFlowCollection})),$r=__commonJSMin((e=>{var t=B(),n=or(),r=yr(),i=xr(),a=Yr(),o=Xr(),s=Qr();function resolveCollection(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function composeCollection(e,a,o,s,c){let l=s.tag,u=l?a.directives.tagName(l.source,e=>c(l,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&l?e.offset>l.offset?e:l:e??l;n&&(!t||t.offsete.tag===u&&e.collection===d);if(!f){let t=a.schema.knownTags[u];if(t?.collection===d)a.schema.tags.push(Object.assign({},t,{default:!1})),f=t;else return t?c(l,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${d} collection, but expects ${t.collection??`scalar`}`,!0):c(l,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${u}`,!0),resolveCollection(e,a,o,c,u)}let p=resolveCollection(e,a,o,c,u,f),h=f.resolve?.(p,e=>c(l,`TAG_RESOLVE_FAILED`,e),a.options)??p,g=t.isNode(h)?h:new n.Scalar(h);return g.range=p.range,g.tag=u,f?.format&&(g.format=f.format),g}e.composeCollection=composeCollection})),ei=__commonJSMin((e=>{var t=or();function resolveBlockScalar(e,n,r){let i=n.offset,a=parseBlockScalarHeader(n,e.options.strict,r);if(!a)return{value:``,type:null,comment:``,range:[i,i,i]};let o=a.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,s=n.source?splitLines(n.source):[],c=s.length;for(let e=s.length-1;e>=0;--e){let t=s[e][1];if(t===``||t===`\r`)c=e;else break}if(c===0){let e=a.chomp===`+`&&s.length>0?` +`+e.comment:y.comment=e.comment),y.range=[f.offset,T,e.offset]}else y.range=[f.offset,T,T];return y}e.resolveFlowCollection=resolveFlowCollection})),ei=__commonJSMin((e=>{var t=B(),n=sr(),r=br(),i=Sr(),a=Xr(),o=Zr(),s=$r();function resolveCollection(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function composeCollection(e,a,o,s,c){let l=s.tag,u=l?a.directives.tagName(l.source,e=>c(l,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&l?e.offset>l.offset?e:l:e??l;n&&(!t||t.offsete.tag===u&&e.collection===d);if(!f){let t=a.schema.knownTags[u];if(t?.collection===d)a.schema.tags.push(Object.assign({},t,{default:!1})),f=t;else return t?c(l,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${d} collection, but expects ${t.collection??`scalar`}`,!0):c(l,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${u}`,!0),resolveCollection(e,a,o,c,u)}let p=resolveCollection(e,a,o,c,u,f),h=f.resolve?.(p,e=>c(l,`TAG_RESOLVE_FAILED`,e),a.options)??p,g=t.isNode(h)?h:new n.Scalar(h);return g.range=p.range,g.tag=u,f?.format&&(g.format=f.format),g}e.composeCollection=composeCollection})),ti=__commonJSMin((e=>{var t=sr();function resolveBlockScalar(e,n,r){let i=n.offset,a=parseBlockScalarHeader(n,e.options.strict,r);if(!a)return{value:``,type:null,comment:``,range:[i,i,i]};let o=a.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,s=n.source?splitLines(n.source):[],c=s.length;for(let e=s.length-1;e>=0;--e){let t=s[e][1];if(t===``||t===`\r`)c=e;else break}if(c===0){let e=a.chomp===`+`&&s.length>0?` `.repeat(Math.max(1,s.length-1)):``,t=i+a.length;return n.source&&(t+=n.source.length),{value:e,type:o,comment:a.comment,range:[i,t,t]}}let l=n.indent+a.indent,u=n.offset+a.length,d=0;for(let t=0;tl&&(l=n.length);else{n.length=c;--e)s[e][0].length>l&&(c=e+1);let f=``,p=``,h=!1;for(let e=0;el||i[0]===` `?(p===` `?p=` @@ -80,7 +80,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `+s[e][0].slice(l);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}let g=i+a.length+n.source.length;return{value:f,type:o,comment:a.comment,range:[i,g,g]}}function parseBlockScalarHeader({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t{var t=or(),n=Zr();function resolveFlowScalar(e,r,i){let{offset:a,type:o,source:s,end:c}=e,l,u,_onError=(e,t,n)=>i(a+e,t,n);switch(o){case`scalar`:l=t.Scalar.PLAIN,u=plainValue(s,_onError);break;case`single-quoted-scalar`:l=t.Scalar.QUOTE_SINGLE,u=singleQuotedValue(s,_onError);break;case`double-quoted-scalar`:l=t.Scalar.QUOTE_DOUBLE,u=doubleQuotedValue(s,_onError);break;default:return i(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${o}`),{value:``,type:null,comment:``,range:[a,a+s.length,a+s.length]}}let d=a+s.length,f=n.resolveEnd(c,d,r,i);return{value:u,type:l,comment:f.comment,range:[a,d,f.offset]}}function plainValue(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),foldLines(e)}function singleQuotedValue(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),foldLines(e.slice(1,-1)).replace(/''/g,`'`)}function foldLines(e){let t,n;try{t=RegExp(`(.*?)(?{var t=sr(),n=Qr();function resolveFlowScalar(e,r,i){let{offset:a,type:o,source:s,end:c}=e,l,u,_onError=(e,t,n)=>i(a+e,t,n);switch(o){case`scalar`:l=t.Scalar.PLAIN,u=plainValue(s,_onError);break;case`single-quoted-scalar`:l=t.Scalar.QUOTE_SINGLE,u=singleQuotedValue(s,_onError);break;case`double-quoted-scalar`:l=t.Scalar.QUOTE_DOUBLE,u=doubleQuotedValue(s,_onError);break;default:return i(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${o}`),{value:``,type:null,comment:``,range:[a,a+s.length,a+s.length]}}let d=a+s.length,f=n.resolveEnd(c,d,r,i);return{value:u,type:l,comment:f.comment,range:[a,d,f.offset]}}function plainValue(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),foldLines(e)}function singleQuotedValue(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),foldLines(e.slice(1,-1)).replace(/''/g,`'`)}function foldLines(e){let t,n;try{t=RegExp(`(.*?)(?{var t=B(),n=or(),r=ei(),i=ti();function composeScalar(e,a,o,s){let{value:c,type:l,comment:u,range:d}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,s):i.resolveFlowScalar(a,e.options.strict,s),f=o?e.directives.tagName(o.source,e=>s(o,`TAG_RESOLVE_FAILED`,e)):null,p;p=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:f?findScalarTagByName(e.schema,c,f,o,s):a.type===`scalar`?findScalarTagByTest(e,c,a,s):e.schema[t.SCALAR];let h;try{let r=p.resolve(c,e=>s(o??a,`TAG_RESOLVE_FAILED`,e),e.options);h=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);s(o??a,`TAG_RESOLVE_FAILED`,t),h=new n.Scalar(c)}return h.range=d,h.source=c,l&&(h.type=l),f&&(h.tag=f),p.format&&(h.format=p.format),u&&(h.comment=u),h}function findScalarTagByName(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function findScalarTagByTest({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=composeScalar})),ri=__commonJSMin((e=>{function emptyScalarPosition(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=emptyScalarPosition})),ii=__commonJSMin((e=>{var t=ar(),n=B(),r=$r(),i=ni(),a=Zr(),o=ri();let s={composeNode,composeEmptyNode};function composeNode(e,t,a,o){let c=e.atKey,{spaceBefore:l,comment:u,anchor:d,tag:f}=a,p,h=!0;switch(t.type){case`alias`:p=composeAlias(e,t,o),(d||f)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:p=i.composeScalar(e,t,f,o),d&&(p.anchor=d.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{p=r.composeCollection(s,e,t,a,o),d&&(p.anchor=d.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=!1}return p??=composeEmptyNode(e,t.offset,void 0,null,a,o),d&&p.anchor===``&&o(d,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(p)||typeof p.value!=`string`||p.tag&&p.tag!==`tag:yaml.org,2002:str`)&&o(f??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),l&&(p.spaceBefore=!0),u&&(t.type===`scalar`&&t.source===``?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&h&&(p.srcToken=t),p}function composeEmptyNode(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function composeAlias({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=composeEmptyNode,e.composeNode=composeNode})),ai=__commonJSMin((e=>{var t=Ur(),n=ii(),r=Zr(),i=Gr();function composeDoc(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},h=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});h.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!h.hasNewline&&u(h.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,h,u):n.composeEmptyNode(p,h.end,s,null,h,u);let g=f.contents.range[2],v=r.resolveEnd(l,g,!1,u);return v.comment&&(f.comment=v.comment),f.range=[o,g,v.offset],f}e.composeDoc=composeDoc})),oi=__commonJSMin((e=>{var t=R(`process`),n=er(),r=Ur(),i=Wr(),a=B(),o=ai(),s=Zr();function getErrorPos(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function parsePrelude(e){let t=``,n=!1,r=!1;for(let i=0;i{var t=B(),n=sr(),r=ti(),i=ni();function composeScalar(e,a,o,s){let{value:c,type:l,comment:u,range:d}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,s):i.resolveFlowScalar(a,e.options.strict,s),f=o?e.directives.tagName(o.source,e=>s(o,`TAG_RESOLVE_FAILED`,e)):null,p;p=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:f?findScalarTagByName(e.schema,c,f,o,s):a.type===`scalar`?findScalarTagByTest(e,c,a,s):e.schema[t.SCALAR];let h;try{let r=p.resolve(c,e=>s(o??a,`TAG_RESOLVE_FAILED`,e),e.options);h=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);s(o??a,`TAG_RESOLVE_FAILED`,t),h=new n.Scalar(c)}return h.range=d,h.source=c,l&&(h.type=l),f&&(h.tag=f),p.format&&(h.format=p.format),u&&(h.comment=u),h}function findScalarTagByName(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function findScalarTagByTest({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=composeScalar})),ii=__commonJSMin((e=>{function emptyScalarPosition(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=emptyScalarPosition})),ai=__commonJSMin((e=>{var t=or(),n=B(),r=ei(),i=ri(),a=Qr(),o=ii();let s={composeNode,composeEmptyNode};function composeNode(e,t,a,o){let c=e.atKey,{spaceBefore:l,comment:u,anchor:d,tag:f}=a,p,h=!0;switch(t.type){case`alias`:p=composeAlias(e,t,o),(d||f)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:p=i.composeScalar(e,t,f,o),d&&(p.anchor=d.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{p=r.composeCollection(s,e,t,a,o),d&&(p.anchor=d.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=!1}return p??=composeEmptyNode(e,t.offset,void 0,null,a,o),d&&p.anchor===``&&o(d,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(p)||typeof p.value!=`string`||p.tag&&p.tag!==`tag:yaml.org,2002:str`)&&o(f??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),l&&(p.spaceBefore=!0),u&&(t.type===`scalar`&&t.source===``?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&h&&(p.srcToken=t),p}function composeEmptyNode(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function composeAlias({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=composeEmptyNode,e.composeNode=composeNode})),oi=__commonJSMin((e=>{var t=Wr(),n=ai(),r=Qr(),i=Kr();function composeDoc(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},h=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});h.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!h.hasNewline&&u(h.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,h,u):n.composeEmptyNode(p,h.end,s,null,h,u);let g=f.contents.range[2],v=r.resolveEnd(l,g,!1,u);return v.comment&&(f.comment=v.comment),f.range=[o,g,v.offset],f}e.composeDoc=composeDoc})),si=__commonJSMin((e=>{var t=R(`process`),n=tr(),r=Wr(),i=Gr(),a=B(),o=oi(),s=Qr();function getErrorPos(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function parsePrelude(e){let t=``,n=!1,r=!1;for(let i=0;i{let a=getErrorPos(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=parsePrelude(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t{let i=getErrorPos(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),si=__commonJSMin((e=>{var t=ei(),n=ti(),r=Wr(),i=dr();function resolveAsScalar(e,i=!0,a){if(e){let _onError=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,_onError);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,_onError)}}return null}function createScalarToken(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:`newline`,offset:-1,indent:r,source:` +`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let a=getErrorPos(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=parsePrelude(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t{let i=getErrorPos(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(getErrorPos(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),ci=__commonJSMin((e=>{var t=ti(),n=ni(),r=Gr(),i=fr();function resolveAsScalar(e,i=!0,a){if(e){let _onError=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,_onError);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,_onError)}}return null}function createScalarToken(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:`newline`,offset:-1,indent:r,source:` `}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(` `),t=c.substring(0,e),n=c.substring(e+1)+` `,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return addEndtoBlockProps(i,l)||i.push({type:`newline`,offset:-1,indent:r,source:` @@ -106,9 +106,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `),r=t.substring(0,n),i=t.substring(n+1)+` `;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];addEndtoBlockProps(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:` `});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function addEndtoBlockProps(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function setFlowScalarValue(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:` -`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=createScalarToken,e.resolveAsScalar=resolveAsScalar,e.setScalarValue=setScalarValue})),ci=__commonJSMin((e=>{let stringify=e=>`type`in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case`block-scalar`:{let t=``;for(let n of e.props)t+=stringifyToken(n);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=stringifyItem(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=stringifyItem(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=stringifyItem(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function stringifyItem({start:e,key:t,sep:n,value:r}){let i=``;for(let t of e)i+=t.source;if(t&&(i+=stringifyToken(t)),n)for(let e of n)i+=e.source;return r&&(i+=stringifyToken(r)),i}e.stringify=stringify})),li=__commonJSMin((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function visit(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),_visit(Object.freeze([]),e,t)}visit.BREAK=t,visit.SKIP=n,visit.REMOVE=r,visit.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},visit.parentCollection=(e,t)=>{let n=visit.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function _visit(e,n,i){let a=i(n,e);if(typeof a==`symbol`)return a;for(let o of[`key`,`value`]){let s=n[o];if(s&&`items`in s){for(let n=0;n{var t=si(),n=ci(),r=li();let isCollection=e=>!!e&&`items`in e,isScalar=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function prettyToken(e){switch(e){case``:return``;case``:return``;case``:return``;case``:return``;default:return JSON.stringify(e)}}function tokenType(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=createScalarToken,e.resolveAsScalar=resolveAsScalar,e.setScalarValue=setScalarValue})),li=__commonJSMin((e=>{let stringify=e=>`type`in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case`block-scalar`:{let t=``;for(let n of e.props)t+=stringifyToken(n);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=stringifyItem(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=stringifyItem(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=stringifyItem(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function stringifyItem({start:e,key:t,sep:n,value:r}){let i=``;for(let t of e)i+=t.source;if(t&&(i+=stringifyToken(t)),n)for(let e of n)i+=e.source;return r&&(i+=stringifyToken(r)),i}e.stringify=stringify})),ui=__commonJSMin((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function visit(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),_visit(Object.freeze([]),e,t)}visit.BREAK=t,visit.SKIP=n,visit.REMOVE=r,visit.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},visit.parentCollection=(e,t)=>{let n=visit.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function _visit(e,n,i){let a=i(n,e);if(typeof a==`symbol`)return a;for(let o of[`key`,`value`]){let s=n[o];if(s&&`items`in s){for(let n=0;n{var t=ci(),n=li(),r=ui();let isCollection=e=>!!e&&`items`in e,isScalar=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function prettyToken(e){switch(e){case``:return``;case``:return``;case``:return``;case``:return``;default:return JSON.stringify(e)}}function tokenType(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case` `:case`\r -`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=isCollection,e.isScalar=isScalar,e.prettyToken=prettyToken,e.tokenType=tokenType})),di=__commonJSMin((e=>{var t=ui();function isEmpty(e){switch(e){case void 0:case` `:case` +`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=isCollection,e.isScalar=isScalar,e.prettyToken=prettyToken,e.tokenType=tokenType})),fi=__commonJSMin((e=>{var t=di();function isEmpty(e){switch(e){case void 0:case` `:case` `:case`\r`:case` `:return!0;default:return!1}}let n=new Set(`0123456789ABCDEFabcdef`),r=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),i=new Set(`,[]{}`),a=new Set(` ,[]{} \r `),isNotAnchorChar=e=>!e||a.has(e);e.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===` `||t===`\r`&&this.buffer[e+1]===` @@ -127,12 +127,12 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `,t=this.buffer[r+1]):n=r),t===`#`||e&&i.has(t))break;if(a===` `){let e=this.continueScalar(r+1);if(e===-1)break;r=Math.max(r,e-2)}}else{if(e&&i.has(a))break;n=r}return!a&&!this.atEnd?this.setNext(`plain-scalar`):(yield t.SCALAR,yield*this.pushToIndex(n+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(isNotAnchorChar),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(isEmpty(n)||t&&i.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!isEmpty(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else if(t===`%`&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),fi=__commonJSMin((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]{var t=R(`process`),n=ui(),r=di();function includesToken(e,t){for(let n=0;n=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&fixFlowSeqItems(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&findNonEmptyIndex(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),pi=__commonJSMin((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]{var t=R(`process`),n=di(),r=fi();function includesToken(e,t){for(let n=0;n=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function arrayPushArray(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&fixFlowSeqItems(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&findNonEmptyIndex(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(includesToken(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=getFirstKeyStartProps(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(includesToken(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(isFlowToken(t.key)&&!includesToken(t.sep,`newline`)){let e=getFirstKeyStartProps(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):includesToken(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!includesToken(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){arrayPushArray(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||includesToken(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=getFirstKeyStartProps(getPrevProps(t));fixFlowSeqItems(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` -`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=getFirstKeyStartProps(getPrevProps(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=getFirstKeyStartProps(getPrevProps(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),mi=__commonJSMin((e=>{var t=oi(),n=Ur(),r=Wr(),i=mr(),a=B(),o=fi(),s=pi();function parseOptions(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function parseAllDocuments(e,n={}){let{lineCounter:i,prettyErrors:a}=parseOptions(n),o=new s.Parser(i?.addNewLine),c=new t.Composer(n),l=Array.from(c.compose(o.parse(e)));if(a&&i)for(let t of l)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return l.length>0?l:Object.assign([],{empty:!0},c.streamInfo())}function parseDocument(e,n={}){let{lineCounter:i,prettyErrors:a}=parseOptions(n),o=new s.Parser(i?.addNewLine),c=new t.Composer(n),l=null;for(let t of c.compose(o.parse(e),!0,e.length))if(!l)l=t;else if(l.options.logLevel!==`silent`){l.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(l.errors.forEach(r.prettifyError(e,i)),l.warnings.forEach(r.prettifyError(e,i))),l}function parse(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=parseDocument(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function stringify(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=parse,e.parseAllDocuments=parseAllDocuments,e.parseDocument=parseDocument,e.stringify=stringify})),hi=__commonJSMin((e=>{var t=oi(),n=Ur(),r=Vr(),i=Wr(),a=ar(),o=B(),s=_r(),c=or(),l=yr(),u=xr();ui();var d=di(),f=fi(),p=pi(),h=mi(),g=$n();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=h.parse,e.parseAllDocuments=h.parseAllDocuments,e.parseDocument=h.parseDocument,e.stringify=h.stringify,e.visit=g.visit,e.visitAsync=g.visitAsync})),gi;function $constructor(e,t,n){function init(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:_,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=_.prototype,a=Object.keys(i);for(let e=0;en?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(_,"name",{value:e}),_}var $ZodAsyncError=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(gi=globalThis).__zod_globalConfig??(gi.__zod_globalConfig={});const _i=globalThis.__zod_globalConfig;function config(e){return e&&Object.assign(_i,e),_i}function jsonStringifyReplacer(e,t){return typeof t==`bigint`?t.toString():t}function cached(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cleanRegex(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}const vi=Symbol(`evaluating`);function defineLazy(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==vi)return r===void 0&&(r=vi,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}const yi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function isObject$1(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function clone(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function normalizeParams(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function optionalKeys(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function aborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function unwrapMessage(e){return typeof e==`string`?e:e?.message}function finalizeIssue(e,t,n){let r=e.message?e.message:unwrapMessage(e.inst?._zod.def?.error?.(e))??unwrapMessage(t?.error?.(e))??unwrapMessage(n.customError?.(e))??unwrapMessage(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}const initializer=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jsonStringifyReplacer,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bi=$constructor(`$ZodError`,initializer),xi=$constructor(`$ZodError`,initializer,{Parent:Error}),Si=(e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $ZodAsyncError;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>finalizeIssue(e,a,config())));throw yi(t,i?.callee),t}return o.value})(xi),Ci=(e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>finalizeIssue(e,a,config())));throw yi(t,i?.callee),t}return o.value})(xi),wi=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $ZodAsyncError;return a.issues.length?{success:!1,error:new(e??bi)(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}})(xi),Ti=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}})(xi),string$1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ei=/^(?:true|false)$/i,Di=/^null$/i,Oi={major:4,minor:4,patch:3},ki=$constructor(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Oi;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let runChecks=(e,t,n)=>{let r=aborted(e),i;for(let a of t){if(a._zod.def.when){if(explicitlyAborted(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new $ZodAsyncError;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=aborted(e,t))});else{if(e.issues.length===t)continue;r||=aborted(e,t)}}return i?i.then(()=>e):e},handleCanaryResult=(t,n,i)=>{if(aborted(t))return t.aborted=!0,t;let a=runChecks(n,r,i);if(a instanceof Promise){if(i.async===!1)throw new $ZodAsyncError;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(t,n)=>{if(n.skipChecks)return e._zod.parse(t,n);if(n.direction===`backward`){let r=e._zod.parse({value:t.value,issues:[]},{...n,skipChecks:!0});return r instanceof Promise?r.then(e=>handleCanaryResult(e,t,n)):handleCanaryResult(r,t,n)}let i=e._zod.parse(t,n);if(i instanceof Promise){if(n.async===!1)throw new $ZodAsyncError;return i.then(e=>runChecks(e,r,n))}return runChecks(i,r,n)}}defineLazy(e,`~standard`,()=>({validate:t=>{try{let n=wi(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ti(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ai=$constructor(`$ZodString`,(e,t)=>{ki.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??string$1(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),ji=$constructor(`$ZodBoolean`,(e,t)=>{ki.init(e,t),e._zod.pattern=Ei,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Mi=$constructor(`$ZodNull`,(e,t)=>{ki.init(e,t),e._zod.pattern=Di,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}});function handleArrayResult(e,t,n){e.issues.length&&t.issues.push(...prefixIssues(n,e.issues)),t.value[n]=e.value}const Ni=$constructor(`$ZodArray`,(e,t)=>{ki.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;ehandleArrayResult(t,n,e))):handleArrayResult(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function handlePropertyResult(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...prefixIssues(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function normalizeDef(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=optionalKeys(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function handleCatchall(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>handlePropertyResult(e,n,i,t,u,d))):handlePropertyResult(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Pi=$constructor(`$ZodObject`,(e,t)=>{if(ki.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=cached(()=>normalizeDef(t));defineLazy(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=isObject$1,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>handlePropertyResult(n,t,e,s,r,i))):handlePropertyResult(a,t,e,s,r,i)}return i?handleCatchall(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}});function handleUnionResults(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!aborted(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>finalizeIssue(e,r,config())))}),t)}const Fi=$constructor(`$ZodUnion`,(e,t)=>{ki.init(e,t),defineLazy(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),defineLazy(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),defineLazy(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),defineLazy(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>cleanRegex(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>handleUnionResults(t,r,e,i)):handleUnionResults(o,r,e,i)}});function handleOptionalResult(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ii=$constructor(`$ZodOptional`,(e,t)=>{ki.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,defineLazy(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),defineLazy(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cleanRegex(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>handleOptionalResult(e,r)):handleOptionalResult(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}});function _string(e,t){return new e({type:`string`,...normalizeParams(t)})}function _boolean(e,t){return new e({type:`boolean`,...normalizeParams(t)})}function _null$1(e,t){return new e({type:`null`,...normalizeParams(t)})}const Li=$constructor(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);ki.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>Si(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>wi(e,t,n),e.parseAsync=async(t,n)=>Ci(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ti(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>clone(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),Ri=$constructor(`ZodMiniString`,(e,t)=>{Ai.init(e,t),Li.init(e,t)});function string(e){return _string(Ri,e)}const zi=$constructor(`ZodMiniBoolean`,(e,t)=>{ji.init(e,t),Li.init(e,t)});function boolean(e){return _boolean(zi,e)}const Bi=$constructor(`ZodMiniNull`,(e,t)=>{Mi.init(e,t),Li.init(e,t)});function _null(e){return _null$1(Bi,e)}const Vi=$constructor(`ZodMiniArray`,(e,t)=>{Ni.init(e,t),Li.init(e,t)});function array(e,t){return new Vi({type:`array`,element:e,...normalizeParams(t)})}const Hi=$constructor(`ZodMiniObject`,(e,t)=>{Pi.init(e,t),Li.init(e,t),defineLazy(e,`shape`,()=>t.shape)});function object(e,t){let n={type:`object`,shape:e??{},...normalizeParams(t)};return new Hi(n)}const Ui=$constructor(`ZodMiniUnion`,(e,t)=>{Fi.init(e,t),Li.init(e,t)});function union(e,t){return new Ui({type:`union`,options:e,...normalizeParams(t)})}const Wi=$constructor(`ZodMiniOptional`,(e,t)=>{Ii.init(e,t),Li.init(e,t)});function optional(e){return new Wi({type:`optional`,innerType:e})}var Gi=hi();const Ki=new Set([`true`,`True`,`TRUE`]),qi=new Set([`false`,`False`,`FALSE`]);function parseNodeManager(e){if(e){if(Ki.has(e))return!0;if(qi.has(e))return!1;throw Error(`Invalid node-manager input: "${e}". Expected "true", "false", or unset.`)}}const Ji=object({cwd:optional(string()),args:optional(array(string()))}),Yi=union([_null(),boolean(),Ji,array(Ji)]),Xi=`Vite+`,Zi=`vite-plus`;function getInputs(){let e=getInput(`node-version`)||void 0,t=getInput(`node-version-file`)||void 0,n=parseNodeManager(getInput(`node-manager`));if(n===!1&&(e||t))throw Error(`node-manager: false cannot be combined with node-version or node-version-file: installing a Node.js version requires the Vite+ Node.js manager.`);return{version:getInput(`version`),versionFile:getInput(`version-file`)||void 0,nodeVersion:e,nodeVersionFile:t,nodeManager:n,workingDirectory:getInput(`working-directory`)||void 0,runInstall:parseRunInstall(getInput(`run-install`)),sfw:getBooleanInput(`sfw`),cache:getBooleanInput(`cache`),cacheSave:getBooleanInput(`cache-save`),cacheDependencyPath:getInput(`cache-dependency-path`)||void 0,registryUrl:getInput(`registry-url`)||void 0,scope:getInput(`scope`)||void 0}}function parseRunInstall(e){if(!e||e===`false`||e===`null`)return[];if(e===`true`)return[{}];let t=(0,Gi.parse)(e);try{let e=Yi.parse(t);return e?e===!0?[{}]:Array.isArray(e)?e:[e]:[]}catch(e){throw e instanceof bi?Error(`Invalid run-install input: ${e.issues.map(e=>e.message).join(`, `)}`):e}}const Qi=`https://raw.githubusercontent.com/voidzero-dev/vite-plus`,$i=`packages/cli`,ea=/^0\.0\.0-commit\.([0-9a-f]{40})$/i,ta=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;function pkgPrNewCommitSha(e){return e.match(ea)?.[1]}function getInstallScriptUrls(e,t=process.platform){let n=t===`win32`?`install.ps1`:`install.sh`,r=installScriptRef(e);return{pinned:r?[`${Qi}/${r}/${$i}/${n}`,`https://cdn.jsdelivr.net/gh/voidzero-dev/vite-plus@${r}/${$i}/${n}`]:[],latest:[`https://viteplus.dev/${n}`,`${Qi}/main/${$i}/${n}`]}}function installScriptRef(e){let t=pkgPrNewCommitSha(e);if(t)return t.toLowerCase();if(ta.test(e))return`v${e}`}function parseInstalledVpVersion$1(e){return(e.match(/^\s*vp\s+v?(\d[^\s]*)/im)??e.match(/Global:\s*v?(\d[^\s]*)/i))?.[1]??`unknown`}const na=`--connect-timeout 5 --max-time 15`,ra=`SETUP_VP_DIRS_FILE`,ia=/^v?(\d+)\.(\d+)\.\d+(?:-[0-9A-Za-z.-]+)?$/;function supportsVitePlusDirs(e){if(pkgPrNewCommitSha(e))return!0;let t=e.match(ia);if(!t)return!0;let n=Number(t[1]),r=Number(t[2]);return n>0||r>=3}function createVitePlusDirsFile(){return I(xe(),`setup-vp-dirs-${k()}.txt`)}function removeVitePlusDirsFile(e){me(e,{force:!0})}function readVitePlusProbe(e){try{return fe(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return;throw e}}function resolveVitePlusBinDir(e,t,n){if(!t){if(!supportsVitePlusDirs(e))return n;throw Error(`Vite+ was installed successfully, but setup-vp could not resolve its VpDirs.`)}let r=readVitePlusProbe(t),i=r===void 0?void 0:parseVitePlusDirs(r);if(i)return i.bin;if(!(pkgPrNewCommitSha(e)!==void 0||ia.test(e))&&r!==void 0){let e=parseInstalledVpVersion$1(r);if(e!==`unknown`&&!supportsVitePlusDirs(e))return n}throw Error(`Vite+ was installed successfully, but setup-vp could not resolve its VpDirs.`)}function parseVitePlusDirs(e){let t=new Map;for(let n of e.split(/\r?\n/)){let e=n.indexOf(` `);if(e<1)continue;let r=n.slice(0,e).replace(/^\uFEFF/,``),i=n.slice(e+1).trim();i&&t.set(r,i)}let n=t.get(`data`),r=t.get(`bin`),i=t.get(`cache`),a=t.get(`config`),o=t.get(`state`);if(!(!n||!r||!i||!a||!o))return{data:n,bin:r,cache:i,config:a,state:o}}function getInstallScriptCommand(e,t=process.platform,n=!0){return t===`win32`?n?{command:`pwsh`,args:[`-Command`,` -$dirsFile = $env:${ra} +`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=getFirstKeyStartProps(getPrevProps(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=getFirstKeyStartProps(getPrevProps(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),hi=__commonJSMin((e=>{var t=si(),n=Wr(),r=Gr(),i=hr(),a=B(),o=pi(),s=mi();function parseOptions(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function parseAllDocuments(e,n={}){let{lineCounter:i,prettyErrors:a}=parseOptions(n),o=new s.Parser(i?.addNewLine),c=new t.Composer(n),l=Array.from(c.compose(o.parse(e)));if(a&&i)for(let t of l)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return l.length>0?l:Object.assign([],{empty:!0},c.streamInfo())}function parseDocument(e,n={}){let{lineCounter:i,prettyErrors:a}=parseOptions(n),o=new s.Parser(i?.addNewLine),c=new t.Composer(n),l=null;for(let t of c.compose(o.parse(e),!0,e.length))if(!l)l=t;else if(l.options.logLevel!==`silent`){l.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(l.errors.forEach(r.prettifyError(e,i)),l.warnings.forEach(r.prettifyError(e,i))),l}function parse(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=parseDocument(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function stringify(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=parse,e.parseAllDocuments=parseAllDocuments,e.parseDocument=parseDocument,e.stringify=stringify})),gi=__commonJSMin((e=>{var t=si(),n=Wr(),r=Hr(),i=Gr(),a=or(),o=B(),s=vr(),c=sr(),l=br(),u=Sr();di();var d=fi(),f=pi(),p=mi(),h=hi(),g=er();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=h.parse,e.parseAllDocuments=h.parseAllDocuments,e.parseDocument=h.parseDocument,e.stringify=h.stringify,e.visit=g.visit,e.visitAsync=g.visitAsync}));function jsonStringifyReplacer(e,t){return typeof t==`bigint`?t.toString():t}function cached(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cleanRegex(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function assignProp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}const _i=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function isObject$1(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function clone(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function normalizeParams(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function optionalKeys(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function aborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function unwrapMessage(e){return typeof e==`string`?e:e?.message}function attachSchema(e,t,n){var r;for(let i=t;ir?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(_,"name",{value:e}),_}var $ZodAsyncError=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(xi=globalThis).__zod_globalConfig??(xi.__zod_globalConfig={});const wi=globalThis.__zod_globalConfig;function config(e){return e&&Object.assign(wi,e),wi}function _getMessage(){let e=this._zod;return e.message??=JSON.stringify(e.def,jsonStringifyReplacer,2),e.message}function _setMessage(e){this._zod.message=e}const Ti={get:_getMessage,set:_setMessage,enumerable:!0,configurable:!0},Ei={value:void 0,enumerable:!1},Di={value:void 0,enumerable:!1},Oi=new WeakSet([Object.prototype,Error.prototype]),initializer=(e,t)=>{e.name=`$ZodError`,Ei.value=e._zod,Object.defineProperty(e,"_zod",Ei),Di.value=t,Object.defineProperty(e,"issues",Di),Ei.value=void 0,Di.value=void 0,Object.defineProperty(e,"message",Ti);let n=Object.getPrototypeOf(e);Oi.has(n)||(Oi.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let value=()=>this.message;return Object.defineProperty(this,"toString",{value,configurable:!0,writable:!0}),value},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ki=$constructor(`$ZodError`,initializer),Ai=$constructor(`$ZodError`,initializer,void 0,{Parent:Error}),ji=(e=>{let fn=(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new $ZodAsyncError;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>finalizeIssue(e,a,config())));throw _i(t,i?.callee??fn),t}return o.value};return fn})(Ai),Mi=(e=>{let fn=async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>finalizeIssue(e,a,config())));throw _i(t,i?.callee??fn),t}return o.value};return fn})(Ai),Ni=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new $ZodAsyncError;return a.issues.length?{success:!1,error:new(e??ki)(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}})(Ai),Pi=(e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>finalizeIssue(e,i,config())))}:{success:!0,data:a.value}})(Ai),string$1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Fi=/^(?:true|false)$/i,Ii=/^null$/i,Li={major:4,minor:5,patch:4},Ri=$constructor(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Li;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let runChecks=(t,n,r)=>{if(t.memo)return t;let i=aborted(t),a;for(let o of n){if(o._zod.def.when){if(explicitlyAborted(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new $ZodAsyncError;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(attachSchema(t.issues,n,e),i||=aborted(t,n))});else{if(t.issues.length===n)continue;attachSchema(t.issues,n,e),i||=aborted(t,n)}}return a?a.then(()=>t):t},handleCanaryResult=(t,n,r)=>{if(aborted(t))return t.aborted=!0,t;let a=runChecks(n,i,r);if(a instanceof Promise){if(r.async===!1)throw new $ZodAsyncError;return a.then(t=>e._zod.parse(t,r))}return e._zod.parse(a,r)};e._zod.run=(t,n)=>{if(n.skipChecks)return e._zod.parse(t,n);if(n.direction===`backward`){let r=e._zod.parse({value:t.value,issues:[]},{...n,skipChecks:!0});return r instanceof Promise?r.then(e=>handleCanaryResult(e,t,n)):handleCanaryResult(r,t,n)}let r=e._zod.parse(t,n);if(r instanceof Promise){if(n.async===!1)throw new $ZodAsyncError;return r.then(e=>runChecks(e,i,n))}return runChecks(r,i,n)}}},{get"~standard"(){return hide(this,`~standard`,standardProps(this))},set"~standard"(e){own(this,`~standard`,e)}}),toStandardResult=e=>e.success?{value:e.data}:{issues:e.error?.issues};function standardProps(e){return{validate:t=>{try{return toStandardResult(Ni(e,t))}catch{return Pi(e,t).then(toStandardResult)}},vendor:`zod`,version:1}}const zi=$constructor(`$ZodString`,(e,t)=>{Ri.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??string$1(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Bi=$constructor(`$ZodBoolean`,(e,t)=>{Ri.init(e,t),e._zod.pattern=Fi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Vi=$constructor(`$ZodNull`,(e,t)=>{Ri.init(e,t),e._zod.pattern=Ii,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}});function handleArrayResult(e,t,n){e.issues.length&&t.issues.push(...prefixIssues(n,e.issues)),t.value[n]=e.value}const Hi=$constructor(`$ZodArray`,(e,t)=>{Ri.init(e,t);let n=wi.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;ehandleArrayResult(t,r,e))):handleArrayResult(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function handlePropertyResult(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...prefixIssues(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}const Ui=[];function normalizeDef(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Ui,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=optionalKeys(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function handleCatchall(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>handlePropertyResult(e,n,i,t,u,d))):handlePropertyResult(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Wi=new WeakMap,Gi=$constructor(`$ZodObject`,(e,t)=>{if(Ri.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Wi.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),Wi.set(t,n),n}})}let n=cached(()=>normalizeDef(t));defineLazyInternal(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||assignProp(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=isObject$1,i=t.catchall,a,o=wi.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>handlePropertyResult(n,t,e,c,r,i))):handlePropertyResult(a,t,e,c,r,i)}return i?handleCatchall(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}});function handleUnionResults(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!aborted(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>finalizeIssue(e,r,config())))}),t)}const Ki=$constructor(`$ZodUnion`,(e,t)=>{Ri.init(e,t),defineLazyInternal(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),defineLazyInternal(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),defineLazyInternal(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),defineLazyInternal(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>cleanRegex(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>handleUnionResults(t,r,e,i)):handleUnionResults(o,r,e,i)}});function handleOptionalResult(e,t){return e.value=t.issues.length?void 0:t.value,e}const qi=$constructor(`$ZodOptional`,(e,t)=>{Ri.init(e,t),defineLazyInternal(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,defineLazyInternal(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),defineLazyInternal(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${cleanRegex(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>handleOptionalResult(e,t)):handleOptionalResult(e,r)}return t.innerType._zod.run(e,n)}});function _string(e,t){return new e({type:`string`,...normalizeParams(t)})}function _boolean(e,t){return new e({type:`boolean`,...normalizeParams(t)})}function _null$1(e,t){return new e({type:`null`,...normalizeParams(t)})}const Ji=$constructor(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);Ri.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){own(this,`with`,e)},parse(e,t){return ji(this,e,t,{callee:this.parse})},parseAsync(e,t){return Mi(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Ni(this,e,t)},safeParseAsync(e,t){return Pi(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return clone(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Yi=$constructor(`ZodMiniString`,(e,t)=>{zi.init(e,t),Ji.init(e,t)});function string(e){return _string(Yi,e)}const Xi=$constructor(`ZodMiniBoolean`,(e,t)=>{Bi.init(e,t),Ji.init(e,t)});function boolean(e){return _boolean(Xi,e)}const Zi=$constructor(`ZodMiniNull`,(e,t)=>{Vi.init(e,t),Ji.init(e,t)});function _null(e){return _null$1(Zi,e)}const Qi=$constructor(`ZodMiniArray`,(e,t)=>{Hi.init(e,t),Ji.init(e,t)});function array(e,t){return new Qi({type:`array`,element:e,...normalizeParams(t)})}const $i=$constructor(`ZodMiniObject`,(e,t)=>{Gi.init(e,t),Ji.init(e,t),installLazyProp(e,`shape`,e=>e._zod.def.shape,!1)});function object(e,t){let n={type:`object`,shape:e??{},...normalizeParams(t)};return new $i(n)}const ea=$constructor(`ZodMiniUnion`,(e,t)=>{Ki.init(e,t),Ji.init(e,t)});function union(e,t){return new ea({type:`union`,options:e,...normalizeParams(t)})}const ta=$constructor(`ZodMiniOptional`,(e,t)=>{qi.init(e,t),Ji.init(e,t)});function optional(e){return new ta({type:`optional`,innerType:e})}var na=gi();const ra=new Set([`true`,`True`,`TRUE`]),ia=new Set([`false`,`False`,`FALSE`]);function parseNodeManager(e){if(e){if(ra.has(e))return!0;if(ia.has(e))return!1;throw Error(`Invalid node-manager input: "${e}". Expected "true", "false", or unset.`)}}const aa=object({cwd:optional(string()),args:optional(array(string()))}),oa=union([_null(),boolean(),aa,array(aa)]),sa=`Vite+`,ca=`vite-plus`;function getInputs(){let e=getInput(`node-version`)||void 0,t=getInput(`node-version-file`)||void 0,n=parseNodeManager(getInput(`node-manager`));if(n===!1&&(e||t))throw Error(`node-manager: false cannot be combined with node-version or node-version-file: installing a Node.js version requires the Vite+ Node.js manager.`);return{version:getInput(`version`),versionFile:getInput(`version-file`)||void 0,nodeVersion:e,nodeVersionFile:t,nodeManager:n,workingDirectory:getInput(`working-directory`)||void 0,runInstall:parseRunInstall(getInput(`run-install`)),sfw:getBooleanInput(`sfw`),cache:getBooleanInput(`cache`),cacheSave:getBooleanInput(`cache-save`),cacheDependencyPath:getInput(`cache-dependency-path`)||void 0,registryUrl:getInput(`registry-url`)||void 0,scope:getInput(`scope`)||void 0}}function parseRunInstall(e){if(!e||e===`false`||e===`null`)return[];if(e===`true`)return[{}];let t=(0,na.parse)(e);try{let e=oa.parse(t);return e?e===!0?[{}]:Array.isArray(e)?e:[e]:[]}catch(e){throw e instanceof ki?Error(`Invalid run-install input: ${e.issues.map(e=>e.message).join(`, `)}`):e}}const la=`https://raw.githubusercontent.com/voidzero-dev/vite-plus`,ua=`packages/cli`,da=/^0\.0\.0-commit\.([0-9a-f]{40})$/i,fa=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;function pkgPrNewCommitSha(e){return e.match(da)?.[1]}function getInstallScriptUrls(e,t=process.platform){let n=t===`win32`?`install.ps1`:`install.sh`,r=installScriptRef(e);return{pinned:r?[`${la}/${r}/${ua}/${n}`,`https://cdn.jsdelivr.net/gh/voidzero-dev/vite-plus@${r}/${ua}/${n}`]:[],latest:[`https://viteplus.dev/${n}`,`${la}/main/${ua}/${n}`]}}function installScriptRef(e){let t=pkgPrNewCommitSha(e);if(t)return t.toLowerCase();if(fa.test(e))return`v${e}`}function parseInstalledVpVersion$1(e){return(e.match(/^\s*vp\s+v?(\d[^\s]*)/im)??e.match(/Global:\s*v?(\d[^\s]*)/i))?.[1]??`unknown`}const pa=`--connect-timeout 5 --max-time 15`,ma=`SETUP_VP_DIRS_FILE`,ha=/^v?(\d+)\.(\d+)\.\d+(?:-[0-9A-Za-z.-]+)?$/;function supportsVitePlusDirs(e){if(pkgPrNewCommitSha(e))return!0;let t=e.match(ha);if(!t)return!0;let n=Number(t[1]),r=Number(t[2]);return n>0||r>=3}function createVitePlusDirsFile(){return I(xe(),`setup-vp-dirs-${k()}.txt`)}function removeVitePlusDirsFile(e){me(e,{force:!0})}function readVitePlusProbe(e){try{return fe(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return;throw e}}function resolveVitePlusBinDir(e,t,n){if(!t){if(!supportsVitePlusDirs(e))return n;throw Error(`Vite+ was installed successfully, but setup-vp could not resolve its VpDirs.`)}let r=readVitePlusProbe(t),i=r===void 0?void 0:parseVitePlusDirs(r);if(i)return i.bin;if(!(pkgPrNewCommitSha(e)!==void 0||ha.test(e))&&r!==void 0){let e=parseInstalledVpVersion$1(r);if(e!==`unknown`&&!supportsVitePlusDirs(e))return n}throw Error(`Vite+ was installed successfully, but setup-vp could not resolve its VpDirs.`)}function parseVitePlusDirs(e){let t=new Map;for(let n of e.split(/\r?\n/)){let e=n.indexOf(` `);if(e<1)continue;let r=n.slice(0,e).replace(/^\uFEFF/,``),i=n.slice(e+1).trim();i&&t.set(r,i)}let n=t.get(`data`),r=t.get(`bin`),i=t.get(`cache`),a=t.get(`config`),o=t.get(`state`);if(!(!n||!r||!i||!a||!o))return{data:n,bin:r,cache:i,config:a,state:o}}function getInstallScriptCommand(e,t=process.platform,n=!0){return t===`win32`?n?{command:`pwsh`,args:[`-Command`,` +$dirsFile = $env:${ma} Set-Content -LiteralPath $dirsFile -Value '' -NoNewline . ([scriptblock]::Create((irm -TimeoutSec 15 ${e}))) $vpDir = if ($script:ShimDir) { @@ -157,65 +157,65 @@ if (Test-Path -LiteralPath $vpPath) { set -eo pipefail installer_file="$(mktemp "\${TMPDIR:-/tmp}/setup-vp-install.XXXXXX")" trap 'rm -f "$installer_file"' EXIT -: > "$${ra}" -curl -fsSL ${na} ${e} -o "$installer_file" +: > "$${ma}" +curl -fsSL ${pa} ${e} -o "$installer_file" source "$installer_file" vp_dir="\${SHIM_DIR:-\${INSTALL_DIR:-\${VP_HOME:-$HOME/.vite-plus}}/bin}" if [ -x "$vp_dir/vp" ]; then - "$vp_dir/vp" --version > "$${ra}" - VP_DUMP_DIRS=1 "$vp_dir/vp" >> "$${ra}" + "$vp_dir/vp" --version > "$${ma}" + VP_DUMP_DIRS=1 "$vp_dir/vp" >> "$${ma}" fi `.trim()]}:{command:`bash`,args:[`-c`,` set -o pipefail -curl -fsSL ${na} ${e} | bash -`.trim()]}}function getVitePlusHome(){let e=process.platform===`win32`?process.env.USERPROFILE:process.env.HOME;return I(e||ye(),`.vite-plus`)}function isWithin(e,t){let n=ie(t,e);return!re(n)&&n!==`..`&&!n.startsWith(`..${oe}`)}function parseInstalledVpVersion(e){return(e.match(/^\s*vp\s+v?(\d[^\s]*)/im)??e.match(/Global:\s*v?(\d[^\s]*)/i))?.[1]??`unknown`}function getWorkspaceDir(){return process.env.GITHUB_WORKSPACE||process.cwd()}function resolvePath(e,t){return re(e)?e:I(t,e)}function getConfiguredProjectDir(e){if(!e.workingDirectory)return getWorkspaceDir();let t=resolvePath(e.workingDirectory,getWorkspaceDir());if(!ue(t))throw Error(`working-directory not found: ${e.workingDirectory} (resolved to ${t})`);if(!L(t).isDirectory())throw Error(`working-directory is not a directory: ${e.workingDirectory} (resolved to ${t})`);return t}function getInstallCwd(e,t){return t?resolvePath(t,e):e}const aa=[{filename:`pnpm-lock.yaml`,type:`pnpm`},{filename:`bun.lockb`,type:`bun`},{filename:`bun.lock`,type:`bun`},{filename:`package-lock.json`,type:`npm`},{filename:`npm-shrinkwrap.json`,type:`npm`},{filename:`yarn.lock`,type:`yarn`}];function detectLockFile(e,t=getWorkspaceDir(),n=!1){if(e){let n=resolvePath(e,t);if(ue(n)){let e=F(n),t=aa.find(t=>t.filename===e);return t?{type:t.type,path:n,filename:e}:inferLockFileType(n,e)}return}let r=pe(t);for(let e of aa)if(r.includes(e.filename)){let r=I(t,e.filename);return n||info(`Auto-detected lock file: ${e.filename}`),{type:e.type,path:r,filename:e.filename}}}function inferLockFileType(e,t){return t.includes(`pnpm`)?{type:`pnpm`,path:e,filename:t}:t.includes(`yarn`)?{type:`yarn`,path:e,filename:t}:t.startsWith(`bun.`)?{type:`bun`,path:e,filename:t}:{type:`npm`,path:e,filename:t}}async function getCacheDirectories(e,t){switch(e){case`npm`:case`pnpm`:case`yarn`:case`bun`:return getViteCacheDir(t);default:return[]}}async function getCommandOutput(e,t,n){let r=`${e} ${t.join(` `)}`;try{let i=await getExecOutput(e,t,{cwd:n?.cwd,silent:!0,ignoreReturnCode:!0});if(i.exitCode===0)return i.stdout.trim();debug(`Command "${r}" exited with code ${i.exitCode}`);return}catch(e){warning(`Failed to run "${r}": ${String(e)}`);return}}async function getViteCacheDir(e){let t=await getCommandOutput(`vp`,[`pm`,`cache`,`dir`],{cwd:e});return t?[t]:[]}const oa=2e3;async function installVitePlus(e){let{version:t}=e;info(`Installing ${Xi}@${t}...`);let n={...process.env,VP_VERSION:t,VITE_PLUS_VERSION:t},r=supportsVitePlusDirs(t)?createVitePlusDirsFile():void 0;r?(n.VP_VPDIRS_AWARE=`1`,n[ra]=r):(delete n.VP_VPDIRS_AWARE,delete n[ra]),e.nodeManager!==void 0&&(n.VP_NODE_MANAGER=e.nodeManager?`yes`:`no`);let i=pkgPrNewCommitSha(t);i&&(n.VP_PR_VERSION=i);let{pinned:a,latest:o}=getInstallScriptUrls(t),s=a.length+o.length,c=2*s,l=``,u=0,tryUrls=async e=>{for(let t=0;t<2;t++)for(let t of e){u++;try{let e=await runInstallCommand(t,n);if(e===0)return!0;l=`exit code ${e}`}catch(e){l=e instanceof Error?e.message:String(e)}u0){if(await tryUrls(a)){ensureVitePlusBinInPath(t,r);return}warning(`Could not fetch the install script pinned to ${Xi}@${t}. Falling back to the latest install script. The latest script may not be compatible with ${t}.`)}if(await tryUrls(o)){ensureVitePlusBinInPath(t,r);return}throw Error(`Failed to install ${Xi} after ${c} attempts across ${s} URL(s): ${l}`)}finally{r&&removeVitePlusDirsFile(r)}}async function runInstallCommand(e,t){let n={env:t,ignoreReturnCode:!0},{command:r,args:i}=getInstallScriptCommand(e,process.platform,t.VP_VPDIRS_AWARE===`1`);return exec(r,i,n)}function ensureVitePlusBinInPath(e,t){let n=resolveVitePlusBinDir(e,t,I(getVitePlusHome(),`bin`));process.env.PATH?.split(te).includes(n)||addPath(n)}function getOptions$1(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,debug(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,debug(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,debug(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const sa=process.platform===`win32`;function dirname$2(e){if(e=safeTrimTrailingSeparator$1(e),sa&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=u.dirname(e);return sa&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=safeTrimTrailingSeparator$1(t)),t}function ensureAbsoluteRoot$1(e,t){if(g(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),g(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),hasAbsoluteRoot$1(t))return t;if(sa){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?t.length===2?`${t[0]}:\\${e.substr(3)}`:(e.endsWith(`\\`)||(e+=`\\`),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}if(normalizeSeparators$1(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return g(hasAbsoluteRoot$1(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||sa&&e.endsWith(`\\`)||(e+=u.sep),e+t}function hasAbsoluteRoot$1(e){return g(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=normalizeSeparators$1(e),sa?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function hasRoot$1(e){return g(e,`isRooted parameter 'itemPath' must not be empty`),e=normalizeSeparators$1(e),sa?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function normalizeSeparators$1(e){return e||=``,sa?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function safeTrimTrailingSeparator$1(e){return e?(e=normalizeSeparators$1(e),!e.endsWith(u.sep)||e===u.sep||sa&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var ca;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(ca||={});const la=process.platform===`win32`;function getSearchPaths$1(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=la?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=la?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=dirname$2(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=dirname$2(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function match$2(e,t){let n=ca.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function partialMatch$1(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var ua=__commonJSMin(((e,t)=>{t.exports=function(e,t){for(var r=[],i=0;i{t.exports=balanced;function balanced(e,t,n){e instanceof RegExp&&(e=maybeMatch(e,n)),t instanceof RegExp&&(t=maybeMatch(t,n));var r=range(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function maybeMatch(e,t){var n=t.match(e);return n?n[0]:null}balanced.range=range;function range(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i=0?c:l;r.length&&(s=[a,o])}return s}})),fa=__commonJSMin(((e,t)=>{ua();var n=da();t.exports=expandTop;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=1e5,l=4e6;function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function unescapeBraces(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function parseCommaParts(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=parseCommaParts(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function expandTop(e,t){if(!e)return[];t||={};var n=t.max==null?c:t.max,r=t.maxLength==null?l:t.maxLength;return e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),expand(escapeBraces(e),n,r,!0).map(unescapeBraces)}function embrace(e){return`{`+e+`}`}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function combine(e,t,n,r,i,a,o,s){for(var c=[],l=0,u=0;u=i)return c;var f=e[u]+n+r[d];if(!(o&&f.length===t[u])){if(l+f.length>a)return c;c.push(f),s.push(t[u]),l+=f.length}}return c}function expandSequence(e,t,n,r){var i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;var o=numeric(i[0]),s=numeric(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(numeric(i[2])),1):1,u=lte;s0){var v=Array(g+1).join(`0`);h=p<0?`-`+v+h.slice(1):v+h}}if(f+h.length>r)break;a.push(h),f+=h.length}return a}function expand(e,t,r,i){for(var o=[``],s=[0],c=!1,l=!0,u;;){var d=n(`{`,`}`,e);if(!d)return combine(o,s,e,[``],t,r,c,[]);var f=d.pre;if(/\$$/.test(f))return combine(o,s,e,[``],t,r,c,[]);var p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),g=p||h,v=d.body.indexOf(`,`)>=0;if(!g&&!v){if(d.post.match(/,(?!,).*\}/)){e=d.pre+`{`+d.body+a+d.post,i=!0,l=!0,c=!1,s=[];for(var y=0;y=t||w+O.length>r)break outer;b.push(O),w+=O.length}}}if(u=[],o=combine(o,s,f,b,t,r,c&&!d.post.length,u),s=u,!d.post.length)break;e=d.post}return o}})),pa=__toESM(__commonJSMin(((e,t)=>{t.exports=minimatch,minimatch.Minimatch=Minimatch;var n=function(){try{return R(`path`)}catch{}}()||{sep:`/`};minimatch.sep=n.sep;var r=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},i=fa(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=charSet(`().*{}+?[]^$\\!`);function charSet(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var d=/\/+/;minimatch.filter=filter;function filter(e,t){return t||={},function(n,r,i){return minimatch(n,e,t)}}function ext(e,t){t||={};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}minimatch.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return minimatch;var t=minimatch,m=function(n,r,i){return t(n,r,ext(e,i))};return m.Minimatch=function(n,r){return new t.Minimatch(n,ext(e,r))},m.Minimatch.defaults=function(n){return t.defaults(ext(e,n)).Minimatch},m.filter=function(n,r){return t.filter(n,ext(e,r))},m.defaults=function(n){return t.defaults(ext(e,n))},m.makeRe=function(n,r){return t.makeRe(n,ext(e,r))},m.braceExpand=function(n,r){return t.braceExpand(n,ext(e,r))},m.match=function(n,r,i){return t.match(n,r,ext(e,i))},m},Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,n){return assertValidPattern(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new Minimatch(t,n).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch))return new Minimatch(e,t);assertValidPattern(e),t||={},e=e.trim(),!t.allowWindowsEscape&&n.sep!==`/`&&(e=e.split(n.sep).join(`/`)),this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}Minimatch.prototype.debug=function(){},Minimatch.prototype.make=make;function make(){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(d)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;if)throw TypeError(`pattern is too long`)};Minimatch.prototype.parse=parse;var p={};function parse(e,t){assertValidPattern(e);var n=this.options;if(e===`**`){if(n.noglobstar)e=`*`;else return r}if(e===``)return``;var i=``,c=!!n.nocase,l=!1,d=[],f=[],h,g=!1,v=-1,y=-1,b=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,x=this;function clearStateChar(){if(h){switch(h){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+h}x.debug(`clearStateChar %j %j`,h,i),h=!1}}for(var S=0,C=e.length,w;S-1;j--){var M=f[j],N=i.slice(0,M.reStart),P=i.slice(M.reStart,M.reEnd-8),ee=i.slice(M.reEnd-8,M.reEnd),F=i.slice(M.reEnd);ee+=F;var te=N.split(`(`).length-1,ne=F;for(S=0;S=0&&(a=e[o],!a);o--);for(o=0;o=0;o--)if(t[o]===r){c=o;break}var l=t.slice(a,s),u=n?t.slice(s+1):t.slice(s+1,c),d=n?[]:t.slice(c+1);if(l.length){var f=e.slice(i,i+l.length);if(!this._matchOne(f,l,n,0,0))return!1;i+=l.length}var p=0;if(d.length){if(d.length+i>e.length)return!1;var h=e.length-d.length;if(this._matchOne(e,d,n,h,0))p=d.length;else{if(e[e.length-1]!==``||i+d.length===e.length||(h--,!this._matchOne(e,d,n,h,0)))return!1;p=d.length+1}}if(!u.length){var g=!!p;for(o=i;o0,`Parameter 'itemPath' must not be an empty array`);for(let t=0;tPattern$1.getLiteral(e)).filter(e=>!a&&!(a=e===``));this.searchPath=new Path$1(o).toString(),this.rootRegExp=new RegExp(Pattern$1.regExpEscape(o[0]),ga?`i`:``),this.isImplicitPattern=t;let s={dot:!0,nobrace:!0,nocase:ga,nocomment:!0,noext:!0,nonegate:!0};i=ga?i.replace(/\\/g,`/`):i,this.minimatch=new ha(i,s)}match(e){return this.segments[this.segments.length-1]===`**`?(e=normalizeSeparators$1(e),!e.endsWith(u.sep)&&this.isImplicitPattern===!1&&(e=`${e}${u.sep}`)):e=safeTrimTrailingSeparator$1(e),this.minimatch.match(e)?this.trailingSeparator?ca.Directory:ca.All:ca.None}partialMatch(e){return e=safeTrimTrailingSeparator$1(e),dirname$2(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(ga?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(ga?e:e.replace(/\\/g,`\\\\`)).replace(/(\[)(?=[^/]+\])/g,`[[]`).replace(/\?/g,`[?]`).replace(/\*/g,`[*]`)}static fixupPattern(e,n){g(e,`pattern cannot be empty`);let r=new Path$1(e).segments.map(e=>Pattern$1.getLiteral(e));if(g(r.every((e,t)=>(e!==`.`||t===0)&&e!==`..`),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),g(!hasRoot$1(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),e=normalizeSeparators$1(e),e===`.`||e.startsWith(`.${u.sep}`))e=Pattern$1.globEscape(process.cwd())+e.substr(1);else if(e===`~`||e.startsWith(`~${u.sep}`))n||=t.homedir(),g(n,`Unable to determine HOME directory`),g(hasAbsoluteRoot$1(n),`Expected HOME directory to be a rooted path. Actual '${n}'`),e=Pattern$1.globEscape(n)+e.substr(1);else if(ga&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=ensureAbsoluteRoot$1(`C:\\dummy-root`,e.substr(0,2));e.length>2&&!t.endsWith(`\\`)&&(t+=`\\`),e=Pattern$1.globEscape(t)+e.substr(2)}else if(ga&&(e===`\\`||e.match(/^\\[^\\]/))){let t=ensureAbsoluteRoot$1(`C:\\dummy-root`,`\\`);t.endsWith(`\\`)||(t+=`\\`),e=Pattern$1.globEscape(t)+e.substr(1)}else e=ensureAbsoluteRoot$1(Pattern$1.globEscape(process.cwd()),e);return normalizeSeparators$1(e)}static getLiteral(e){let t=``;for(let n=0;n=0){if(r.length>1)return``;if(r){t+=r,n=i;continue}}}t+=r}return t}static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,`\\$&`)}},SearchState$1=class{constructor(e,t){this.path=e,this.level=t}},__awaiter$13=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},__asyncValues$4=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},verb(`next`),verb(`throw`),verb(`return`),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),settle(r,i,n.done,n.value)})}}function settle(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},__await$1=function(e){return this instanceof __await$1?(this.v=e,this):new __await$1(e)},__asyncGenerator$1=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),verb(`next`),verb(`throw`),verb(`return`,awaitReturn),i[Symbol.asyncIterator]=function(){return this},i;function awaitReturn(e){return function(t){return Promise.resolve(t).then(e,reject)}}function verb(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||resume(e,t)})},t&&(i[e]=t(i[e])))}function resume(e,t){try{step(r[e](t))}catch(e){settle(a[0][3],e)}}function step(e){e.value instanceof __await$1?Promise.resolve(e.value.v).then(fulfill,reject):settle(a[0][2],e)}function fulfill(e){resume(`next`,e)}function reject(e){resume(`throw`,e)}function settle(e,t){e(t),a.shift(),a.length&&resume(a[0][0],a[0][1])}};const va=process.platform===`win32`;var ya=class DefaultGlobber$1{constructor(e){this.patterns=[],this.searchPaths=[],this.options=getOptions$1(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){return __awaiter$13(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=__asyncValues$4(this.globGenerator()),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}globGenerator(){return __asyncGenerator$1(this,arguments,function*(){let e=getOptions$1(this.options),t=[];for(let n of this.patterns)t.push(n),e.implicitDescendants&&(n.trailingSeparator||n.segments[n.segments.length-1]!==`**`)&&t.push(new _a(n.negate,!0,n.segments.concat(`**`)));let n=[];for(let e of getSearchPaths$1(t)){debug(`Search path '${e}'`);try{yield __await$1(a.promises.lstat(e))}catch(e){if(e.code===`ENOENT`)continue;throw e}n.unshift(new SearchState$1(e,1))}let r=[];for(;n.length;){let i=n.pop(),o=match$2(t,i.path),s=!!o||partialMatch$1(t,i.path);if(!o&&!s)continue;let c=yield __await$1(DefaultGlobber$1.stat(i,e,r));if(c&&!(e.excludeHiddenFiles&&u.basename(i.path).match(/^\./))){if(c.isDirectory()){if(o&ca.Directory&&e.matchDirectories)yield yield __await$1(i.path);else if(!s)continue;let t=i.level+1,r=(yield __await$1(a.promises.readdir(i.path))).map(e=>new SearchState$1(u.join(i.path,e),t));n.push(...r.reverse())}else o&ca.File&&(yield yield __await$1(i.path))}}})}static create(e,t){return __awaiter$13(this,void 0,void 0,function*(){let n=new DefaultGlobber$1(t);va&&(e=e.replace(/\r\n/g,` +curl -fsSL ${pa} ${e} | bash +`.trim()]}}function getVitePlusHome(){let e=process.platform===`win32`?process.env.USERPROFILE:process.env.HOME;return I(e||ye(),`.vite-plus`)}function isWithin(e,t){let n=ie(t,e);return!re(n)&&n!==`..`&&!n.startsWith(`..${oe}`)}function parseInstalledVpVersion(e){return(e.match(/^\s*vp\s+v?(\d[^\s]*)/im)??e.match(/Global:\s*v?(\d[^\s]*)/i))?.[1]??`unknown`}function getWorkspaceDir(){return process.env.GITHUB_WORKSPACE||process.cwd()}function resolvePath(e,t){return re(e)?e:I(t,e)}function getConfiguredProjectDir(e){if(!e.workingDirectory)return getWorkspaceDir();let t=resolvePath(e.workingDirectory,getWorkspaceDir());if(!ue(t))throw Error(`working-directory not found: ${e.workingDirectory} (resolved to ${t})`);if(!L(t).isDirectory())throw Error(`working-directory is not a directory: ${e.workingDirectory} (resolved to ${t})`);return t}function getInstallCwd(e,t){return t?resolvePath(t,e):e}const ga=[{filename:`pnpm-lock.yaml`,type:`pnpm`},{filename:`bun.lockb`,type:`bun`},{filename:`bun.lock`,type:`bun`},{filename:`package-lock.json`,type:`npm`},{filename:`npm-shrinkwrap.json`,type:`npm`},{filename:`yarn.lock`,type:`yarn`}];function detectLockFile(e,t=getWorkspaceDir(),n=!1){if(e){let n=resolvePath(e,t);if(ue(n)){let e=F(n),t=ga.find(t=>t.filename===e);return t?{type:t.type,path:n,filename:e}:inferLockFileType(n,e)}return}let r=pe(t);for(let e of ga)if(r.includes(e.filename)){let r=I(t,e.filename);return n||info(`Auto-detected lock file: ${e.filename}`),{type:e.type,path:r,filename:e.filename}}}function inferLockFileType(e,t){return t.includes(`pnpm`)?{type:`pnpm`,path:e,filename:t}:t.includes(`yarn`)?{type:`yarn`,path:e,filename:t}:t.startsWith(`bun.`)?{type:`bun`,path:e,filename:t}:{type:`npm`,path:e,filename:t}}async function getCacheDirectories(e,t){switch(e){case`npm`:case`pnpm`:case`yarn`:case`bun`:return getViteCacheDir(t);default:return[]}}async function getCommandOutput(e,t,n){let r=`${e} ${t.join(` `)}`;try{let i=await getExecOutput(e,t,{cwd:n?.cwd,silent:!0,ignoreReturnCode:!0});if(i.exitCode===0)return i.stdout.trim();debug(`Command "${r}" exited with code ${i.exitCode}`);return}catch(e){warning(`Failed to run "${r}": ${String(e)}`);return}}async function getViteCacheDir(e){let t=await getCommandOutput(`vp`,[`pm`,`cache`,`dir`],{cwd:e});return t?[t]:[]}const _a=2e3;async function installVitePlus(e){let{version:t}=e;info(`Installing ${sa}@${t}...`);let n={...process.env,VP_VERSION:t,VITE_PLUS_VERSION:t},r=supportsVitePlusDirs(t)?createVitePlusDirsFile():void 0;r?(n.VP_VPDIRS_AWARE=`1`,n[ma]=r):(delete n.VP_VPDIRS_AWARE,delete n[ma]),e.nodeManager!==void 0&&(n.VP_NODE_MANAGER=e.nodeManager?`yes`:`no`);let i=pkgPrNewCommitSha(t);i&&(n.VP_PR_VERSION=i);let{pinned:a,latest:o}=getInstallScriptUrls(t),s=a.length+o.length,c=2*s,l=``,u=0,tryUrls=async e=>{for(let t=0;t<2;t++)for(let t of e){u++;try{let e=await runInstallCommand(t,n);if(e===0)return!0;l=`exit code ${e}`}catch(e){l=e instanceof Error?e.message:String(e)}u0){if(await tryUrls(a)){ensureVitePlusBinInPath(t,r);return}warning(`Could not fetch the install script pinned to ${sa}@${t}. Falling back to the latest install script. The latest script may not be compatible with ${t}.`)}if(await tryUrls(o)){ensureVitePlusBinInPath(t,r);return}throw Error(`Failed to install ${sa} after ${c} attempts across ${s} URL(s): ${l}`)}finally{r&&removeVitePlusDirsFile(r)}}async function runInstallCommand(e,t){let n={env:t,ignoreReturnCode:!0},{command:r,args:i}=getInstallScriptCommand(e,process.platform,t.VP_VPDIRS_AWARE===`1`);return exec(r,i,n)}function ensureVitePlusBinInPath(e,t){let n=resolveVitePlusBinDir(e,t,I(getVitePlusHome(),`bin`));process.env.PATH?.split(te).includes(n)||addPath(n)}function getOptions$1(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,debug(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,debug(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,debug(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const va=process.platform===`win32`;function dirname$2(e){if(e=safeTrimTrailingSeparator$1(e),va&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=u.dirname(e);return va&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=safeTrimTrailingSeparator$1(t)),t}function ensureAbsoluteRoot$1(e,t){if(g(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),g(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),hasAbsoluteRoot$1(t))return t;if(va){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?t.length===2?`${t[0]}:\\${e.substr(3)}`:(e.endsWith(`\\`)||(e+=`\\`),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}if(normalizeSeparators$1(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return g(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return g(hasAbsoluteRoot$1(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||va&&e.endsWith(`\\`)||(e+=u.sep),e+t}function hasAbsoluteRoot$1(e){return g(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=normalizeSeparators$1(e),va?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function hasRoot$1(e){return g(e,`isRooted parameter 'itemPath' must not be empty`),e=normalizeSeparators$1(e),va?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function normalizeSeparators$1(e){return e||=``,va?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function safeTrimTrailingSeparator$1(e){return e?(e=normalizeSeparators$1(e),!e.endsWith(u.sep)||e===u.sep||va&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var ya;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(ya||={});const ba=process.platform===`win32`;function getSearchPaths$1(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=ba?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=ba?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=dirname$2(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=dirname$2(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function match$2(e,t){let n=ya.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function partialMatch$1(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var xa=__commonJSMin(((e,t)=>{t.exports=function(e,t){for(var r=[],i=0;i{t.exports=balanced;function balanced(e,t,n){e instanceof RegExp&&(e=maybeMatch(e,n)),t instanceof RegExp&&(t=maybeMatch(t,n));var r=range(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function maybeMatch(e,t){var n=t.match(e);return n?n[0]:null}balanced.range=range;function range(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i=0?c:l;r.length&&(s=[a,o])}return s}})),Ca=__commonJSMin(((e,t)=>{xa();var n=Sa();t.exports=expandTop;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=1e5,l=4e6;function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function unescapeBraces(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function parseCommaParts(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=parseCommaParts(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function expandTop(e,t){if(!e)return[];t||={};var n=t.max==null?c:t.max,r=t.maxLength==null?l:t.maxLength;return e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),expand(escapeBraces(e),n,r,!0).map(unescapeBraces)}function embrace(e){return`{`+e+`}`}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function combine(e,t,n,r,i,a,o,s){for(var c=[],l=0,u=0;u=i)return c;var f=e[u]+n+r[d];if(!(o&&f.length===t[u])){if(l+f.length>a)return c;c.push(f),s.push(t[u]),l+=f.length}}return c}function expandSequence(e,t,n,r){var i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;var o=numeric(i[0]),s=numeric(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(numeric(i[2])),1):1,u=lte;s0){var v=Array(g+1).join(`0`);h=p<0?`-`+v+h.slice(1):v+h}}if(f+h.length>r)break;a.push(h),f+=h.length}return a}function expand(e,t,r,i){for(var o=[``],s=[0],c=!1,l=!0,u;;){var d=n(`{`,`}`,e);if(!d)return combine(o,s,e,[``],t,r,c,[]);var f=d.pre;if(/\$$/.test(f))return combine(o,s,e,[``],t,r,c,[]);var p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),g=p||h,v=d.body.indexOf(`,`)>=0;if(!g&&!v){if(d.post.match(/,(?!,).*\}/)){e=d.pre+`{`+d.body+a+d.post,i=!0,l=!0,c=!1,s=[];for(var y=0;y=t||w+O.length>r)break outer;b.push(O),w+=O.length}}}if(u=[],o=combine(o,s,f,b,t,r,c&&!d.post.length,u),s=u,!d.post.length)break;e=d.post}return o}})),wa=__toESM(__commonJSMin(((e,t)=>{t.exports=minimatch,minimatch.Minimatch=Minimatch;var n=function(){try{return R(`path`)}catch{}}()||{sep:`/`};minimatch.sep=n.sep;var r=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},i=Ca(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=charSet(`().*{}+?[]^$\\!`);function charSet(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var d=/\/+/;minimatch.filter=filter;function filter(e,t){return t||={},function(n,r,i){return minimatch(n,e,t)}}function ext(e,t){t||={};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}minimatch.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return minimatch;var t=minimatch,m=function(n,r,i){return t(n,r,ext(e,i))};return m.Minimatch=function(n,r){return new t.Minimatch(n,ext(e,r))},m.Minimatch.defaults=function(n){return t.defaults(ext(e,n)).Minimatch},m.filter=function(n,r){return t.filter(n,ext(e,r))},m.defaults=function(n){return t.defaults(ext(e,n))},m.makeRe=function(n,r){return t.makeRe(n,ext(e,r))},m.braceExpand=function(n,r){return t.braceExpand(n,ext(e,r))},m.match=function(n,r,i){return t.match(n,r,ext(e,i))},m},Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,n){return assertValidPattern(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new Minimatch(t,n).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch))return new Minimatch(e,t);assertValidPattern(e),t||={},e=e.trim(),!t.allowWindowsEscape&&n.sep!==`/`&&(e=e.split(n.sep).join(`/`)),this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}Minimatch.prototype.debug=function(){},Minimatch.prototype.make=make;function make(){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(d)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;if)throw TypeError(`pattern is too long`)};Minimatch.prototype.parse=parse;var p={};function parse(e,t){assertValidPattern(e);var n=this.options;if(e===`**`){if(n.noglobstar)e=`*`;else return r}if(e===``)return``;var i=``,c=!!n.nocase,l=!1,d=[],f=[],h,g=!1,v=-1,y=-1,b=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,x=this;function clearStateChar(){if(h){switch(h){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+h}x.debug(`clearStateChar %j %j`,h,i),h=!1}}for(var S=0,C=e.length,w;S-1;j--){var M=f[j],N=i.slice(0,M.reStart),P=i.slice(M.reStart,M.reEnd-8),ee=i.slice(M.reEnd-8,M.reEnd),F=i.slice(M.reEnd);ee+=F;var te=N.split(`(`).length-1,ne=F;for(S=0;S=0&&(a=e[o],!a);o--);for(o=0;o=0;o--)if(t[o]===r){c=o;break}var l=t.slice(a,s),u=n?t.slice(s+1):t.slice(s+1,c),d=n?[]:t.slice(c+1);if(l.length){var f=e.slice(i,i+l.length);if(!this._matchOne(f,l,n,0,0))return!1;i+=l.length}var p=0;if(d.length){if(d.length+i>e.length)return!1;var h=e.length-d.length;if(this._matchOne(e,d,n,h,0))p=d.length;else{if(e[e.length-1]!==``||i+d.length===e.length||(h--,!this._matchOne(e,d,n,h,0)))return!1;p=d.length+1}}if(!u.length){var g=!!p;for(o=i;o0,`Parameter 'itemPath' must not be an empty array`);for(let t=0;tPattern$1.getLiteral(e)).filter(e=>!a&&!(a=e===``));this.searchPath=new Path$1(o).toString(),this.rootRegExp=new RegExp(Pattern$1.regExpEscape(o[0]),Da?`i`:``),this.isImplicitPattern=t;let s={dot:!0,nobrace:!0,nocase:Da,nocomment:!0,noext:!0,nonegate:!0};i=Da?i.replace(/\\/g,`/`):i,this.minimatch=new Ea(i,s)}match(e){return this.segments[this.segments.length-1]===`**`?(e=normalizeSeparators$1(e),!e.endsWith(u.sep)&&this.isImplicitPattern===!1&&(e=`${e}${u.sep}`)):e=safeTrimTrailingSeparator$1(e),this.minimatch.match(e)?this.trailingSeparator?ya.Directory:ya.All:ya.None}partialMatch(e){return e=safeTrimTrailingSeparator$1(e),dirname$2(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(Da?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(Da?e:e.replace(/\\/g,`\\\\`)).replace(/(\[)(?=[^/]+\])/g,`[[]`).replace(/\?/g,`[?]`).replace(/\*/g,`[*]`)}static fixupPattern(e,n){g(e,`pattern cannot be empty`);let r=new Path$1(e).segments.map(e=>Pattern$1.getLiteral(e));if(g(r.every((e,t)=>(e!==`.`||t===0)&&e!==`..`),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),g(!hasRoot$1(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),e=normalizeSeparators$1(e),e===`.`||e.startsWith(`.${u.sep}`))e=Pattern$1.globEscape(process.cwd())+e.substr(1);else if(e===`~`||e.startsWith(`~${u.sep}`))n||=t.homedir(),g(n,`Unable to determine HOME directory`),g(hasAbsoluteRoot$1(n),`Expected HOME directory to be a rooted path. Actual '${n}'`),e=Pattern$1.globEscape(n)+e.substr(1);else if(Da&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=ensureAbsoluteRoot$1(`C:\\dummy-root`,e.substr(0,2));e.length>2&&!t.endsWith(`\\`)&&(t+=`\\`),e=Pattern$1.globEscape(t)+e.substr(2)}else if(Da&&(e===`\\`||e.match(/^\\[^\\]/))){let t=ensureAbsoluteRoot$1(`C:\\dummy-root`,`\\`);t.endsWith(`\\`)||(t+=`\\`),e=Pattern$1.globEscape(t)+e.substr(1)}else e=ensureAbsoluteRoot$1(Pattern$1.globEscape(process.cwd()),e);return normalizeSeparators$1(e)}static getLiteral(e){let t=``;for(let n=0;n=0){if(r.length>1)return``;if(r){t+=r,n=i;continue}}}t+=r}return t}static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,`\\$&`)}},SearchState$1=class{constructor(e,t){this.path=e,this.level=t}},__awaiter$13=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},__asyncValues$4=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},verb(`next`),verb(`throw`),verb(`return`),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),settle(r,i,n.done,n.value)})}}function settle(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},__await$1=function(e){return this instanceof __await$1?(this.v=e,this):new __await$1(e)},__asyncGenerator$1=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),verb(`next`),verb(`throw`),verb(`return`,awaitReturn),i[Symbol.asyncIterator]=function(){return this},i;function awaitReturn(e){return function(t){return Promise.resolve(t).then(e,reject)}}function verb(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||resume(e,t)})},t&&(i[e]=t(i[e])))}function resume(e,t){try{step(r[e](t))}catch(e){settle(a[0][3],e)}}function step(e){e.value instanceof __await$1?Promise.resolve(e.value.v).then(fulfill,reject):settle(a[0][2],e)}function fulfill(e){resume(`next`,e)}function reject(e){resume(`throw`,e)}function settle(e,t){e(t),a.shift(),a.length&&resume(a[0][0],a[0][1])}};const ka=process.platform===`win32`;var Aa=class DefaultGlobber$1{constructor(e){this.patterns=[],this.searchPaths=[],this.options=getOptions$1(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){return __awaiter$13(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=__asyncValues$4(this.globGenerator()),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}globGenerator(){return __asyncGenerator$1(this,arguments,function*(){let e=getOptions$1(this.options),t=[];for(let n of this.patterns)t.push(n),e.implicitDescendants&&(n.trailingSeparator||n.segments[n.segments.length-1]!==`**`)&&t.push(new Oa(n.negate,!0,n.segments.concat(`**`)));let n=[];for(let e of getSearchPaths$1(t)){debug(`Search path '${e}'`);try{yield __await$1(a.promises.lstat(e))}catch(e){if(e.code===`ENOENT`)continue;throw e}n.unshift(new SearchState$1(e,1))}let r=[];for(;n.length;){let i=n.pop(),o=match$2(t,i.path),s=!!o||partialMatch$1(t,i.path);if(!o&&!s)continue;let c=yield __await$1(DefaultGlobber$1.stat(i,e,r));if(c&&!(e.excludeHiddenFiles&&u.basename(i.path).match(/^\./))){if(c.isDirectory()){if(o&ya.Directory&&e.matchDirectories)yield yield __await$1(i.path);else if(!s)continue;let t=i.level+1,r=(yield __await$1(a.promises.readdir(i.path))).map(e=>new SearchState$1(u.join(i.path,e),t));n.push(...r.reverse())}else o&ya.File&&(yield yield __await$1(i.path))}}})}static create(e,t){return __awaiter$13(this,void 0,void 0,function*(){let n=new DefaultGlobber$1(t);ka&&(e=e.replace(/\r\n/g,` `),e=e.replace(/\r/g,` `));let r=e.split(` -`).map(e=>e.trim());for(let e of r)if(!e||e.startsWith(`#`))continue;else n.patterns.push(new _a(e));return n.searchPaths.push(...getSearchPaths$1(n.patterns)),n})}static stat(e,t,n){return __awaiter$13(this,void 0,void 0,function*(){let r;if(t.followSymbolicLinks)try{r=yield a.promises.stat(e.path)}catch(n){if(n.code===`ENOENT`){if(t.omitBrokenSymbolicLinks){debug(`Broken symlink '${e.path}'`);return}throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw n}else r=yield a.promises.lstat(e.path);if(r.isDirectory()&&t.followSymbolicLinks){let t=yield a.promises.realpath(e.path);for(;n.length>=e.level;)n.pop();if(n.some(e=>e===t)){debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return}n.push(t)}return r})}},__awaiter$11=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function create$1(e,t){return __awaiter$11(this,void 0,void 0,function*(){return yield ya.create(e,t)})}var ba=__commonJSMin(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),xa=__commonJSMin(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Sa=__commonJSMin(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ba(),a=xa();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],makeSafeRegex=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},createToken=(e,t,n)=>{let r=makeSafeRegex(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};createToken(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),createToken(`NUMERICIDENTIFIERLOOSE`,`\\d+`),createToken(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),createToken(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),createToken(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),createToken(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),createToken(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),createToken(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),createToken(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),createToken(`BUILDIDENTIFIER`,`${f}+`),createToken(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),createToken(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),createToken(`FULL`,`^${c[u.FULLPLAIN]}$`),createToken(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),createToken(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),createToken(`GTLT`,`((?:<|>)?=?)`),createToken(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),createToken(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),createToken(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),createToken(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),createToken(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),createToken(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),createToken(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),createToken(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),createToken(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),createToken(`COERCERTL`,c[u.COERCE],!0),createToken(`COERCERTLFULL`,c[u.COERCEFULL],!0),createToken(`LONETILDE`,`(?:~>?)`),createToken(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,createToken(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),createToken(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),createToken(`LONECARET`,`(?:\\^)`),createToken(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,createToken(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),createToken(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),createToken(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),createToken(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),createToken(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,createToken(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),createToken(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),createToken(`STAR`,`(<|>)?=?\\s*\\*`),createToken(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),createToken(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Ca=__commonJSMin(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),wa=__commonJSMin(((e,t)=>{let n=/^[0-9]+$/,compareIdentifiers=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:ecompareIdentifiers(t,e)}})),Ta=__commonJSMin(((e,t)=>{let n=xa(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ba(),{safeRe:a,t:o}=Sa(),s=Ca(),{compareIdentifiers:c}=wa(),isPrereleaseIdentifier=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;tr)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let c=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!c)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=c[4]?c[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch)}comparePre(e){if(e instanceof SemVer||(e=new SemVer(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(n(`prerelease compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof SemVer||(e=new SemVer(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n(`build compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),isPrereleaseIdentifier(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Ea=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Da=__commonJSMin(((e,t)=>{let n=Ea();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Oa=__commonJSMin(((e,t)=>{let n=Ea();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),ka=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Aa=__commonJSMin(((e,t)=>{let n=Ea();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),ja=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t)=>new n(e,t).major})),Ma=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t)=>new n(e,t).minor})),Na=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t)=>new n(e,t).patch})),Pa=__commonJSMin(((e,t)=>{let n=Ea();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Fa=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Ia=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(t,e,r)})),La=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t)=>n(e,t,!0)})),Ra=__commonJSMin(((e,t)=>{let n=Ta();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),za=__commonJSMin(((e,t)=>{let n=Ra();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ba=__commonJSMin(((e,t)=>{let n=Ra();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Va=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)>0})),Ha=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)<0})),Ua=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)===0})),Wa=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)!==0})),Ga=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)>=0})),Ka=__commonJSMin(((e,t)=>{let n=Fa();t.exports=(e,t,r)=>n(e,t,r)<=0})),qa=__commonJSMin(((e,t)=>{let n=Ua(),r=Wa(),i=Va(),a=Ga(),o=Ha(),s=Ka();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Ja=__commonJSMin(((e,t)=>{let n=Ta(),r=Ea(),{safeRe:i,t:a}=Sa();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),Ya=__commonJSMin(((e,t)=>{let n=Ea(),r=ba(),i=Ta(),truncate=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=cloneInputVersion(e,n);return i&&doTruncation(i,t)},cloneInputVersion=(e,t)=>{let r=e instanceof i?e.version:e;return n(r,t)},doTruncation=(e,t)=>{if(isPrerelease(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},isPrerelease=e=>e.startsWith(`pre`);t.exports=truncate})),Xa=__commonJSMin(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),Za=__commonJSMin(((e,t)=>{let n=/\s+/g;t.exports=class Range{constructor(e,t){if(t=i(t),e instanceof Range)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Range(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!isNullSet(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&isAny(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(v,``);let t=((this.options.includePrerelease&&h)|(this.options.loose&&g))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,hyphenReplace(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>parseComparator(e,this.options)).join(` `).split(/\s+/).map(e=>replaceGTE0(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let y=new Map,b=l.map(e=>new a(e,this.options));for(let e of b){if(isNullSet(e))return[e];y.set(e.value,e)}y.size>1&&y.has(``)&&y.delete(``);let x=[...y.values()];return r.set(t,x),x}intersects(e,t){if(!(e instanceof Range))throw TypeError(`a Range is required`);return this.set.some(n=>isSatisfiable(n,t)&&e.set.some(e=>isSatisfiable(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,isAny=e=>e.value===``,isSatisfiable=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},parseComparator=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=replaceCarets(e,t),o(`caret`,e),e=replaceTildes(e,t),o(`tildes`,e),e=replaceXRanges(e,t),o(`xrange`,e),e=replaceStars(e,t),o(`stars`,e),e),isX=e=>!e||e.toLowerCase()===`x`||e===`*`,invalidXRangeOrder=(e,t,n)=>isX(e)&&!isX(t)||isX(t)&&n&&!isX(n),replaceTildes=(e,t)=>e.trim().split(/\s+/).map(e=>replaceTilde(e,t)).join(` `),replaceTilde=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return isX(n)?c=``:isX(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:isX(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},replaceCarets=(e,t)=>e.trim().split(/\s+/).map(e=>replaceCaret(e,t)).join(` `),replaceCaret=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return isX(n)?c=``:isX(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:isX(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},replaceXRanges=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>replaceXRange(e,t)).join(` `)),replaceXRange=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),invalidXRangeOrder(i,a,s))return e;let l=isX(i),u=l||isX(a),d=u||isX(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},replaceStars=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),replaceGTE0=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),hyphenReplace=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=isX(r)?``:isX(i)?`>=${r}.0.0${e?`-0`:``}`:isX(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=isX(l)?``:isX(u)?`<${+l+1}.0.0-0`:isX(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),testSet=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Qa=__commonJSMin(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class Comparator{static get ANY(){return n}constructor(e,t){if(t=r(t),e instanceof Comparator){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(` `),s(`comparator`,e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(e.value,t).test(this.value):e.operator===``?e.value===``||new l(this.value,t).test(e.semver):(t=r(t),t.includePrerelease&&(this.value===`<0.0.0-0`||e.value===`<0.0.0-0`)||!t.includePrerelease&&(this.value.startsWith(`<0.0.0`)||e.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&e.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&e.operator.startsWith(`<`)||this.semver.version===e.semver.version&&this.operator.includes(`=`)&&e.operator.includes(`=`)||o(this.semver,`<`,e.semver,t)&&this.operator.startsWith(`>`)&&e.operator.startsWith(`<`)||o(this.semver,`>`,e.semver,t)&&this.operator.startsWith(`<`)&&e.operator.startsWith(`>`)))}};let r=Ca(),{safeRe:i,t:a}=Sa(),o=qa(),s=xa(),c=Ta(),l=Za()})),$a=__commonJSMin(((e,t)=>{let n=Za();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),eo=__commonJSMin(((e,t)=>{let n=Za();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),to=__commonJSMin(((e,t)=>{let n=Ta(),r=Za();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),no=__commonJSMin(((e,t)=>{let n=Ta(),r=Za();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),ro=__commonJSMin(((e,t)=>{let n=Ta(),r=Za(),i=Va();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),io=__commonJSMin(((e,t)=>{let n=Za();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),ao=__commonJSMin(((e,t)=>{let n=Ta(),r=Qa(),{ANY:i}=r,a=Za(),o=$a(),s=Va(),c=Ha(),l=Ka(),u=Ga();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,h,g,v,y;switch(d){case`>`:p=s,h=l,g=c,v=`>`,y=`>=`;break;case`<`:p=c,h=u,g=s,v=`<`,y=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:g(e.semver,s.semver,f)&&(s=e)}),o.operator===v||o.operator===y||(!s.operator||s.operator===v)&&h(e,s.semver)||s.operator===y&&g(e,s.semver))return!1}return!0}})),oo=__commonJSMin(((e,t)=>{let n=ao();t.exports=(e,t,r)=>n(e,t,`>`,r)})),so=__commonJSMin(((e,t)=>{let n=ao();t.exports=(e,t,r)=>n(e,t,`<`,r)})),co=__commonJSMin(((e,t)=>{let n=Za();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),lo=__commonJSMin(((e,t)=>{let n=$a(),r=Fa();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length{let n=Za(),r=Qa(),{ANY:i}=r,a=$a(),o=Fa(),subset=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=simpleSubset(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},s=[new r(`>=0.0.0-0`)],c=[new r(`>=0.0.0`)],simpleSubset=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?s:c}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=c}let r=new Set,l,u;for(let t of e)t.operator===`>`||t.operator===`>=`?l=higherGT(l,t,n):t.operator===`<`||t.operator===`<=`?u=lowerLT(u,t,n):r.add(t.semver);if(r.size>1)return null;let d;if(l&&u&&(d=o(l.semver,u.semver,n),d>0||d===0&&(l.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(l&&!a(e,String(l),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let f,p,h,g,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(g=g||e.operator===`>`||e.operator===`>=`,h=h||e.operator===`<`||e.operator===`<=`,l){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(f=higherGT(l,e,n),f===e&&f!==l)return!1}else if(l.operator===`>=`&&!e.test(l.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(p=lowerLT(u,e,n),p===e&&p!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||l)&&d!==0)return!1}return!(l&&h&&!u&&d!==0||u&&g&&!l&&d!==0||y||v)},higherGT=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},lowerLT=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=subset})),fo=__toESM(__commonJSMin(((e,t)=>{let n=Sa(),r=ba(),i=Ta(),a=wa();t.exports={parse:Ea(),valid:Da(),clean:Oa(),inc:ka(),diff:Aa(),major:ja(),minor:Ma(),patch:Na(),prerelease:Pa(),compare:Fa(),rcompare:Ia(),compareLoose:La(),compareBuild:Ra(),sort:za(),rsort:Ba(),gt:Va(),lt:Ha(),eq:Ua(),neq:Wa(),gte:Ga(),lte:Ka(),cmp:qa(),coerce:Ja(),truncate:Ya(),Comparator:Qa(),Range:Za(),satisfies:$a(),toComparators:eo(),maxSatisfying:to(),minSatisfying:no(),minVersion:ro(),validRange:io(),outside:ao(),gtr:oo(),ltr:so(),intersects:co(),simplifyRange:lo(),subset:uo(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1),po;(function(e){e.Gzip=`cache.tgz`,e.Zstd=`cache.tzst`})(po||={});var mo;(function(e){e.Gzip=`gzip`,e.ZstdWithoutLong=`zstd-without-long`,e.Zstd=`zstd`})(mo||={});var ho;(function(e){e.GNU=`gnu`,e.BSD=`bsd`})(ho||={});const go=5e3,_o=5e3,vo=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,yo=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,bo=`cache.tar`,xo=`manifest.txt`;var __awaiter$10=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},__asyncValues$2=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},verb(`next`),verb(`throw`),verb(`return`),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),settle(r,i,n.done,n.value)})}}function settle(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}};function createTempDirectory(){return __awaiter$10(this,void 0,void 0,function*(){let e=process.platform===`win32`,t=process.env.RUNNER_TEMP||``;if(!t){let n;n=e?process.env.USERPROFILE||`C:\\`:process.platform===`darwin`?`/Users`:`/home`,t=u.join(n,`actions`,`temp`)}let n=u.join(t,i.randomUUID());return yield mkdirP(n),n})}function getArchiveFileSizeInBytes(e){return a.statSync(e).size}function resolvePaths(e){return __awaiter$10(this,void 0,void 0,function*(){var t,n,r,i;let a=[],o=process.env.GITHUB_WORKSPACE??process.cwd(),s=yield create$1(e.join(` -`),{implicitDescendants:!1});try{for(var c=!0,l=__asyncValues$2(s.globGenerator()),d;d=yield l.next(),t=d.done,!t;c=!0){i=d.value,c=!1;let e=i,t=u.relative(o,e).replace(RegExp(`\\${u.sep}`,`g`),`/`);debug(`Matched: ${t}`),t===``?a.push(`.`):a.push(`${t}`)}}catch(e){n={error:e}}finally{try{!c&&!t&&(r=l.return)&&(yield r.call(l))}finally{if(n)throw n.error}}return a})}function unlinkFile(e){return __awaiter$10(this,void 0,void 0,function*(){return y.promisify(a.unlink)(e)})}function getVersion(e){return __awaiter$10(this,arguments,void 0,function*(e,t=[]){let n=``;t.push(`--version`),debug(`Checking ${e} ${t.join(` `)}`);try{yield exec(`${e}`,t,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=e.toString(),stderr:e=>n+=e.toString()}})}catch(e){debug(e.message)}return n=n.trim(),debug(n),n})}function getCompressionMethod(){return __awaiter$10(this,void 0,void 0,function*(){let e=yield getVersion(`zstd`,[`--quiet`]);return debug(`zstd version: ${fo.clean(e)}`),e===``?mo.Gzip:mo.ZstdWithoutLong})}function getCacheFileName(e){return e===mo.Gzip?po.Gzip:po.Zstd}function getGnuTarPathOnWindows(){return __awaiter$10(this,void 0,void 0,function*(){return a.existsSync(vo)?vo:(yield getVersion(`tar`)).toLowerCase().includes(`gnu tar`)?which(`tar`):``})}function assertDefined(e,t){if(t===void 0)throw Error(`Expected ${e} but value was undefiend`);return t}function getCacheVersion(e,t,n=!1){let r=e.slice();return t&&r.push(t),process.platform===`win32`&&!n&&r.push(`windows-only`),r.push(`1.0`),i.createHash(`sha256`).update(r.join(`|`)).digest(`hex`)}function getRuntimeToken(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}var AbortError$1=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function log(e,...t){Te.stderr.write(`${T.format(e,...t)}${_e}`)}function getEnvironmentVariable(e){return Te.env[e]}typeof Te.versions.deno==`string`&&Te.versions.deno.length,typeof Te.versions.bun==`string`&&Te.versions.bun.length;const So=getEnvironmentVariable(`DEBUG`);let Co,wo=[],To=[];const Eo=[];So&&enable(So);const Do=Object.assign(e=>createDebugger(e),{enable,enabled,disable,log});function enable(e){Co=e,wo=[],To=[];let t=e.split(`,`).map(e=>e.trim());for(let e of t)e.startsWith(`-`)?To.push(e.substring(1)):wo.push(e);for(let e of Eo)e.enabled=enabled(e.namespace)}function enabled(e){if(e.endsWith(`*`))return!0;for(let t of To)if(namespaceMatches(e,t))return!1;for(let t of wo)if(namespaceMatches(e,t))return!0;return!1}function namespaceMatches(e,t){if(t.indexOf(`*`)===-1)return e===t;let n=t;if(t.indexOf(`**`)!==-1){let e=[],r=``;for(let n of t)if(n===`*`&&r===`*`)continue;else r=n,e.push(n);n=e.join(``)}let r=0,i=0,a=n.length,o=e.length,s=-1,c=-1;for(;r=0){if(i=s+1,r=c+1,r===o)return!1;for(;e[r]!==n[i];)if(r++,r===o)return!1;c=r,r++,i++;continue}else return!1;let l=r===e.length,u=i===n.length,d=i===n.length-1&&n[i]===`*`;return l&&(u||d)}function disable(){let e=Co||``;return enable(``),e}function createDebugger(e){let t=Object.assign(debug,{enabled:enabled(e),destroy,log:Do.log,namespace:e,extend});function debug(...n){t.enabled&&(n.length>0&&(n[0]=`${e} ${n[0]}`),t.log(...n))}return Eo.push(t),t}function destroy(){let e=Eo.indexOf(this);return e>=0&&(Eo.splice(e,1),!0)}function extend(e){let t=createDebugger(`${this.namespace}:${e}`);return t.log=this.log,t}const Oo=[`verbose`,`info`,`warning`,`error`],ko={verbose:400,info:300,warning:200,error:100};function patchLogMethod(e,t){t.log=(...t)=>{e.log(...t)}}function isTypeSpecRuntimeLogLevel(e){return Oo.includes(e)}function createLoggerContext(e){let t=new Set,n=getEnvironmentVariable(e.logLevelEnvVarName),r,i=Do(e.namespace);i.log=(...e)=>{Do.log(...e)};function contextSetLogLevel(e){if(e&&!isTypeSpecRuntimeLogLevel(e))throw Error(`Unknown log level '${e}'. Acceptable values: ${Oo.join(`,`)}`);r=e;let n=[];for(let e of t)shouldEnable(e)&&n.push(e.namespace);Do.enable(n.join(`,`))}n&&(isTypeSpecRuntimeLogLevel(n)?contextSetLogLevel(n):console.error(`${e.logLevelEnvVarName} set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${Oo.join(`, `)}.`));function shouldEnable(e){return!!(r&&ko[e.level]<=ko[r])}function createLogger(e,n){let r=Object.assign(e.extend(n),{level:n});if(patchLogMethod(e,r),shouldEnable(r)){let e=Do.disable();Do.enable(e+`,`+r.namespace)}return t.add(r),r}function contextGetLogLevel(){return r}function contextCreateClientLogger(e){let t=i.extend(e);return patchLogMethod(i,t),{error:createLogger(t,`error`),warning:createLogger(t,`warning`),info:createLogger(t,`info`),verbose:createLogger(t,`verbose`)}}return{setLogLevel:contextSetLogLevel,getLogLevel:contextGetLogLevel,createClientLogger:contextCreateClientLogger,logger:i}}const Ao=createLoggerContext({logLevelEnvVarName:`TYPESPEC_RUNTIME_LOG_LEVEL`,namespace:`typeSpecRuntime`});Ao.logger;function createClientLogger$1(e){return Ao.createClientLogger(e)}function normalizeName(e){return e.toLowerCase()}function normalizeValue(e){return String(e).trim().replace(/[\r\n]/g,``)}function*headerIterator(e){for(let t of e.values())yield[t.name,t.value]}var HttpHeadersImpl=class{_headersMap;constructor(e){if(this._headersMap=new Map,e)for(let t of Object.keys(e))this.set(t,e[t])}set(e,t){this._headersMap.set(normalizeName(e),{name:e,value:normalizeValue(t)})}get(e){return this._headersMap.get(normalizeName(e))?.value}has(e){return this._headersMap.has(normalizeName(e))}delete(e){this._headersMap.delete(normalizeName(e))}toJSON(e={}){let t={};if(e.preserveCase)for(let e of this._headersMap.values())t[e.name]=e.value;else for(let[e,n]of this._headersMap)t[e]=n.value;return t}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return headerIterator(this._headersMap)}};function createHttpHeaders$1(e){return new HttpHeadersImpl(e)}function randomUUID$2(){return globalThis.crypto.randomUUID()}var PipelineRequestImpl=class{url;method;headers;timeout;withCredentials;body;multipartBody;formData;streamResponseStatusCodes;enableBrowserStreams;proxySettings;disableKeepAlive;abortSignal;requestId;allowInsecureConnection;onUploadProgress;onDownloadProgress;requestOverrides;authSchemes;constructor(e){this.url=e.url,this.body=e.body,this.headers=e.headers??createHttpHeaders$1(),this.method=e.method??`GET`,this.timeout=e.timeout??0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=e.disableKeepAlive??!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=e.withCredentials??!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||randomUUID$2(),this.allowInsecureConnection=e.allowInsecureConnection??!1,this.enableBrowserStreams=e.enableBrowserStreams??!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function createPipelineRequest$1(e){return new PipelineRequestImpl(e)}const jo=new Set([`Deserialize`,`Serialize`,`Retry`,`Sign`]);var Mo=class HttpPipeline{_policies=[];_orderedPolicies;constructor(e){this._policies=e?.slice(0)??[],this._orderedPolicies=void 0}addPolicy(e,t={}){if(t.phase&&t.afterPhase)throw Error(`Policies inside a phase cannot specify afterPhase.`);if(t.phase&&!jo.has(t.phase))throw Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!jo.has(t.afterPhase))throw Error(`Invalid afterPhase name: ${t.afterPhase}`);this._policies.push({policy:e,options:t}),this._orderedPolicies=void 0}removePolicy(e){let t=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(t.push(n.policy),!1):!0),this._orderedPolicies=void 0,t}sendRequest(e,t){return this.getOrderedPolicies().reduceRight((e,t)=>n=>t.sendRequest(n,e),t=>e.sendRequest(t))(t)}getOrderedPolicies(){return this._orderedPolicies||=this.orderPolicies(),this._orderedPolicies}clone(){return new HttpPipeline(this._policies)}static create(){return new HttpPipeline}orderPolicies(){let e=[],t=new Map;function createPhase(e){return{name:e,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}let n=createPhase(`Serialize`),r=createPhase(`None`),i=createPhase(`Deserialize`),a=createPhase(`Retry`),o=createPhase(`Sign`),s=[n,r,i,a,o];function getPhase(e){return e===`Retry`?a:e===`Serialize`?n:e===`Deserialize`?i:e===`Sign`?o:r}for(let e of this._policies){let n=e.policy,r=e.options,i=n.name;if(t.has(i))throw Error(`Duplicate policy names not allowed in pipeline`);let a={policy:n,dependsOn:new Set,dependants:new Set};r.afterPhase&&(a.afterPhase=getPhase(r.afterPhase),a.afterPhase.hasAfterPolicies=!0),t.set(i,a),getPhase(r.phase).policies.add(a)}for(let e of this._policies){let{policy:n,options:r}=e,i=n.name,a=t.get(i);if(!a)throw Error(`Missing node for policy ${i}`);if(r.afterPolicies)for(let e of r.afterPolicies){let n=t.get(e);n&&(a.dependsOn.add(n),n.dependants.add(a))}if(r.beforePolicies)for(let e of r.beforePolicies){let n=t.get(e);n&&(n.dependsOn.add(a),a.dependants.add(n))}}function walkPhase(n){n.hasRun=!0;for(let r of n.policies)if(!(r.afterPhase&&(!r.afterPhase.hasRun||r.afterPhase.policies.size))&&r.dependsOn.size===0){e.push(r.policy);for(let e of r.dependants)e.dependsOn.delete(r);t.delete(r.policy.name),n.policies.delete(r)}}function walkPhases(){for(let e of s){if(walkPhase(e),e.policies.size>0&&e!==r){r.hasRun||walkPhase(r);return}e.hasAfterPolicies&&walkPhase(r)}}let c=0;for(;t.size>0;){c++;let t=e.length;if(walkPhases(),e.length<=t&&c>1)throw Error(`Cannot satisfy policy dependencies due to requirements cycle.`)}return e}};function createEmptyPipeline$1(){return Mo.create()}function isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function isError$1(e){if(isObject(e)){let t=typeof e.name==`string`,n=typeof e.message==`string`;return t&&n}return!1}const No=E.custom,Po=`REDACTED`,Fo=`x-ms-client-request-id.x-ms-return-client-request-id.x-ms-useragent.x-ms-correlation-request-id.x-ms-request-id.client-request-id.ms-cv.return-client-request-id.traceparent.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Origin.Accept.Accept-Encoding.Cache-Control.Connection.Content-Length.Content-Type.Date.ETag.Expires.If-Match.If-Modified-Since.If-None-Match.If-Unmodified-Since.Last-Modified.Pragma.Request-Id.Retry-After.Server.Transfer-Encoding.User-Agent.WWW-Authenticate`.split(`.`),Io=[`api-version`];var Sanitizer=class{allowedHeaderNames;allowedQueryParameters;constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=Fo.concat(e),t=Io.concat(t),this.allowedHeaderNames=new Set(e.map(e=>e.toLowerCase())),this.allowedQueryParameters=new Set(t.map(e=>e.toLowerCase()))}sanitize(e){let t=new Set;return JSON.stringify(e,(e,n)=>{if(n instanceof Error)return{...n,name:n.name,message:n.message};if(e===`headers`&&isObject(n))return this.sanitizeHeaders(n);if(e===`url`&&typeof n==`string`)return this.sanitizeUrl(n);if(e===`query`&&isObject(n))return this.sanitizeQuery(n);if(e!==`body`&&e!==`response`&&e!==`operationSpec`){if(Array.isArray(n)||isObject(n)){if(t.has(n))return`[Circular]`;t.add(n)}return n}},2)}sanitizeUrl(e){if(typeof e!=`string`||e===null||e===``)return e;let t=new URL(e);if(!t.search)return e;for(let[e]of t.searchParams)this.allowedQueryParameters.has(e.toLowerCase())||t.searchParams.set(e,Po);return t.toString()}sanitizeHeaders(e){let t={};for(let n of Object.keys(e))t[n]=this.allowedHeaderNames.has(n.toLowerCase())?e[n]:Po;return t}sanitizeQuery(e){if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))t[n]=this.allowedQueryParameters.has(n.toLowerCase())?e[n]:Po;return t}};const Lo=new Sanitizer;var Ro=class RestError$1 extends Error{static REQUEST_SEND_ERROR=`REQUEST_SEND_ERROR`;static PARSE_ERROR=`PARSE_ERROR`;code;statusCode;request;response;details;constructor(e,t={}){super(e),this.name=`RestError`,this.code=t.code,this.statusCode=t.statusCode,Object.defineProperty(this,"request",{value:t.request,enumerable:!1}),Object.defineProperty(this,"response",{value:t.response,enumerable:!1});let n=this.request?.agent?{maxFreeSockets:this.request.agent.maxFreeSockets,maxSockets:this.request.agent.maxSockets}:void 0;Object.defineProperty(this,No,{value:()=>`RestError: ${this.message} \n ${Lo.sanitize({...this,request:{...this.request,agent:n},response:this.response})}`,enumerable:!1}),Object.setPrototypeOf(this,RestError$1.prototype)}};function isRestError$1(e){return e instanceof Ro||isError$1(e)&&e.name===`RestError`}function uint8ArrayToString$1(e,t){return Buffer.from(e).toString(t)}function stringToUint8Array$1(e,t){return Buffer.from(e,t)}const zo=createClientLogger$1(`ts-http-runtime`),Bo={};function isReadableStream(e){return e&&typeof e.pipe==`function`}function isStreamComplete(e){return e.readable===!1?Promise.resolve():new Promise(t=>{let handler=()=>{t(),e.removeListener(`close`,handler),e.removeListener(`end`,handler),e.removeListener(`error`,handler)};e.on(`close`,handler),e.on(`end`,handler),e.on(`error`,handler)})}function isArrayBuffer(e){return e&&typeof e.byteLength==`number`}var ReportTransform=class extends C{loadedBytes=0;progressCallback;_transform(e,t,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(e){n(e)}}constructor(e){super(),this.progressCallback=e}},NodeHttpClient=class{cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let t=new AbortController,abortListener;if(e.abortSignal){if(e.abortSignal.aborted)throw new AbortError$1(`The operation was aborted. Request has already been canceled.`);abortListener=e=>{e.type===`abort`&&t.abort()},e.abortSignal.addEventListener(`abort`,abortListener)}let n;e.timeout>0&&(n=setTimeout(()=>{let n=new Sanitizer;zo.info(`request to '${n.sanitizeUrl(e.url)}' timed out. canceling...`),t.abort()},e.timeout));let r=e.headers.get(`Accept-Encoding`),i=r?.includes(`gzip`)||r?.includes(`deflate`),a=typeof e.body==`function`?e.body():e.body;if(a&&!e.headers.has(`Content-Length`)){let t=getBodyLength(a);t!==null&&e.headers.set(`Content-Length`,t)}let o;try{if(a&&e.onUploadProgress){let t=e.onUploadProgress,n=new ReportTransform(t);n.on(`error`,e=>{zo.error(`Error in upload progress`,e)}),isReadableStream(a)?a.pipe(n):n.end(a),a=n}let r=await this.makeRequest(e,t,a);n!==void 0&&clearTimeout(n);let s=getResponseHeaders(r),c={status:r.statusCode??0,headers:s,request:e};if(e.method===`HEAD`)return r.resume(),c;o=i?getDecodedResponseStream(r,s):r;let l=e.onDownloadProgress;if(l){let e=new ReportTransform(l);e.on(`error`,e=>{zo.error(`Error in download progress`,e)}),o.pipe(e),o=e}return e.streamResponseStatusCodes?.has(1/0)||e.streamResponseStatusCodes?.has(c.status)?c.readableStreamBody=o:c.bodyAsText=await streamToText(o),c}finally{if(e.abortSignal&&abortListener){let t=Promise.resolve();isReadableStream(a)&&(t=isStreamComplete(a));let n=Promise.resolve();isReadableStream(o)&&(n=isStreamComplete(o)),Promise.all([t,n]).then(()=>{abortListener&&e.abortSignal?.removeEventListener(`abort`,abortListener)}).catch(e=>{zo.warning(`Error when cleaning up abortListener on httpRequest`,e)})}}}makeRequest(e,t,n){let r=new URL(e.url),i=r.protocol!==`https:`;if(i&&!e.allowInsecureConnection)throw Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let a={agent:e.agent??this.getOrCreateAgent(e,i),hostname:r.hostname,path:`${r.pathname}${r.search}`,port:r.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0}),...e.requestOverrides};return new Promise((r,o)=>{let s=i?b.request(a,r):Ee.request(a,r);s.once(`error`,t=>{o(new Ro(t.message,{code:t.code??Ro.REQUEST_SEND_ERROR,request:e}))}),t.signal.addEventListener(`abort`,()=>{let e=new AbortError$1(`The operation was aborted. Rejecting from abort signal callback while making request.`);s.destroy(e),o(e)}),n&&isReadableStream(n)?n.pipe(s):n?typeof n==`string`||Buffer.isBuffer(n)?s.end(n):isArrayBuffer(n)?s.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n)):(zo.error(`Unrecognized body type`,n),o(new Ro(`Unrecognized body type`))):s.end()})}getOrCreateAgent(e,t){let n=e.disableKeepAlive;if(t)return n?b.globalAgent:(this.cachedHttpAgent||=new b.Agent({keepAlive:!0}),this.cachedHttpAgent);{if(n&&!e.tlsSettings)return Ee.globalAgent;let t=e.tlsSettings??Bo,r=this.cachedHttpsAgents.get(t);return r&&r.options.keepAlive===!n?r:(zo.info(`No cached TLS Agent exist, creating a new Agent`),r=new Ee.Agent({keepAlive:!n,...t}),this.cachedHttpsAgents.set(t,r),r)}}};function getResponseHeaders(e){let t=createHttpHeaders$1();for(let n of Object.keys(e.headers)){let r=e.headers[n];Array.isArray(r)?r.length>0&&t.set(n,r[0]):r&&t.set(n,r)}return t}function getDecodedResponseStream(e,t){let n=t.get(`Content-Encoding`);if(n===`gzip`){let t=D.createGunzip();return e.pipe(t),t}if(n===`deflate`){let t=D.createInflate();return e.pipe(t),t}return e}function streamToText(e){return new Promise((t,n)=>{let r=[];e.on(`data`,e=>{Buffer.isBuffer(e)?r.push(e):r.push(Buffer.from(e))}),e.on(`end`,()=>{t(Buffer.concat(r).toString(`utf8`))}),e.on(`error`,e=>{e&&e?.name===`AbortError`?n(e):n(new Ro(`Error reading response as text: ${e.message}`,{code:Ro.PARSE_ERROR}))})})}function getBodyLength(e){return e?Buffer.isBuffer(e)?e.length:isReadableStream(e)?null:isArrayBuffer(e)?e.byteLength:typeof e==`string`?Buffer.from(e).length:null:0}function createNodeHttpClient(){return new NodeHttpClient}function createDefaultHttpClient$1(){return createNodeHttpClient()}function logPolicy$1(e={}){let t=e.logger??zo.info,n=new Sanitizer({additionalAllowedHeaderNames:e.additionalAllowedHeaderNames,additionalAllowedQueryParameters:e.additionalAllowedQueryParameters});return{name:`logPolicy`,async sendRequest(e,r){if(!t.enabled)return r(e);t(`Request: ${n.sanitize(e)}`);let i=await r(e);return t(`Response status code: ${i.status}`),t(`Headers: ${n.sanitize({headers:i.headers})}`),i}}}function getRandomIntegerInclusive(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function calculateRetryDelay(e,t){let n=t.retryDelayInMs*2**e,r=Math.min(t.maxRetryDelayInMs,n);return{retryAfterInMs:r/2+getRandomIntegerInclusive(0,r/2)}}function delay$2(e,t,n){return new Promise((r,i)=>{let a,onAborted,rejectOnAbort=()=>i(new AbortError$1(n?.abortErrorMsg?n?.abortErrorMsg:`The operation was aborted.`)),removeListeners=()=>{n?.abortSignal&&onAborted&&n.abortSignal.removeEventListener(`abort`,onAborted)};if(onAborted=()=>(a&&clearTimeout(a),removeListeners(),rejectOnAbort()),n?.abortSignal&&n.abortSignal.aborted)return rejectOnAbort();a=setTimeout(()=>{removeListeners(),r(t)},e),n?.abortSignal&&n.abortSignal.addEventListener(`abort`,onAborted)})}function parseHeaderValueAsNumber(e,t){let n=e.headers.get(t);if(!n)return;let r=Number(n);if(!Number.isNaN(r))return r}const Vo=`Retry-After`,Ho=[`retry-after-ms`,`x-ms-retry-after-ms`,Vo];function getRetryAfterInMs(e){if(e&&[429,503].includes(e.status))try{for(let t of Ho){let n=parseHeaderValueAsNumber(e,t);if(n===0||n)return n*(t===Vo?1e3:1)}let t=e.headers.get(Vo);if(!t)return;let n=Date.parse(t)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}function isThrottlingRetryResponse(e){return Number.isFinite(getRetryAfterInMs(e))}function throttlingRetryStrategy(){return{name:`throttlingRetryStrategy`,retry({response:e}){let t=getRetryAfterInMs(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}}}function exponentialRetryStrategy(e={}){let t=e.retryDelayInMs??1e3,n=e.maxRetryDelayInMs??64e3;return{name:`exponentialRetryStrategy`,retry({retryCount:r,response:i,responseError:a}){let o=isSystemError(a),s=o&&e.ignoreSystemErrors,c=isExponentialRetryResponse(i),l=c&&e.ignoreHttpStatusCodes;return i&&(isThrottlingRetryResponse(i)||!c)||l||s?{skipStrategy:!0}:a&&!o&&!c?{errorToThrow:a}:calculateRetryDelay(r,{retryDelayInMs:t,maxRetryDelayInMs:n})}}}function isExponentialRetryResponse(e){return!!(e&&e.status!==void 0&&(e.status>=500||e.status===408)&&e.status!==501&&e.status!==505)}function isSystemError(e){return e?e.code===`ETIMEDOUT`||e.code===`ESOCKETTIMEDOUT`||e.code===`ECONNREFUSED`||e.code===`ECONNRESET`||e.code===`ENOENT`||e.code===`ENOTFOUND`:!1}const Uo=createClientLogger$1(`ts-http-runtime retryPolicy`);function retryPolicy(e,t={maxRetries:3}){let n=t.logger||Uo;return{name:`retryPolicy`,async sendRequest(r,i){let a,o,s=-1;retryRequest:for(;;){s+=1,a=void 0,o=void 0;try{n.info(`Retry ${s}: Attempting to send request`,r.requestId),a=await i(r),n.info(`Retry ${s}: Received a response from request`,r.requestId)}catch(e){if(n.error(`Retry ${s}: Received an error from request`,r.requestId),!isRestError$1(e))throw e;o=e,a=e.response}if(r.abortSignal?.aborted)throw n.error(`Retry ${s}: Request aborted.`),new AbortError$1;if(s>=(t.maxRetries??3)){if(n.info(`Retry ${s}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),o)throw o;if(a)return a;throw Error(`Maximum retries reached with no response or error to throw`)}n.info(`Retry ${s}: Processing ${e.length} retry strategies.`);strategiesLoop:for(let t of e){let e=t.logger||n;e.info(`Retry ${s}: Processing retry strategy ${t.name}.`);let i=t.retry({retryCount:s,response:a,responseError:o});if(i.skipStrategy){e.info(`Retry ${s}: Skipped.`);continue strategiesLoop}let{errorToThrow:c,retryAfterInMs:l,redirectTo:u}=i;if(c)throw e.error(`Retry ${s}: Retry strategy ${t.name} throws error:`,c),c;if(l||l===0){e.info(`Retry ${s}: Retry strategy ${t.name} retries after ${l}`),await delay$2(l,void 0,{abortSignal:r.abortSignal});continue retryRequest}if(u){e.info(`Retry ${s}: Retry strategy ${t.name} redirects to ${u}`),r.url=u;continue retryRequest}}if(o)throw n.info(`None of the retry strategies could work with the received error. Throwing it.`),o;if(a)return n.info(`None of the retry strategies could work with the received response. Returning it.`),a}}}}function defaultRetryPolicy$1(e={}){return{name:`defaultRetryPolicy`,sendRequest:retryPolicy([throttlingRetryStrategy(),exponentialRetryStrategy(e)],{maxRetries:e.maxRetries??3}).sendRequest}}function convertBodyToFormDataMap(e){if(typeof FormData<`u`&&e instanceof FormData){let t={};for(let[n,r]of e.entries()){let e=t[n];Array.isArray(e)?e.push(r):t[n]=e===void 0?[r]:[e,r]}return t}}function formDataPolicy$1(){return{name:`formDataPolicy`,async sendRequest(e,t){let n=convertBodyToFormDataMap(e.body);if(n&&(e.formData=n,e.body=void 0),e.formData){let t=e.headers.get(`Content-Type`);t&&t.indexOf(`application/x-www-form-urlencoded`)!==-1?e.body=wwwFormUrlEncode(e.formData):await prepareFormData(e.formData,e),e.formData=void 0}return t(e)}}}function wwwFormUrlEncode(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e.toString());else t.append(n,r.toString());return t.toString()}async function prepareFormData(e,t){let n=t.headers.get(`Content-Type`);if(n&&!n.startsWith(`multipart/form-data`))return;t.headers.set(`Content-Type`,n??`multipart/form-data`);let r=[];for(let[t,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])if(typeof e==`string`)r.push({headers:createHttpHeaders$1({"Content-Disposition":`form-data; name="${t}"`}),body:stringToUint8Array$1(e,`utf-8`)});else if(typeof e!=`object`||!e)throw Error(`Unexpected value for key ${t}: ${e}. Value should be serialized to string first.`);else{let n=e.name||`blob`,i=createHttpHeaders$1();i.set(`Content-Disposition`,`form-data; name="${t}"; filename="${n}"`),i.set(`Content-Type`,e.type||`application/octet-stream`),r.push({headers:i,body:e})}t.multipartBody={parts:r}}function agentPolicy$1(e){return{name:`agentPolicy`,sendRequest:async(t,n)=>(t.agent||=e,n(t))}}function tlsPolicy$1(e){return{name:`tlsPolicy`,sendRequest:async(t,n)=>(t.tlsSettings||=e,n(t))}}var Wo=__commonJSMin(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return parse(e);if(n===`number`&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function parse(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function fmtLong(e){var t=Math.abs(e);return t>=a?plural(e,t,a,`day`):t>=i?plural(e,t,i,`hour`):t>=r?plural(e,t,r,`minute`):t>=n?plural(e,t,n,`second`):e+` ms`}function plural(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Go=__commonJSMin(((e,t)=>{function setup(e){createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=Wo(),createDebug.destroy=destroy,Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n{if(t===`%%`)return`%`;i++;let a=createDebug.formatters[r];if(typeof a==`function`){let r=e[i];t=a.call(n,r),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(n,e),(n.log||createDebug.log).apply(n,e)}return debug.namespace=e,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(e),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>n===null?(r!==createDebug.namespaces&&(r=createDebug.namespaces,i=createDebug.enabled(e)),i):n,set:e=>{n=e}}),typeof createDebug.init==`function`&&createDebug.init(debug),debug}function extend(e,t){let n=createDebug(this.namespace+(t===void 0?`:`:t)+e);return n.log=this.log,n}function enable(e){createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?createDebug.skips.push(e.slice(1)):createDebug.names.push(e)}function matchesTemplate(e,t){let n=0,r=0,i=-1,a=0;for(;n`-`+e)].join(`,`);return createDebug.enable(``),e}function enabled(e){for(let t of createDebug.skips)if(matchesTemplate(e,t))return!1;for(let t of createDebug.names)if(matchesTemplate(e,t))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return createDebug.enable(createDebug.load()),createDebug}t.exports=setup})),Ko=__commonJSMin(((e,t)=>{e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.storage=localstorage(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function useColors(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function save(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function load(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function localstorage(){try{return localStorage}catch{}}t.exports=Go()(e);let{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),qo=__commonJSMin(((e,t)=>{let n=R(`tty`),r=R(`util`);e.init=init,e.log=log,e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=R(`supports-color`);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function useColors(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function formatArgs(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(` +`).map(e=>e.trim());for(let e of r)if(!e||e.startsWith(`#`))continue;else n.patterns.push(new Oa(e));return n.searchPaths.push(...getSearchPaths$1(n.patterns)),n})}static stat(e,t,n){return __awaiter$13(this,void 0,void 0,function*(){let r;if(t.followSymbolicLinks)try{r=yield a.promises.stat(e.path)}catch(n){if(n.code===`ENOENT`){if(t.omitBrokenSymbolicLinks){debug(`Broken symlink '${e.path}'`);return}throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw n}else r=yield a.promises.lstat(e.path);if(r.isDirectory()&&t.followSymbolicLinks){let t=yield a.promises.realpath(e.path);for(;n.length>=e.level;)n.pop();if(n.some(e=>e===t)){debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return}n.push(t)}return r})}},__awaiter$11=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function create$1(e,t){return __awaiter$11(this,void 0,void 0,function*(){return yield Aa.create(e,t)})}var ja=__commonJSMin(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Ma=__commonJSMin(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Na=__commonJSMin(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ja(),a=Ma();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],makeSafeRegex=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},createToken=(e,t,n)=>{let r=makeSafeRegex(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};createToken(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),createToken(`NUMERICIDENTIFIERLOOSE`,`\\d+`),createToken(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),createToken(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),createToken(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),createToken(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),createToken(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),createToken(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),createToken(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),createToken(`BUILDIDENTIFIER`,`${f}+`),createToken(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),createToken(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),createToken(`FULL`,`^${c[u.FULLPLAIN]}$`),createToken(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),createToken(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),createToken(`GTLT`,`((?:<|>)?=?)`),createToken(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),createToken(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),createToken(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),createToken(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),createToken(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),createToken(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),createToken(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),createToken(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),createToken(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),createToken(`COERCERTL`,c[u.COERCE],!0),createToken(`COERCERTLFULL`,c[u.COERCEFULL],!0),createToken(`LONETILDE`,`(?:~>?)`),createToken(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,createToken(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),createToken(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),createToken(`LONECARET`,`(?:\\^)`),createToken(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,createToken(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),createToken(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),createToken(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),createToken(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),createToken(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,createToken(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),createToken(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),createToken(`STAR`,`(<|>)?=?\\s*\\*`),createToken(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),createToken(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Pa=__commonJSMin(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Fa=__commonJSMin(((e,t)=>{let n=/^[0-9]+$/,compareIdentifiers=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:ecompareIdentifiers(t,e)}})),Ia=__commonJSMin(((e,t)=>{let n=Ma(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ja(),{safeRe:a,t:o}=Na(),s=Pa(),{compareIdentifiers:c}=Fa(),isPrereleaseIdentifier=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;tr)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let c=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!c)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=c[4]?c[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch)}comparePre(e){if(e instanceof SemVer||(e=new SemVer(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(n(`prerelease compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof SemVer||(e=new SemVer(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n(`build compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),isPrereleaseIdentifier(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),La=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Ra=__commonJSMin(((e,t)=>{let n=La();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),za=__commonJSMin(((e,t)=>{let n=La();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Ba=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Va=__commonJSMin(((e,t)=>{let n=La();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),Ha=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t)=>new n(e,t).major})),Ua=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t)=>new n(e,t).minor})),Wa=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t)=>new n(e,t).patch})),Ga=__commonJSMin(((e,t)=>{let n=La();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Ka=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),qa=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(t,e,r)})),Ja=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t)=>n(e,t,!0)})),Ya=__commonJSMin(((e,t)=>{let n=Ia();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Xa=__commonJSMin(((e,t)=>{let n=Ya();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Za=__commonJSMin(((e,t)=>{let n=Ya();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Qa=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)>0})),$a=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)<0})),eo=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)===0})),to=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)!==0})),no=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)>=0})),ro=__commonJSMin(((e,t)=>{let n=Ka();t.exports=(e,t,r)=>n(e,t,r)<=0})),io=__commonJSMin(((e,t)=>{let n=eo(),r=to(),i=Qa(),a=no(),o=$a(),s=ro();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ao=__commonJSMin(((e,t)=>{let n=Ia(),r=La(),{safeRe:i,t:a}=Na();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),oo=__commonJSMin(((e,t)=>{let n=La(),r=ja(),i=Ia(),truncate=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=cloneInputVersion(e,n);return i&&doTruncation(i,t)},cloneInputVersion=(e,t)=>{let r=e instanceof i?e.version:e;return n(r,t)},doTruncation=(e,t)=>{if(isPrerelease(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},isPrerelease=e=>e.startsWith(`pre`);t.exports=truncate})),so=__commonJSMin(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),co=__commonJSMin(((e,t)=>{let n=/\s+/g;t.exports=class Range{constructor(e,t){if(t=i(t),e instanceof Range)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Range(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!isNullSet(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&isAny(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(v,``);let t=((this.options.includePrerelease&&h)|(this.options.loose&&g))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,hyphenReplace(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>parseComparator(e,this.options)).join(` `).split(/\s+/).map(e=>replaceGTE0(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let y=new Map,b=l.map(e=>new a(e,this.options));for(let e of b){if(isNullSet(e))return[e];y.set(e.value,e)}y.size>1&&y.has(``)&&y.delete(``);let x=[...y.values()];return r.set(t,x),x}intersects(e,t){if(!(e instanceof Range))throw TypeError(`a Range is required`);return this.set.some(n=>isSatisfiable(n,t)&&e.set.some(e=>isSatisfiable(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,isAny=e=>e.value===``,isSatisfiable=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},parseComparator=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=replaceCarets(e,t),o(`caret`,e),e=replaceTildes(e,t),o(`tildes`,e),e=replaceXRanges(e,t),o(`xrange`,e),e=replaceStars(e,t),o(`stars`,e),e),isX=e=>!e||e.toLowerCase()===`x`||e===`*`,invalidXRangeOrder=(e,t,n)=>isX(e)&&!isX(t)||isX(t)&&n&&!isX(n),replaceTildes=(e,t)=>e.trim().split(/\s+/).map(e=>replaceTilde(e,t)).join(` `),replaceTilde=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return isX(n)?c=``:isX(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:isX(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},replaceCarets=(e,t)=>e.trim().split(/\s+/).map(e=>replaceCaret(e,t)).join(` `),replaceCaret=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return isX(n)?c=``:isX(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:isX(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},replaceXRanges=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>replaceXRange(e,t)).join(` `)),replaceXRange=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),invalidXRangeOrder(i,a,s))return e;let l=isX(i),u=l||isX(a),d=u||isX(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},replaceStars=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),replaceGTE0=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),hyphenReplace=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=isX(r)?``:isX(i)?`>=${r}.0.0${e?`-0`:``}`:isX(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=isX(l)?``:isX(u)?`<${+l+1}.0.0-0`:isX(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),testSet=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),lo=__commonJSMin(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class Comparator{static get ANY(){return n}constructor(e,t){if(t=r(t),e instanceof Comparator){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(` `),s(`comparator`,e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(e.value,t).test(this.value):e.operator===``?e.value===``||new l(this.value,t).test(e.semver):(t=r(t),t.includePrerelease&&(this.value===`<0.0.0-0`||e.value===`<0.0.0-0`)||!t.includePrerelease&&(this.value.startsWith(`<0.0.0`)||e.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&e.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&e.operator.startsWith(`<`)||this.semver.version===e.semver.version&&this.operator.includes(`=`)&&e.operator.includes(`=`)||o(this.semver,`<`,e.semver,t)&&this.operator.startsWith(`>`)&&e.operator.startsWith(`<`)||o(this.semver,`>`,e.semver,t)&&this.operator.startsWith(`<`)&&e.operator.startsWith(`>`)))}};let r=Pa(),{safeRe:i,t:a}=Na(),o=io(),s=Ma(),c=Ia(),l=co()})),uo=__commonJSMin(((e,t)=>{let n=co();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),fo=__commonJSMin(((e,t)=>{let n=co();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),po=__commonJSMin(((e,t)=>{let n=Ia(),r=co();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),mo=__commonJSMin(((e,t)=>{let n=Ia(),r=co();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),ho=__commonJSMin(((e,t)=>{let n=Ia(),r=co(),i=Qa();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),go=__commonJSMin(((e,t)=>{let n=co();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),_o=__commonJSMin(((e,t)=>{let n=Ia(),r=lo(),{ANY:i}=r,a=co(),o=uo(),s=Qa(),c=$a(),l=ro(),u=no();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,h,g,v,y;switch(d){case`>`:p=s,h=l,g=c,v=`>`,y=`>=`;break;case`<`:p=c,h=u,g=s,v=`<`,y=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:g(e.semver,s.semver,f)&&(s=e)}),o.operator===v||o.operator===y||(!s.operator||s.operator===v)&&h(e,s.semver)||s.operator===y&&g(e,s.semver))return!1}return!0}})),vo=__commonJSMin(((e,t)=>{let n=_o();t.exports=(e,t,r)=>n(e,t,`>`,r)})),yo=__commonJSMin(((e,t)=>{let n=_o();t.exports=(e,t,r)=>n(e,t,`<`,r)})),bo=__commonJSMin(((e,t)=>{let n=co();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),xo=__commonJSMin(((e,t)=>{let n=uo(),r=Ka();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length{let n=co(),r=lo(),{ANY:i}=r,a=uo(),o=Ka(),subset=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=simpleSubset(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},s=[new r(`>=0.0.0-0`)],c=[new r(`>=0.0.0`)],simpleSubset=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?s:c}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=c}let r=new Set,l,u;for(let t of e)t.operator===`>`||t.operator===`>=`?l=higherGT(l,t,n):t.operator===`<`||t.operator===`<=`?u=lowerLT(u,t,n):r.add(t.semver);if(r.size>1)return null;let d;if(l&&u&&(d=o(l.semver,u.semver,n),d>0||d===0&&(l.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(l&&!a(e,String(l),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let f,p,h,g,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(g=g||e.operator===`>`||e.operator===`>=`,h=h||e.operator===`<`||e.operator===`<=`,l){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(f=higherGT(l,e,n),f===e&&f!==l)return!1}else if(l.operator===`>=`&&!e.test(l.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(p=lowerLT(u,e,n),p===e&&p!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||l)&&d!==0)return!1}return!(l&&h&&!u&&d!==0||u&&g&&!l&&d!==0||y||v)},higherGT=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},lowerLT=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=subset})),Co=__toESM(__commonJSMin(((e,t)=>{let n=Na(),r=ja(),i=Ia(),a=Fa();t.exports={parse:La(),valid:Ra(),clean:za(),inc:Ba(),diff:Va(),major:Ha(),minor:Ua(),patch:Wa(),prerelease:Ga(),compare:Ka(),rcompare:qa(),compareLoose:Ja(),compareBuild:Ya(),sort:Xa(),rsort:Za(),gt:Qa(),lt:$a(),eq:eo(),neq:to(),gte:no(),lte:ro(),cmp:io(),coerce:ao(),truncate:oo(),Comparator:lo(),Range:co(),satisfies:uo(),toComparators:fo(),maxSatisfying:po(),minSatisfying:mo(),minVersion:ho(),validRange:go(),outside:_o(),gtr:vo(),ltr:yo(),intersects:bo(),simplifyRange:xo(),subset:So(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1),wo;(function(e){e.Gzip=`cache.tgz`,e.Zstd=`cache.tzst`})(wo||={});var To;(function(e){e.Gzip=`gzip`,e.ZstdWithoutLong=`zstd-without-long`,e.Zstd=`zstd`})(To||={});var Eo;(function(e){e.GNU=`gnu`,e.BSD=`bsd`})(Eo||={});const Do=5e3,Oo=5e3,ko=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,Ao=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,jo=`cache.tar`,Mo=`manifest.txt`;var __awaiter$10=function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})},__asyncValues$2=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},verb(`next`),verb(`throw`),verb(`return`),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),settle(r,i,n.done,n.value)})}}function settle(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}};function createTempDirectory(){return __awaiter$10(this,void 0,void 0,function*(){let e=process.platform===`win32`,t=process.env.RUNNER_TEMP||``;if(!t){let n;n=e?process.env.USERPROFILE||`C:\\`:process.platform===`darwin`?`/Users`:`/home`,t=u.join(n,`actions`,`temp`)}let n=u.join(t,i.randomUUID());return yield mkdirP(n),n})}function getArchiveFileSizeInBytes(e){return a.statSync(e).size}function resolvePaths(e){return __awaiter$10(this,void 0,void 0,function*(){var t,n,r,i;let a=[],o=process.env.GITHUB_WORKSPACE??process.cwd(),s=yield create$1(e.join(` +`),{implicitDescendants:!1});try{for(var c=!0,l=__asyncValues$2(s.globGenerator()),d;d=yield l.next(),t=d.done,!t;c=!0){i=d.value,c=!1;let e=i,t=u.relative(o,e).replace(RegExp(`\\${u.sep}`,`g`),`/`);debug(`Matched: ${t}`),t===``?a.push(`.`):a.push(`${t}`)}}catch(e){n={error:e}}finally{try{!c&&!t&&(r=l.return)&&(yield r.call(l))}finally{if(n)throw n.error}}return a})}function unlinkFile(e){return __awaiter$10(this,void 0,void 0,function*(){return y.promisify(a.unlink)(e)})}function getVersion(e){return __awaiter$10(this,arguments,void 0,function*(e,t=[]){let n=``;t.push(`--version`),debug(`Checking ${e} ${t.join(` `)}`);try{yield exec(`${e}`,t,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=e.toString(),stderr:e=>n+=e.toString()}})}catch(e){debug(e.message)}return n=n.trim(),debug(n),n})}function getCompressionMethod(){return __awaiter$10(this,void 0,void 0,function*(){let e=yield getVersion(`zstd`,[`--quiet`]);return debug(`zstd version: ${Co.clean(e)}`),e===``?To.Gzip:To.ZstdWithoutLong})}function getCacheFileName(e){return e===To.Gzip?wo.Gzip:wo.Zstd}function getGnuTarPathOnWindows(){return __awaiter$10(this,void 0,void 0,function*(){return a.existsSync(ko)?ko:(yield getVersion(`tar`)).toLowerCase().includes(`gnu tar`)?which(`tar`):``})}function assertDefined(e,t){if(t===void 0)throw Error(`Expected ${e} but value was undefiend`);return t}function getCacheVersion(e,t,n=!1){let r=e.slice();return t&&r.push(t),process.platform===`win32`&&!n&&r.push(`windows-only`),r.push(`1.0`),i.createHash(`sha256`).update(r.join(`|`)).digest(`hex`)}function getRuntimeToken(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}var AbortError$1=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function log(e,...t){Te.stderr.write(`${T.format(e,...t)}${_e}`)}function getEnvironmentVariable(e){return Te.env[e]}typeof Te.versions.deno==`string`&&Te.versions.deno.length,typeof Te.versions.bun==`string`&&Te.versions.bun.length;const No=getEnvironmentVariable(`DEBUG`);let Po,Fo=[],Io=[];const Lo=[];No&&enable(No);const Ro=Object.assign(e=>createDebugger(e),{enable,enabled,disable,log});function enable(e){Po=e,Fo=[],Io=[];let t=e.split(`,`).map(e=>e.trim());for(let e of t)e.startsWith(`-`)?Io.push(e.substring(1)):Fo.push(e);for(let e of Lo)e.enabled=enabled(e.namespace)}function enabled(e){if(e.endsWith(`*`))return!0;for(let t of Io)if(namespaceMatches(e,t))return!1;for(let t of Fo)if(namespaceMatches(e,t))return!0;return!1}function namespaceMatches(e,t){if(t.indexOf(`*`)===-1)return e===t;let n=t;if(t.indexOf(`**`)!==-1){let e=[],r=``;for(let n of t)if(n===`*`&&r===`*`)continue;else r=n,e.push(n);n=e.join(``)}let r=0,i=0,a=n.length,o=e.length,s=-1,c=-1;for(;r=0){if(i=s+1,r=c+1,r===o)return!1;for(;e[r]!==n[i];)if(r++,r===o)return!1;c=r,r++,i++;continue}else return!1;let l=r===e.length,u=i===n.length,d=i===n.length-1&&n[i]===`*`;return l&&(u||d)}function disable(){let e=Po||``;return enable(``),e}function createDebugger(e){let t=Object.assign(debug,{enabled:enabled(e),destroy,log:Ro.log,namespace:e,extend});function debug(...n){t.enabled&&(n.length>0&&(n[0]=`${e} ${n[0]}`),t.log(...n))}return Lo.push(t),t}function destroy(){let e=Lo.indexOf(this);return e>=0&&(Lo.splice(e,1),!0)}function extend(e){let t=createDebugger(`${this.namespace}:${e}`);return t.log=this.log,t}const zo=[`verbose`,`info`,`warning`,`error`],Bo={verbose:400,info:300,warning:200,error:100};function patchLogMethod(e,t){t.log=(...t)=>{e.log(...t)}}function isTypeSpecRuntimeLogLevel(e){return zo.includes(e)}function createLoggerContext(e){let t=new Set,n=getEnvironmentVariable(e.logLevelEnvVarName),r,i=Ro(e.namespace);i.log=(...e)=>{Ro.log(...e)};function contextSetLogLevel(e){if(e&&!isTypeSpecRuntimeLogLevel(e))throw Error(`Unknown log level '${e}'. Acceptable values: ${zo.join(`,`)}`);r=e;let n=[];for(let e of t)shouldEnable(e)&&n.push(e.namespace);Ro.enable(n.join(`,`))}n&&(isTypeSpecRuntimeLogLevel(n)?contextSetLogLevel(n):console.error(`${e.logLevelEnvVarName} set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${zo.join(`, `)}.`));function shouldEnable(e){return!!(r&&Bo[e.level]<=Bo[r])}function createLogger(e,n){let r=Object.assign(e.extend(n),{level:n});if(patchLogMethod(e,r),shouldEnable(r)){let e=Ro.disable();Ro.enable(e+`,`+r.namespace)}return t.add(r),r}function contextGetLogLevel(){return r}function contextCreateClientLogger(e){let t=i.extend(e);return patchLogMethod(i,t),{error:createLogger(t,`error`),warning:createLogger(t,`warning`),info:createLogger(t,`info`),verbose:createLogger(t,`verbose`)}}return{setLogLevel:contextSetLogLevel,getLogLevel:contextGetLogLevel,createClientLogger:contextCreateClientLogger,logger:i}}const Vo=createLoggerContext({logLevelEnvVarName:`TYPESPEC_RUNTIME_LOG_LEVEL`,namespace:`typeSpecRuntime`});Vo.logger;function createClientLogger$1(e){return Vo.createClientLogger(e)}function normalizeName(e){return e.toLowerCase()}function normalizeValue(e){return String(e).trim().replace(/[\r\n]/g,``)}function*headerIterator(e){for(let t of e.values())yield[t.name,t.value]}var HttpHeadersImpl=class{_headersMap;constructor(e){if(this._headersMap=new Map,e)for(let t of Object.keys(e))this.set(t,e[t])}set(e,t){this._headersMap.set(normalizeName(e),{name:e,value:normalizeValue(t)})}get(e){return this._headersMap.get(normalizeName(e))?.value}has(e){return this._headersMap.has(normalizeName(e))}delete(e){this._headersMap.delete(normalizeName(e))}toJSON(e={}){let t={};if(e.preserveCase)for(let e of this._headersMap.values())t[e.name]=e.value;else for(let[e,n]of this._headersMap)t[e]=n.value;return t}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return headerIterator(this._headersMap)}};function createHttpHeaders$1(e){return new HttpHeadersImpl(e)}function randomUUID$2(){return globalThis.crypto.randomUUID()}var PipelineRequestImpl=class{url;method;headers;timeout;withCredentials;body;multipartBody;formData;streamResponseStatusCodes;enableBrowserStreams;proxySettings;disableKeepAlive;abortSignal;requestId;allowInsecureConnection;onUploadProgress;onDownloadProgress;requestOverrides;authSchemes;constructor(e){this.url=e.url,this.body=e.body,this.headers=e.headers??createHttpHeaders$1(),this.method=e.method??`GET`,this.timeout=e.timeout??0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=e.disableKeepAlive??!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=e.withCredentials??!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||randomUUID$2(),this.allowInsecureConnection=e.allowInsecureConnection??!1,this.enableBrowserStreams=e.enableBrowserStreams??!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function createPipelineRequest$1(e){return new PipelineRequestImpl(e)}const Ho=new Set([`Deserialize`,`Serialize`,`Retry`,`Sign`]);var Uo=class HttpPipeline{_policies=[];_orderedPolicies;constructor(e){this._policies=e?.slice(0)??[],this._orderedPolicies=void 0}addPolicy(e,t={}){if(t.phase&&t.afterPhase)throw Error(`Policies inside a phase cannot specify afterPhase.`);if(t.phase&&!Ho.has(t.phase))throw Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!Ho.has(t.afterPhase))throw Error(`Invalid afterPhase name: ${t.afterPhase}`);this._policies.push({policy:e,options:t}),this._orderedPolicies=void 0}removePolicy(e){let t=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(t.push(n.policy),!1):!0),this._orderedPolicies=void 0,t}sendRequest(e,t){return this.getOrderedPolicies().reduceRight((e,t)=>n=>t.sendRequest(n,e),t=>e.sendRequest(t))(t)}getOrderedPolicies(){return this._orderedPolicies||=this.orderPolicies(),this._orderedPolicies}clone(){return new HttpPipeline(this._policies)}static create(){return new HttpPipeline}orderPolicies(){let e=[],t=new Map;function createPhase(e){return{name:e,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}let n=createPhase(`Serialize`),r=createPhase(`None`),i=createPhase(`Deserialize`),a=createPhase(`Retry`),o=createPhase(`Sign`),s=[n,r,i,a,o];function getPhase(e){return e===`Retry`?a:e===`Serialize`?n:e===`Deserialize`?i:e===`Sign`?o:r}for(let e of this._policies){let n=e.policy,r=e.options,i=n.name;if(t.has(i))throw Error(`Duplicate policy names not allowed in pipeline`);let a={policy:n,dependsOn:new Set,dependants:new Set};r.afterPhase&&(a.afterPhase=getPhase(r.afterPhase),a.afterPhase.hasAfterPolicies=!0),t.set(i,a),getPhase(r.phase).policies.add(a)}for(let e of this._policies){let{policy:n,options:r}=e,i=n.name,a=t.get(i);if(!a)throw Error(`Missing node for policy ${i}`);if(r.afterPolicies)for(let e of r.afterPolicies){let n=t.get(e);n&&(a.dependsOn.add(n),n.dependants.add(a))}if(r.beforePolicies)for(let e of r.beforePolicies){let n=t.get(e);n&&(n.dependsOn.add(a),a.dependants.add(n))}}function walkPhase(n){n.hasRun=!0;for(let r of n.policies)if(!(r.afterPhase&&(!r.afterPhase.hasRun||r.afterPhase.policies.size))&&r.dependsOn.size===0){e.push(r.policy);for(let e of r.dependants)e.dependsOn.delete(r);t.delete(r.policy.name),n.policies.delete(r)}}function walkPhases(){for(let e of s){if(walkPhase(e),e.policies.size>0&&e!==r){r.hasRun||walkPhase(r);return}e.hasAfterPolicies&&walkPhase(r)}}let c=0;for(;t.size>0;){c++;let t=e.length;if(walkPhases(),e.length<=t&&c>1)throw Error(`Cannot satisfy policy dependencies due to requirements cycle.`)}return e}};function createEmptyPipeline$1(){return Uo.create()}function isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function isError$1(e){if(isObject(e)){let t=typeof e.name==`string`,n=typeof e.message==`string`;return t&&n}return!1}const Wo=E.custom,Go=`REDACTED`,Ko=`x-ms-client-request-id.x-ms-return-client-request-id.x-ms-useragent.x-ms-correlation-request-id.x-ms-request-id.client-request-id.ms-cv.return-client-request-id.traceparent.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Origin.Accept.Accept-Encoding.Cache-Control.Connection.Content-Length.Content-Type.Date.ETag.Expires.If-Match.If-Modified-Since.If-None-Match.If-Unmodified-Since.Last-Modified.Pragma.Request-Id.Retry-After.Server.Transfer-Encoding.User-Agent.WWW-Authenticate`.split(`.`),qo=[`api-version`];var Sanitizer=class{allowedHeaderNames;allowedQueryParameters;constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=Ko.concat(e),t=qo.concat(t),this.allowedHeaderNames=new Set(e.map(e=>e.toLowerCase())),this.allowedQueryParameters=new Set(t.map(e=>e.toLowerCase()))}sanitize(e){let t=new Set;return JSON.stringify(e,(e,n)=>{if(n instanceof Error)return{...n,name:n.name,message:n.message};if(e===`headers`&&isObject(n))return this.sanitizeHeaders(n);if(e===`url`&&typeof n==`string`)return this.sanitizeUrl(n);if(e===`query`&&isObject(n))return this.sanitizeQuery(n);if(e!==`body`&&e!==`response`&&e!==`operationSpec`){if(Array.isArray(n)||isObject(n)){if(t.has(n))return`[Circular]`;t.add(n)}return n}},2)}sanitizeUrl(e){if(typeof e!=`string`||e===null||e===``)return e;let t=new URL(e);if(!t.search)return e;for(let[e]of t.searchParams)this.allowedQueryParameters.has(e.toLowerCase())||t.searchParams.set(e,Go);return t.toString()}sanitizeHeaders(e){let t={};for(let n of Object.keys(e))t[n]=this.allowedHeaderNames.has(n.toLowerCase())?e[n]:Go;return t}sanitizeQuery(e){if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))t[n]=this.allowedQueryParameters.has(n.toLowerCase())?e[n]:Go;return t}};const Jo=new Sanitizer;var Yo=class RestError$1 extends Error{static REQUEST_SEND_ERROR=`REQUEST_SEND_ERROR`;static PARSE_ERROR=`PARSE_ERROR`;code;statusCode;request;response;details;constructor(e,t={}){super(e),this.name=`RestError`,this.code=t.code,this.statusCode=t.statusCode,Object.defineProperty(this,"request",{value:t.request,enumerable:!1}),Object.defineProperty(this,"response",{value:t.response,enumerable:!1});let n=this.request?.agent?{maxFreeSockets:this.request.agent.maxFreeSockets,maxSockets:this.request.agent.maxSockets}:void 0;Object.defineProperty(this,Wo,{value:()=>`RestError: ${this.message} \n ${Jo.sanitize({...this,request:{...this.request,agent:n},response:this.response})}`,enumerable:!1}),Object.setPrototypeOf(this,RestError$1.prototype)}};function isRestError$1(e){return e instanceof Yo||isError$1(e)&&e.name===`RestError`}function uint8ArrayToString$1(e,t){return Buffer.from(e).toString(t)}function stringToUint8Array$1(e,t){return Buffer.from(e,t)}const Xo=createClientLogger$1(`ts-http-runtime`),Zo={};function isReadableStream(e){return e&&typeof e.pipe==`function`}function isStreamComplete(e){return e.readable===!1?Promise.resolve():new Promise(t=>{let handler=()=>{t(),e.removeListener(`close`,handler),e.removeListener(`end`,handler),e.removeListener(`error`,handler)};e.on(`close`,handler),e.on(`end`,handler),e.on(`error`,handler)})}function isArrayBuffer(e){return e&&typeof e.byteLength==`number`}var ReportTransform=class extends C{loadedBytes=0;progressCallback;_transform(e,t,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(e){n(e)}}constructor(e){super(),this.progressCallback=e}},NodeHttpClient=class{cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let t=new AbortController,abortListener;if(e.abortSignal){if(e.abortSignal.aborted)throw new AbortError$1(`The operation was aborted. Request has already been canceled.`);abortListener=e=>{e.type===`abort`&&t.abort()},e.abortSignal.addEventListener(`abort`,abortListener)}let n;e.timeout>0&&(n=setTimeout(()=>{let n=new Sanitizer;Xo.info(`request to '${n.sanitizeUrl(e.url)}' timed out. canceling...`),t.abort()},e.timeout));let r=e.headers.get(`Accept-Encoding`),i=r?.includes(`gzip`)||r?.includes(`deflate`),a=typeof e.body==`function`?e.body():e.body;if(a&&!e.headers.has(`Content-Length`)){let t=getBodyLength(a);t!==null&&e.headers.set(`Content-Length`,t)}let o;try{if(a&&e.onUploadProgress){let t=e.onUploadProgress,n=new ReportTransform(t);n.on(`error`,e=>{Xo.error(`Error in upload progress`,e)}),isReadableStream(a)?a.pipe(n):n.end(a),a=n}let r=await this.makeRequest(e,t,a);n!==void 0&&clearTimeout(n);let s=getResponseHeaders(r),c={status:r.statusCode??0,headers:s,request:e};if(e.method===`HEAD`)return r.resume(),c;o=i?getDecodedResponseStream(r,s):r;let l=e.onDownloadProgress;if(l){let e=new ReportTransform(l);e.on(`error`,e=>{Xo.error(`Error in download progress`,e)}),o.pipe(e),o=e}return e.streamResponseStatusCodes?.has(1/0)||e.streamResponseStatusCodes?.has(c.status)?c.readableStreamBody=o:c.bodyAsText=await streamToText(o),c}finally{if(e.abortSignal&&abortListener){let t=Promise.resolve();isReadableStream(a)&&(t=isStreamComplete(a));let n=Promise.resolve();isReadableStream(o)&&(n=isStreamComplete(o)),Promise.all([t,n]).then(()=>{abortListener&&e.abortSignal?.removeEventListener(`abort`,abortListener)}).catch(e=>{Xo.warning(`Error when cleaning up abortListener on httpRequest`,e)})}}}makeRequest(e,t,n){let r=new URL(e.url),i=r.protocol!==`https:`;if(i&&!e.allowInsecureConnection)throw Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let a={agent:e.agent??this.getOrCreateAgent(e,i),hostname:r.hostname,path:`${r.pathname}${r.search}`,port:r.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0}),...e.requestOverrides};return new Promise((r,o)=>{let s=i?b.request(a,r):Ee.request(a,r);s.once(`error`,t=>{o(new Yo(t.message,{code:t.code??Yo.REQUEST_SEND_ERROR,request:e}))}),t.signal.addEventListener(`abort`,()=>{let e=new AbortError$1(`The operation was aborted. Rejecting from abort signal callback while making request.`);s.destroy(e),o(e)}),n&&isReadableStream(n)?n.pipe(s):n?typeof n==`string`||Buffer.isBuffer(n)?s.end(n):isArrayBuffer(n)?s.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n)):(Xo.error(`Unrecognized body type`,n),o(new Yo(`Unrecognized body type`))):s.end()})}getOrCreateAgent(e,t){let n=e.disableKeepAlive;if(t)return n?b.globalAgent:(this.cachedHttpAgent||=new b.Agent({keepAlive:!0}),this.cachedHttpAgent);{if(n&&!e.tlsSettings)return Ee.globalAgent;let t=e.tlsSettings??Zo,r=this.cachedHttpsAgents.get(t);return r&&r.options.keepAlive===!n?r:(Xo.info(`No cached TLS Agent exist, creating a new Agent`),r=new Ee.Agent({keepAlive:!n,...t}),this.cachedHttpsAgents.set(t,r),r)}}};function getResponseHeaders(e){let t=createHttpHeaders$1();for(let n of Object.keys(e.headers)){let r=e.headers[n];Array.isArray(r)?r.length>0&&t.set(n,r[0]):r&&t.set(n,r)}return t}function getDecodedResponseStream(e,t){let n=t.get(`Content-Encoding`);if(n===`gzip`){let t=D.createGunzip();return e.pipe(t),t}if(n===`deflate`){let t=D.createInflate();return e.pipe(t),t}return e}function streamToText(e){return new Promise((t,n)=>{let r=[];e.on(`data`,e=>{Buffer.isBuffer(e)?r.push(e):r.push(Buffer.from(e))}),e.on(`end`,()=>{t(Buffer.concat(r).toString(`utf8`))}),e.on(`error`,e=>{e&&e?.name===`AbortError`?n(e):n(new Yo(`Error reading response as text: ${e.message}`,{code:Yo.PARSE_ERROR}))})})}function getBodyLength(e){return e?Buffer.isBuffer(e)?e.length:isReadableStream(e)?null:isArrayBuffer(e)?e.byteLength:typeof e==`string`?Buffer.from(e).length:null:0}function createNodeHttpClient(){return new NodeHttpClient}function createDefaultHttpClient$1(){return createNodeHttpClient()}function logPolicy$1(e={}){let t=e.logger??Xo.info,n=new Sanitizer({additionalAllowedHeaderNames:e.additionalAllowedHeaderNames,additionalAllowedQueryParameters:e.additionalAllowedQueryParameters});return{name:`logPolicy`,async sendRequest(e,r){if(!t.enabled)return r(e);t(`Request: ${n.sanitize(e)}`);let i=await r(e);return t(`Response status code: ${i.status}`),t(`Headers: ${n.sanitize({headers:i.headers})}`),i}}}function getRandomIntegerInclusive(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function calculateRetryDelay(e,t){let n=t.retryDelayInMs*2**e,r=Math.min(t.maxRetryDelayInMs,n);return{retryAfterInMs:r/2+getRandomIntegerInclusive(0,r/2)}}function delay$2(e,t,n){return new Promise((r,i)=>{let a,onAborted,rejectOnAbort=()=>i(new AbortError$1(n?.abortErrorMsg?n?.abortErrorMsg:`The operation was aborted.`)),removeListeners=()=>{n?.abortSignal&&onAborted&&n.abortSignal.removeEventListener(`abort`,onAborted)};if(onAborted=()=>(a&&clearTimeout(a),removeListeners(),rejectOnAbort()),n?.abortSignal&&n.abortSignal.aborted)return rejectOnAbort();a=setTimeout(()=>{removeListeners(),r(t)},e),n?.abortSignal&&n.abortSignal.addEventListener(`abort`,onAborted)})}function parseHeaderValueAsNumber(e,t){let n=e.headers.get(t);if(!n)return;let r=Number(n);if(!Number.isNaN(r))return r}const Qo=`Retry-After`,$o=[`retry-after-ms`,`x-ms-retry-after-ms`,Qo];function getRetryAfterInMs(e){if(e&&[429,503].includes(e.status))try{for(let t of $o){let n=parseHeaderValueAsNumber(e,t);if(n===0||n)return n*(t===Qo?1e3:1)}let t=e.headers.get(Qo);if(!t)return;let n=Date.parse(t)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}function isThrottlingRetryResponse(e){return Number.isFinite(getRetryAfterInMs(e))}function throttlingRetryStrategy(){return{name:`throttlingRetryStrategy`,retry({response:e}){let t=getRetryAfterInMs(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}}}function exponentialRetryStrategy(e={}){let t=e.retryDelayInMs??1e3,n=e.maxRetryDelayInMs??64e3;return{name:`exponentialRetryStrategy`,retry({retryCount:r,response:i,responseError:a}){let o=isSystemError(a),s=o&&e.ignoreSystemErrors,c=isExponentialRetryResponse(i),l=c&&e.ignoreHttpStatusCodes;return i&&(isThrottlingRetryResponse(i)||!c)||l||s?{skipStrategy:!0}:a&&!o&&!c?{errorToThrow:a}:calculateRetryDelay(r,{retryDelayInMs:t,maxRetryDelayInMs:n})}}}function isExponentialRetryResponse(e){return!!(e&&e.status!==void 0&&(e.status>=500||e.status===408)&&e.status!==501&&e.status!==505)}function isSystemError(e){return e?e.code===`ETIMEDOUT`||e.code===`ESOCKETTIMEDOUT`||e.code===`ECONNREFUSED`||e.code===`ECONNRESET`||e.code===`ENOENT`||e.code===`ENOTFOUND`:!1}const es=createClientLogger$1(`ts-http-runtime retryPolicy`);function retryPolicy(e,t={maxRetries:3}){let n=t.logger||es;return{name:`retryPolicy`,async sendRequest(r,i){let a,o,s=-1;retryRequest:for(;;){s+=1,a=void 0,o=void 0;try{n.info(`Retry ${s}: Attempting to send request`,r.requestId),a=await i(r),n.info(`Retry ${s}: Received a response from request`,r.requestId)}catch(e){if(n.error(`Retry ${s}: Received an error from request`,r.requestId),!isRestError$1(e))throw e;o=e,a=e.response}if(r.abortSignal?.aborted)throw n.error(`Retry ${s}: Request aborted.`),new AbortError$1;if(s>=(t.maxRetries??3)){if(n.info(`Retry ${s}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),o)throw o;if(a)return a;throw Error(`Maximum retries reached with no response or error to throw`)}n.info(`Retry ${s}: Processing ${e.length} retry strategies.`);strategiesLoop:for(let t of e){let e=t.logger||n;e.info(`Retry ${s}: Processing retry strategy ${t.name}.`);let i=t.retry({retryCount:s,response:a,responseError:o});if(i.skipStrategy){e.info(`Retry ${s}: Skipped.`);continue strategiesLoop}let{errorToThrow:c,retryAfterInMs:l,redirectTo:u}=i;if(c)throw e.error(`Retry ${s}: Retry strategy ${t.name} throws error:`,c),c;if(l||l===0){e.info(`Retry ${s}: Retry strategy ${t.name} retries after ${l}`),await delay$2(l,void 0,{abortSignal:r.abortSignal});continue retryRequest}if(u){e.info(`Retry ${s}: Retry strategy ${t.name} redirects to ${u}`),r.url=u;continue retryRequest}}if(o)throw n.info(`None of the retry strategies could work with the received error. Throwing it.`),o;if(a)return n.info(`None of the retry strategies could work with the received response. Returning it.`),a}}}}function defaultRetryPolicy$1(e={}){return{name:`defaultRetryPolicy`,sendRequest:retryPolicy([throttlingRetryStrategy(),exponentialRetryStrategy(e)],{maxRetries:e.maxRetries??3}).sendRequest}}function convertBodyToFormDataMap(e){if(typeof FormData<`u`&&e instanceof FormData){let t={};for(let[n,r]of e.entries()){let e=t[n];Array.isArray(e)?e.push(r):t[n]=e===void 0?[r]:[e,r]}return t}}function formDataPolicy$1(){return{name:`formDataPolicy`,async sendRequest(e,t){let n=convertBodyToFormDataMap(e.body);if(n&&(e.formData=n,e.body=void 0),e.formData){let t=e.headers.get(`Content-Type`);t&&t.indexOf(`application/x-www-form-urlencoded`)!==-1?e.body=wwwFormUrlEncode(e.formData):await prepareFormData(e.formData,e),e.formData=void 0}return t(e)}}}function wwwFormUrlEncode(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e.toString());else t.append(n,r.toString());return t.toString()}async function prepareFormData(e,t){let n=t.headers.get(`Content-Type`);if(n&&!n.startsWith(`multipart/form-data`))return;t.headers.set(`Content-Type`,n??`multipart/form-data`);let r=[];for(let[t,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])if(typeof e==`string`)r.push({headers:createHttpHeaders$1({"Content-Disposition":`form-data; name="${t}"`}),body:stringToUint8Array$1(e,`utf-8`)});else if(typeof e!=`object`||!e)throw Error(`Unexpected value for key ${t}: ${e}. Value should be serialized to string first.`);else{let n=e.name||`blob`,i=createHttpHeaders$1();i.set(`Content-Disposition`,`form-data; name="${t}"; filename="${n}"`),i.set(`Content-Type`,e.type||`application/octet-stream`),r.push({headers:i,body:e})}t.multipartBody={parts:r}}function agentPolicy$1(e){return{name:`agentPolicy`,sendRequest:async(t,n)=>(t.agent||=e,n(t))}}function tlsPolicy$1(e){return{name:`tlsPolicy`,sendRequest:async(t,n)=>(t.tlsSettings||=e,n(t))}}var ts=__commonJSMin(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return parse(e);if(n===`number`&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function parse(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function fmtLong(e){var t=Math.abs(e);return t>=a?plural(e,t,a,`day`):t>=i?plural(e,t,i,`hour`):t>=r?plural(e,t,r,`minute`):t>=n?plural(e,t,n,`second`):e+` ms`}function plural(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),ns=__commonJSMin(((e,t)=>{function setup(e){createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=ts(),createDebug.destroy=destroy,Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n{if(t===`%%`)return`%`;i++;let a=createDebug.formatters[r];if(typeof a==`function`){let r=e[i];t=a.call(n,r),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(n,e),(n.log||createDebug.log).apply(n,e)}return debug.namespace=e,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(e),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>n===null?(r!==createDebug.namespaces&&(r=createDebug.namespaces,i=createDebug.enabled(e)),i):n,set:e=>{n=e}}),typeof createDebug.init==`function`&&createDebug.init(debug),debug}function extend(e,t){let n=createDebug(this.namespace+(t===void 0?`:`:t)+e);return n.log=this.log,n}function enable(e){createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?createDebug.skips.push(e.slice(1)):createDebug.names.push(e)}function matchesTemplate(e,t){let n=0,r=0,i=-1,a=0;for(;n`-`+e)].join(`,`);return createDebug.enable(``),e}function enabled(e){for(let t of createDebug.skips)if(matchesTemplate(e,t))return!1;for(let t of createDebug.names)if(matchesTemplate(e,t))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return createDebug.enable(createDebug.load()),createDebug}t.exports=setup})),rs=__commonJSMin(((e,t)=>{e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.storage=localstorage(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function useColors(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function save(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function load(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function localstorage(){try{return localStorage}catch{}}t.exports=ns()(e);let{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),as=__commonJSMin(((e,t)=>{let n=R(`tty`),r=R(`util`);e.init=init,e.log=log,e.formatArgs=formatArgs,e.save=save,e.load=load,e.useColors=useColors,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=R(`supports-color`);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function useColors(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function formatArgs(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(` `).join(` `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=getDate()+n+` `+e[0]}function getDate(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function log(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+` -`)}function save(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function load(){return process.env.DEBUG}function init(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;re.trim()).join(` `)},i.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),Jo=__commonJSMin(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?Ko():qo()})),Yo=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.json=e.toBuffer=void 0;let i=r(R(`http`)),a=r(R(`https`));async function toBuffer(e){let t=0,n=[];for await(let r of e)t+=r.length,n.push(r);return Buffer.concat(n,t)}e.toBuffer=toBuffer;async function json(e){let t=(await toBuffer(e)).toString(`utf8`);try{return JSON.parse(t)}catch(e){let n=e;throw n.message+=` (input: ${t})`,n}}e.json=json;function req(e,t={}){let n=((typeof e==`string`?e:e.href).startsWith(`https:`)?a:i).request(e,t),r=new Promise((e,t)=>{n.once(`response`,e).once(`error`,t).end()});return n.then=r.then.bind(r),n}e.req=req})),Xo=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;let a=r(R(`net`)),o=r(R(`http`)),s=R(`https`);i(Yo(),e);let c=Symbol(`AgentBaseInternalState`);e.Agent=class extends o.Agent{constructor(e){super(e),this[c]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`&&t.split(` -`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new a.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],r=n.indexOf(t);r!==-1&&(n.splice(r,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)},i=this.getName(r),a=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,r)).then(s=>{if(this.decrementSockets(i,a),s instanceof o.Agent)try{return s.addRequest(e,r)}catch(e){return n(e)}this[c].currentSocket=s,super.createSocket(e,t,n)},e=>{this.decrementSockets(i,a),n(e)})}createConnection(){let e=this[c].currentSocket;if(this[c].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[c].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[c]&&(this[c].defaultPort=e)}get protocol(){return this[c].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[c]&&(this[c].protocol=e)}}})),Zo=__commonJSMin((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseProxyResponse=void 0;let n=(0,t(Jo()).default)(`https-proxy-agent:parse-proxy-response`);function parseProxyResponse(e){return new Promise((t,r)=>{let i=0,a=[];function read(){let t=e.read();t?ondata(t):e.once(`readable`,read)}function cleanup(){e.removeListener(`end`,onend),e.removeListener(`error`,onerror),e.removeListener(`readable`,read)}function onend(){cleanup(),n(`onend`),r(Error(`Proxy connection ended before receiving CONNECT response`))}function onerror(e){cleanup(),n(`onerror %o`,e),r(e)}function ondata(o){a.push(o),i+=o.length;let s=Buffer.concat(a,i),c=s.indexOf(`\r +`)}function save(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function load(){return process.env.DEBUG}function init(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;re.trim()).join(` `)},i.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),os=__commonJSMin(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?rs():as()})),ss=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.json=e.toBuffer=void 0;let i=r(R(`http`)),a=r(R(`https`));async function toBuffer(e){let t=0,n=[];for await(let r of e)t+=r.length,n.push(r);return Buffer.concat(n,t)}e.toBuffer=toBuffer;async function json(e){let t=(await toBuffer(e)).toString(`utf8`);try{return JSON.parse(t)}catch(e){let n=e;throw n.message+=` (input: ${t})`,n}}e.json=json;function req(e,t={}){let n=((typeof e==`string`?e:e.href).startsWith(`https:`)?a:i).request(e,t),r=new Promise((e,t)=>{n.once(`response`,e).once(`error`,t).end()});return n.then=r.then.bind(r),n}e.req=req})),cs=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;let a=r(R(`net`)),o=r(R(`http`)),s=R(`https`);i(ss(),e);let c=Symbol(`AgentBaseInternalState`);e.Agent=class extends o.Agent{constructor(e){super(e),this[c]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`&&t.split(` +`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new a.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],r=n.indexOf(t);r!==-1&&(n.splice(r,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)},i=this.getName(r),a=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,r)).then(s=>{if(this.decrementSockets(i,a),s instanceof o.Agent)try{return s.addRequest(e,r)}catch(e){return n(e)}this[c].currentSocket=s,super.createSocket(e,t,n)},e=>{this.decrementSockets(i,a),n(e)})}createConnection(){let e=this[c].currentSocket;if(this[c].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[c].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[c]&&(this[c].defaultPort=e)}get protocol(){return this[c].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[c]&&(this[c].protocol=e)}}})),ls=__commonJSMin((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseProxyResponse=void 0;let n=(0,t(os()).default)(`https-proxy-agent:parse-proxy-response`);function parseProxyResponse(e){return new Promise((t,r)=>{let i=0,a=[];function read(){let t=e.read();t?ondata(t):e.once(`readable`,read)}function cleanup(){e.removeListener(`end`,onend),e.removeListener(`error`,onerror),e.removeListener(`readable`,read)}function onend(){cleanup(),n(`onend`),r(Error(`Proxy connection ended before receiving CONNECT response`))}function onerror(e){cleanup(),n(`onerror %o`,e),r(e)}function ondata(o){a.push(o),i+=o.length;let s=Buffer.concat(a,i),c=s.indexOf(`\r \r `);if(c===-1){n(`have not received end of HTTP headers yet...`),read();return}let l=s.slice(0,c).toString(`ascii`).split(`\r -`),u=l.shift();if(!u)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let d=u.split(` `),f=+d[1],p=d.slice(2).join(` `),h={};for(let t of l){if(!t)continue;let n=t.indexOf(`:`);if(n===-1)return e.destroy(),r(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}n(`got proxy server response: %o %o`,u,h),cleanup(),t({connect:{statusCode:f,statusText:p,headers:h},buffered:s})}e.on(`error`,onerror),e.on(`end`,onend),read()})}e.parseProxyResponse=parseProxyResponse})),Qo=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpsProxyAgent=void 0;let a=r(R(`net`)),o=r(R(`tls`)),s=i(R(`assert`)),c=i(Jo()),l=Xo(),u=R(`url`),d=Zo(),f=(0,c.default)(`https-proxy-agent`),setServernameFromNonIpHost=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e;var HttpsProxyAgent=class extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},f(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?omit(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;n.protocol===`https:`?(f("Creating `tls.Socket`: %o",this.connectOpts),r=o.connect(setServernameFromNonIpHost(this.connectOpts))):(f("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts));let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},c=a.isIPv6(t.host)?`[${t.host}]`:t.host,l=`CONNECT ${c}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${c}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))l+=`${e}: ${i[e]}\r\n`;let u=(0,d.parseProxyResponse)(r);r.write(`${l}\r\n`);let{connect:p,buffered:h}=await u;if(e.emit(`proxyConnect`,p),this.emit(`proxyConnect`,p,e),p.statusCode===200)return e.once(`socket`,resume),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...omit(setServernameFromNonIpHost(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let g=new a.Socket({writable:!1});return g.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(h),e.push(null)}),g}};HttpsProxyAgent.protocols=[`http`,`https`],e.HttpsProxyAgent=HttpsProxyAgent;function resume(e){e.resume()}function omit(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),$o=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpProxyAgent=void 0;let a=r(R(`net`)),o=r(R(`tls`)),s=i(Jo()),c=R(`events`),l=Xo(),u=R(`url`),d=(0,s.default)(`http-proxy-agent`);var HttpProxyAgent=class extends l.Agent{constructor(e,t){super(t),this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},d(`Creating new HttpProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={...t?omit(t,`headers`):null,host:n,port:r}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:n}=this,r=`${t.secureEndpoint?`https:`:`http:`}//${e.getHeader(`host`)||`localhost`}`,i=new u.URL(e.path,r);t.port!==80&&(i.port=String(t.port)),e.path=String(i);let a=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;a[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}a[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let t of Object.keys(a)){let n=a[t];n&&e.setHeader(t,n)}}async connect(e,t){e._header=null,e.path.includes(`://`)||this.setRequestProps(e,t);let n,r;d(`Regenerating stored HTTP header string for request`),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(d(`Patching connection write() output buffer with updated header`),n=e.outputData[0].data,r=n.indexOf(`\r +`),u=l.shift();if(!u)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let d=u.split(` `),f=+d[1],p=d.slice(2).join(` `),h={};for(let t of l){if(!t)continue;let n=t.indexOf(`:`);if(n===-1)return e.destroy(),r(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}n(`got proxy server response: %o %o`,u,h),cleanup(),t({connect:{statusCode:f,statusText:p,headers:h},buffered:s})}e.on(`error`,onerror),e.on(`end`,onend),read()})}e.parseProxyResponse=parseProxyResponse})),us=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpsProxyAgent=void 0;let a=r(R(`net`)),o=r(R(`tls`)),s=i(R(`assert`)),c=i(os()),l=cs(),u=R(`url`),d=ls(),f=(0,c.default)(`https-proxy-agent`),setServernameFromNonIpHost=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e;var HttpsProxyAgent=class extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},f(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?omit(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;n.protocol===`https:`?(f("Creating `tls.Socket`: %o",this.connectOpts),r=o.connect(setServernameFromNonIpHost(this.connectOpts))):(f("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts));let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},c=a.isIPv6(t.host)?`[${t.host}]`:t.host,l=`CONNECT ${c}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${c}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))l+=`${e}: ${i[e]}\r\n`;let u=(0,d.parseProxyResponse)(r);r.write(`${l}\r\n`);let{connect:p,buffered:h}=await u;if(e.emit(`proxyConnect`,p),this.emit(`proxyConnect`,p,e),p.statusCode===200)return e.once(`socket`,resume),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...omit(setServernameFromNonIpHost(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let g=new a.Socket({writable:!1});return g.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(h),e.push(null)}),g}};HttpsProxyAgent.protocols=[`http`,`https`],e.HttpsProxyAgent=HttpsProxyAgent;function resume(e){e.resume()}function omit(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),ds=__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpProxyAgent=void 0;let a=r(R(`net`)),o=r(R(`tls`)),s=i(os()),c=R(`events`),l=cs(),u=R(`url`),d=(0,s.default)(`http-proxy-agent`);var HttpProxyAgent=class extends l.Agent{constructor(e,t){super(t),this.proxy=typeof e==`string`?new u.URL(e):e,this.proxyHeaders=t?.headers??{},d(`Creating new HttpProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={...t?omit(t,`headers`):null,host:n,port:r}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:n}=this,r=`${t.secureEndpoint?`https:`:`http:`}//${e.getHeader(`host`)||`localhost`}`,i=new u.URL(e.path,r);t.port!==80&&(i.port=String(t.port)),e.path=String(i);let a=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;a[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}a[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let t of Object.keys(a)){let n=a[t];n&&e.setHeader(t,n)}}async connect(e,t){e._header=null,e.path.includes(`://`)||this.setRequestProps(e,t);let n,r;d(`Regenerating stored HTTP header string for request`),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(d(`Patching connection write() output buffer with updated header`),n=e.outputData[0].data,r=n.indexOf(`\r \r -`)+4,e.outputData[0].data=e._header+n.substring(r),d(`Output buffer: %o`,e.outputData[0].data));let i;return this.proxy.protocol===`https:`?(d("Creating `tls.Socket`: %o",this.connectOpts),i=o.connect(this.connectOpts)):(d("Creating `net.Socket`: %o",this.connectOpts),i=a.connect(this.connectOpts)),await(0,c.once)(i,`connect`),i}};HttpProxyAgent.protocols=[`http`,`https`],e.HttpProxyAgent=HttpProxyAgent;function omit(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),es=Qo(),ts=$o();const ns=[];let rs=!1;const as=new Map;function getEnvironmentValue(e){if(process.env[e])return process.env[e];if(process.env[e.toLowerCase()])return process.env[e.toLowerCase()]}function loadEnvironmentProxyValue(){if(!process)return;let e=getEnvironmentValue(`HTTPS_PROXY`),t=getEnvironmentValue(`ALL_PROXY`),n=getEnvironmentValue(`HTTP_PROXY`);return e||t||n}function isBypassed(e,t,n){if(t.length===0)return!1;let r=new URL(e).hostname;if(n?.has(r))return n.get(r);let i=!1;for(let e of t)e[0]===`.`?(r.endsWith(e)||r.length===e.length-1&&r===e.slice(1))&&(i=!0):r===e&&(i=!0);return n?.set(r,i),i}function loadNoProxy(){let e=getEnvironmentValue(`NO_PROXY`);return rs=!0,e?e.split(`,`).map(e=>e.trim()).filter(e=>e.length):[]}function getDefaultProxySettings$1(e){if(!e&&(e=loadEnvironmentProxyValue(),!e))return;let t=new URL(e);return{host:(t.protocol?t.protocol+`//`:``)+t.hostname,port:Number.parseInt(t.port||`80`),username:t.username,password:t.password}}function getDefaultProxySettingsInternal(){let e=loadEnvironmentProxyValue();return e?new URL(e):void 0}function getUrlFromProxySettings(e){let t;try{t=new URL(e.host)}catch{throw Error(`Expecting a valid host string in proxy settings, but found "${e.host}".`)}return t.port=String(e.port),e.username&&(t.username=e.username),e.password&&(t.password=e.password),t}function setProxyAgentOnRequest(e,t,n){if(e.agent)return;let r=new URL(e.url).protocol!==`https:`;e.tlsSettings&&zo.warning(`TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.`),r?(t.httpProxyAgent||=new ts.HttpProxyAgent(n),e.agent=t.httpProxyAgent):(t.httpsProxyAgent||=new es.HttpsProxyAgent(n),e.agent=t.httpsProxyAgent)}function proxyPolicy$1(e,t){rs||ns.push(...loadNoProxy());let n=e?getUrlFromProxySettings(e):getDefaultProxySettingsInternal(),r={};return{name:`proxyPolicy`,async sendRequest(e,i){return!e.proxySettings&&n&&!isBypassed(e.url,t?.customNoProxyList??ns,t?.customNoProxyList?void 0:as)?setProxyAgentOnRequest(e,r,n):e.proxySettings&&setProxyAgentOnRequest(e,r,getUrlFromProxySettings(e.proxySettings)),i(e)}}}function decompressResponsePolicy$1(){return{name:`decompressResponsePolicy`,async sendRequest(e,t){return e.method!==`HEAD`&&e.headers.set(`Accept-Encoding`,`gzip,deflate`),t(e)}}}const os=[`GET`,`HEAD`];function redirectPolicy$1(e={}){let{maxRetries:t=20,allowCrossOriginRedirects:n=!1}=e;return{name:`redirectPolicy`,async sendRequest(e,r){return handleRedirect(r,await r(e),t,n)}}}async function handleRedirect(e,t,n,r,i=0){let{request:a,status:o,headers:s}=t,c=s.get(`location`);if(c&&(o===300||o===301&&os.includes(a.method)||o===302&&os.includes(a.method)||o===303&&a.method===`POST`||o===307)&&itypeof e==`function`?e():e).map(toStream);return Ce.from((async function*(){for(let e of t)for await(let t of e)yield t})())}}function generateBoundary(){return`----AzSDKFormBoundary${randomUUID$2()}`}function encodeHeaders(e){let t=``;for(let[n,r]of e)t+=`${n}: ${r}\r\n`;return t}function getLength(e){if(e instanceof Uint8Array)return e.byteLength;if(isBlob(e))return e.size===-1?void 0:e.size}function getTotalLength(e){let t=0;for(let n of e){let e=getLength(n);if(e===void 0)return;t+=e}return t}async function buildRequestBody(e,t,n){let r=[stringToUint8Array$1(`--${n}`,`utf-8`),...t.flatMap(e=>[stringToUint8Array$1(`\r +`)+4,e.outputData[0].data=e._header+n.substring(r),d(`Output buffer: %o`,e.outputData[0].data));let i;return this.proxy.protocol===`https:`?(d("Creating `tls.Socket`: %o",this.connectOpts),i=o.connect(this.connectOpts)):(d("Creating `net.Socket`: %o",this.connectOpts),i=a.connect(this.connectOpts)),await(0,c.once)(i,`connect`),i}};HttpProxyAgent.protocols=[`http`,`https`],e.HttpProxyAgent=HttpProxyAgent;function omit(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),fs=us(),ps=ds();const ms=[];let hs=!1;const gs=new Map;function getEnvironmentValue(e){if(process.env[e])return process.env[e];if(process.env[e.toLowerCase()])return process.env[e.toLowerCase()]}function loadEnvironmentProxyValue(){if(!process)return;let e=getEnvironmentValue(`HTTPS_PROXY`),t=getEnvironmentValue(`ALL_PROXY`),n=getEnvironmentValue(`HTTP_PROXY`);return e||t||n}function isBypassed(e,t,n){if(t.length===0)return!1;let r=new URL(e).hostname;if(n?.has(r))return n.get(r);let i=!1;for(let e of t)e[0]===`.`?(r.endsWith(e)||r.length===e.length-1&&r===e.slice(1))&&(i=!0):r===e&&(i=!0);return n?.set(r,i),i}function loadNoProxy(){let e=getEnvironmentValue(`NO_PROXY`);return hs=!0,e?e.split(`,`).map(e=>e.trim()).filter(e=>e.length):[]}function getDefaultProxySettings$1(e){if(!e&&(e=loadEnvironmentProxyValue(),!e))return;let t=new URL(e);return{host:(t.protocol?t.protocol+`//`:``)+t.hostname,port:Number.parseInt(t.port||`80`),username:t.username,password:t.password}}function getDefaultProxySettingsInternal(){let e=loadEnvironmentProxyValue();return e?new URL(e):void 0}function getUrlFromProxySettings(e){let t;try{t=new URL(e.host)}catch{throw Error(`Expecting a valid host string in proxy settings, but found "${e.host}".`)}return t.port=String(e.port),e.username&&(t.username=e.username),e.password&&(t.password=e.password),t}function setProxyAgentOnRequest(e,t,n){if(e.agent)return;let r=new URL(e.url).protocol!==`https:`;e.tlsSettings&&Xo.warning(`TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.`),r?(t.httpProxyAgent||=new ps.HttpProxyAgent(n),e.agent=t.httpProxyAgent):(t.httpsProxyAgent||=new fs.HttpsProxyAgent(n),e.agent=t.httpsProxyAgent)}function proxyPolicy$1(e,t){hs||ms.push(...loadNoProxy());let n=e?getUrlFromProxySettings(e):getDefaultProxySettingsInternal(),r={};return{name:`proxyPolicy`,async sendRequest(e,i){return!e.proxySettings&&n&&!isBypassed(e.url,t?.customNoProxyList??ms,t?.customNoProxyList?void 0:gs)?setProxyAgentOnRequest(e,r,n):e.proxySettings&&setProxyAgentOnRequest(e,r,getUrlFromProxySettings(e.proxySettings)),i(e)}}}function decompressResponsePolicy$1(){return{name:`decompressResponsePolicy`,async sendRequest(e,t){return e.method!==`HEAD`&&e.headers.set(`Accept-Encoding`,`gzip,deflate`),t(e)}}}const _s=[`GET`,`HEAD`];function redirectPolicy$1(e={}){let{maxRetries:t=20,allowCrossOriginRedirects:n=!1}=e;return{name:`redirectPolicy`,async sendRequest(e,r){return handleRedirect(r,await r(e),t,n)}}}async function handleRedirect(e,t,n,r,i=0){let{request:a,status:o,headers:s}=t,c=s.get(`location`);if(c&&(o===300||o===301&&_s.includes(a.method)||o===302&&_s.includes(a.method)||o===303&&a.method===`POST`||o===307)&&itypeof e==`function`?e():e).map(toStream);return Ce.from((async function*(){for(let e of t)for await(let t of e)yield t})())}}function generateBoundary(){return`----AzSDKFormBoundary${randomUUID$2()}`}function encodeHeaders(e){let t=``;for(let[n,r]of e)t+=`${n}: ${r}\r\n`;return t}function getLength(e){if(e instanceof Uint8Array)return e.byteLength;if(isBlob(e))return e.size===-1?void 0:e.size}function getTotalLength(e){let t=0;for(let n of e){let e=getLength(n);if(e===void 0)return;t+=e}return t}async function buildRequestBody(e,t,n){let r=[stringToUint8Array$1(`--${n}`,`utf-8`),...t.flatMap(e=>[stringToUint8Array$1(`\r `,`utf-8`),stringToUint8Array$1(encodeHeaders(e.headers),`utf-8`),stringToUint8Array$1(`\r `,`utf-8`),e.body,stringToUint8Array$1(`\r\n--${n}`,`utf-8`)]),stringToUint8Array$1(`--\r \r -`,`utf-8`)],i=getTotalLength(r);i&&e.headers.set(`Content-Length`,i),e.body=await concat(r)}const ss=`multipartPolicy`,cs=new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);function assertValidBoundary(e){if(e.length>70)throw Error(`Multipart boundary "${e}" exceeds maximum length of 70 characters`);if(Array.from(e).some(e=>!cs.has(e)))throw Error(`Multipart boundary "${e}" contains invalid characters`)}function multipartPolicy$1(){return{name:ss,async sendRequest(e,t){if(!e.multipartBody)return t(e);if(e.body)throw Error(`multipartBody and regular body cannot be set at the same time`);let n=e.multipartBody.boundary,r=e.headers.get(`Content-Type`)??`multipart/mixed`,i=r.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!i)throw Error(`Got multipart request body, but content-type header was not multipart: ${r}`);let[,a,o]=i;if(o&&n&&o!==n)throw Error(`Multipart boundary was specified as ${o} in the header, but got ${n} in the request body`);return n??=o,n?assertValidBoundary(n):n=generateBoundary(),e.headers.set(`Content-Type`,`${a}; boundary=${n}`),await buildRequestBody(e,e.multipartBody.parts,n),e.multipartBody=void 0,t(e)}}}function createEmptyPipeline(){return createEmptyPipeline$1()}const ls=createLoggerContext({logLevelEnvVarName:`AZURE_LOG_LEVEL`,namespace:`azure`});ls.logger;function createClientLogger(e){return ls.createClientLogger(e)}const us=createClientLogger(`core-rest-pipeline`);function logPolicy(e={}){return logPolicy$1({logger:us.info,...e})}function redirectPolicy(e={}){return redirectPolicy$1(e)}function getHeaderName(){return`User-Agent`}async function setPlatformSpecificData(e){if(Te&&Te.versions){let t=`${ge.type()} ${ge.release()}; ${ge.arch()}`;Te.versions.bun?e.set(`Bun`,`${Te.versions.bun} (${t})`):Te.versions.deno?e.set(`Deno`,`${Te.versions.deno} (${t})`):Te.versions.node&&e.set(`Node`,`${Te.versions.node} (${t})`)}}const ds=`1.25.0`;function getUserAgentString$1(e){let t=[];for(let[n,r]of e){let e=r?`${n}/${r}`:n;t.push(e)}return t.join(` `)}function getUserAgentHeaderName(){return getHeaderName()}async function getUserAgentValue(e){let t=new Map;t.set(`core-rest-pipeline`,ds),await setPlatformSpecificData(t);let n=getUserAgentString$1(t);return e?`${e} ${n}`:n}const fs=getUserAgentHeaderName();function userAgentPolicy(e={}){let t=getUserAgentValue(e.userAgentPrefix);return{name:`userAgentPolicy`,async sendRequest(e,n){return e.headers.has(fs)||e.headers.set(fs,await t),n(e)}}}const ps=Symbol(`rawContent`);function hasRawContent(e){return typeof e[ps]==`function`}function getRawContent$1(e){return hasRawContent(e)?e[ps]():e}const ms=ss;function multipartPolicy(){let e=multipartPolicy$1();return{name:ms,sendRequest:async(t,n)=>{if(t.multipartBody)for(let e of t.multipartBody.parts)hasRawContent(e.body)&&(e.body=getRawContent$1(e.body));return e.sendRequest(t,n)}}}function decompressResponsePolicy(){return decompressResponsePolicy$1()}function defaultRetryPolicy(e={}){return defaultRetryPolicy$1(e)}function formDataPolicy(){return formDataPolicy$1()}var AbortError=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function createAbortablePromise(e,t){let{cleanupBeforeAbort:n,abortSignal:r,abortErrorMsg:i}=t??{};return new Promise((t,a)=>{function rejectOnAbort(){a(new AbortError(i??`The operation was aborted.`))}function removeListeners(){r?.removeEventListener(`abort`,onAbort)}function onAbort(){n?.(),removeListeners(),rejectOnAbort()}if(r?.aborted)return rejectOnAbort();try{e(e=>{removeListeners(),t(e)},e=>{removeListeners(),a(e)})}catch(e){a(e)}r?.addEventListener(`abort`,onAbort)})}function delay$1(e,t){let n,{abortSignal:r,abortErrorMsg:i}=t??{};return createAbortablePromise(t=>{n=setTimeout(t,e)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:r,abortErrorMsg:i??`The delay was aborted.`})}function getErrorMessage(e){if(isError$1(e))return e.message;{let t;try{t=typeof e==`object`&&e?JSON.stringify(e):String(e)}catch{t=`[unable to stringify input]`}return`Unknown error ${t}`}}function isError(e){return isError$1(e)}function randomUUID$1(){return randomUUID$2()}function uint8ArrayToString(e,t){return uint8ArrayToString$1(e,t)}function stringToUint8Array(e,t){return stringToUint8Array$1(e,t)}function getDefaultProxySettings(e){return getDefaultProxySettings$1(e)}function proxyPolicy(e,t){return proxyPolicy$1(e,t)}function setClientRequestIdPolicy(e=`x-ms-client-request-id`){return{name:`setClientRequestIdPolicy`,async sendRequest(t,n){return t.headers.has(e)||t.headers.set(e,t.requestId),n(t)}}}function agentPolicy(e){return agentPolicy$1(e)}function tlsPolicy(e){return tlsPolicy$1(e)}const hs={span:Symbol.for(`@azure/core-tracing span`),namespace:Symbol.for(`@azure/core-tracing namespace`)};function createTracingContext(e={}){let t=new gs(e.parentContext);return e.span&&(t=t.setValue(hs.span,e.span)),e.namespace&&(t=t.setValue(hs.namespace,e.namespace)),t}var gs=class TracingContextImpl{_contextMap;constructor(e){this._contextMap=e instanceof TracingContextImpl?new Map(e._contextMap):new Map}setValue(e,t){let n=new TracingContextImpl(this);return n._contextMap.set(e,t),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let t=new TracingContextImpl(this);return t._contextMap.delete(e),t}};const _s=__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.state=void 0,e.state={instrumenterImplementation:void 0}}))().state;function createDefaultTracingSpan(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function createDefaultInstrumenter(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:createDefaultTracingSpan(),tracingContext:createTracingContext({parentContext:t.tracingContext})}),withContext(e,t,...n){return t(...n)}}}function getInstrumenter(){return _s.instrumenterImplementation||=createDefaultInstrumenter(),_s.instrumenterImplementation}function createTracingClient(e){let{namespace:t,packageName:n,packageVersion:r}=e;function startSpan(e,i,a){let o=getInstrumenter().startSpan(e,{...a,packageName:n,packageVersion:r,tracingContext:i?.tracingOptions?.tracingContext}),s=o.tracingContext,c=o.span;return s.getValue(hs.namespace)||(s=s.setValue(hs.namespace,t)),c.setAttribute(`az.namespace`,s.getValue(hs.namespace)),{span:c,updatedOptions:Object.assign({},i,{tracingOptions:{...i?.tracingOptions,tracingContext:s}})}}async function withSpan(e,t,n,r){let{span:i,updatedOptions:a}=startSpan(e,t,r);try{let e=await withContext(a.tracingOptions.tracingContext,()=>n(a,i));return i.setStatus({status:`success`}),e}catch(e){throw i.setStatus({status:`error`,error:e}),e}finally{i.end()}}function withContext(e,t,...n){return getInstrumenter().withContext(e,t,...n)}function parseTraceparentHeader(e){return getInstrumenter().parseTraceparentHeader(e)}function createRequestHeaders(e){return getInstrumenter().createRequestHeaders(e)}return{startSpan,withSpan,withContext,parseTraceparentHeader,createRequestHeaders}}const vs=Ro;function isRestError(e){return isRestError$1(e)}function tracingPolicy(e={}){let t=getUserAgentValue(e.userAgentPrefix),n=new Sanitizer({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),r=tryCreateTracingClient();return{name:`tracingPolicy`,async sendRequest(e,i){if(!r)return i(e);let a=await t,o={"http.url":n.sanitizeUrl(e.url),"http.method":e.method,"http.user_agent":a,requestId:e.requestId};a&&(o[`http.user_agent`]=a);let{span:s,tracingContext:c}=tryCreateSpan(r,e,o)??{};if(!s||!c)return i(e);try{let t=await r.withContext(c,i,e);return tryProcessResponse(s,t),t}catch(e){throw tryProcessError(s,e),e}}}}function tryCreateTracingClient(){try{return createTracingClient({namespace:``,packageName:`@azure/core-rest-pipeline`,packageVersion:ds})}catch(e){us.warning(`Error when creating the TracingClient: ${getErrorMessage(e)}`);return}}function tryCreateSpan(e,t,n){try{let{span:r,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:`client`,spanAttributes:n});if(!r.isRecording()){r.end();return}let a=e.createRequestHeaders(i.tracingOptions.tracingContext);for(let[e,n]of Object.entries(a))t.headers.set(e,n);return{span:r,tracingContext:i.tracingOptions.tracingContext}}catch(e){us.warning(`Skipping creating a tracing span due to an error: ${getErrorMessage(e)}`);return}}function tryProcessError(e,t){try{e.setStatus({status:`error`,error:isError(t)?t:void 0}),isRestError(t)&&t.statusCode&&e.setAttribute(`http.status_code`,t.statusCode),e.end()}catch(e){us.warning(`Skipping tracing span processing due to an error: ${getErrorMessage(e)}`)}}function tryProcessResponse(e,t){try{e.setAttribute(`http.status_code`,t.status);let n=t.headers.get(`x-ms-request-id`);n&&e.setAttribute(`serviceRequestId`,n),t.status>=400&&e.setStatus({status:`error`}),e.end()}catch(e){us.warning(`Skipping tracing span processing due to an error: ${getErrorMessage(e)}`)}}function wrapAbortSignalLike(e){if(e instanceof AbortSignal)return{abortSignal:e};if(e.aborted)return{abortSignal:AbortSignal.abort(`reason`in e?e.reason:void 0)};let t=new AbortController,n=!0;function cleanup(){n&&=(e.removeEventListener(`abort`,listener),!1)}function listener(){t.abort(`reason`in e?e.reason:void 0),cleanup()}return e.addEventListener(`abort`,listener),{abortSignal:t.signal,cleanup}}function wrapAbortSignalLikePolicy(){return{name:`wrapAbortSignalLikePolicy`,sendRequest:async(e,t)=>{if(!e.abortSignal)return t(e);let{abortSignal:n,cleanup:r}=wrapAbortSignalLike(e.abortSignal);e.abortSignal=n;try{return await t(e)}finally{r?.()}}}}function createPipelineFromOptions(e){let t=createEmptyPipeline();return e.agent&&t.addPolicy(agentPolicy(e.agent)),e.tlsOptions&&t.addPolicy(tlsPolicy(e.tlsOptions)),t.addPolicy(proxyPolicy(e.proxyOptions)),t.addPolicy(decompressResponsePolicy()),t.addPolicy(wrapAbortSignalLikePolicy()),t.addPolicy(formDataPolicy(),{beforePolicies:[ms]}),t.addPolicy(userAgentPolicy(e.userAgentOptions)),t.addPolicy(setClientRequestIdPolicy(e.telemetryOptions?.clientRequestIdHeaderName)),t.addPolicy(multipartPolicy(),{afterPhase:`Deserialize`}),t.addPolicy(defaultRetryPolicy(e.retryOptions),{phase:`Retry`}),t.addPolicy(tracingPolicy({...e.userAgentOptions,...e.loggingOptions}),{afterPhase:`Retry`}),t.addPolicy(redirectPolicy(e.redirectOptions),{afterPhase:`Retry`}),t.addPolicy(logPolicy(e.loggingOptions),{afterPhase:`Sign`}),t}function createDefaultHttpClient(){let e=createDefaultHttpClient$1();return{async sendRequest(t){let{abortSignal:n,cleanup:r}=t.abortSignal?wrapAbortSignalLike(t.abortSignal):{};try{return t.abortSignal=n,await e.sendRequest(t)}finally{r?.()}}}}function createHttpHeaders(e){return createHttpHeaders$1(e)}function createPipelineRequest(e){return createPipelineRequest$1(e)}const ys={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};async function beginRefresh(e,t,n){async function tryGetAccessToken(){if(Date.now()e.getToken(t,s),a.retryIntervalInMs,r?.expiresOnTimestamp??Date.now()).then(e=>(n=null,r=e,i=s.tenantId,r)).catch(e=>{throw n=null,r=null,i=void 0,e})),n}return async(e,t)=>{let n=!!t.claims,a=i!==t.tenantId;return n&&(r=null),a||n||o.mustRefresh?refresh(e,t):(o.shouldRefresh&&refresh(e,t),r)}}async function trySendRequest(e,t){try{return[await t(e),void 0]}catch(e){if(isRestError(e)&&e.response)return[e.response,e];throw e}}async function defaultAuthorizeRequest(e){let{scopes:t,getAccessToken:n,request:r}=e,i=await n(t,{abortSignal:r.abortSignal,tracingOptions:r.tracingOptions,enableCae:!0});i&&e.request.headers.set(`Authorization`,`Bearer ${i.token}`)}function isChallengeResponse(e){return e.status===401&&e.headers.has(`WWW-Authenticate`)}async function authorizeRequestOnCaeChallenge(e,t){let{scopes:n}=e,r=await e.getAccessToken(n,{enableCae:!0,claims:t});return r?(e.request.headers.set(`Authorization`,`${r.tokenType??`Bearer`} ${r.token}`),!0):!1}function bearerTokenAuthenticationPolicy(e){let{credential:t,scopes:n,challengeCallbacks:r}=e,i=e.logger||us,a={authorizeRequest:r?.authorizeRequest?.bind(r)??defaultAuthorizeRequest,authorizeRequestOnChallenge:r?.authorizeRequestOnChallenge?.bind(r)},o=t?createTokenCycler(t):()=>Promise.resolve(null);return{name:`bearerTokenAuthenticationPolicy`,async sendRequest(e,t){if(!e.url.toLowerCase().startsWith(`https://`))throw Error(`Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.`);await a.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:e,getAccessToken:o,logger:i});let r,s,c;if([r,s]=await trySendRequest(e,t),isChallengeResponse(r)){let l=getCaeChallengeClaims(r.headers.get(`WWW-Authenticate`));if(l){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await authorizeRequestOnCaeChallenge({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await trySendRequest(e,t))}else if(a.authorizeRequestOnChallenge&&(c=await a.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:e,response:r,getAccessToken:o,logger:i}),c&&([r,s]=await trySendRequest(e,t)),isChallengeResponse(r)&&(l=getCaeChallengeClaims(r.headers.get(`WWW-Authenticate`)??``),l))){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await authorizeRequestOnCaeChallenge({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await trySendRequest(e,t))}}if(s)throw s;return r}}}function parseChallenges(e){let t=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,n=/(\w+)="([^"]*)"/g,r=[],i;for(;(i=t.exec(e))!==null;){let e=i[1],t=i[2],a={},o;for(;(o=n.exec(t))!==null;)a[o[1]]=o[2];r.push({scheme:e,params:a})}return r}function getCaeChallengeClaims(e){if(e)return parseChallenges(e).find(e=>e.scheme===`Bearer`&&e.params.claims&&e.params.error===`insufficient_claims`)?.params.claims}function isTokenCredential(e){let t=e;return t&&typeof t.getToken==`function`&&(t.signRequest===void 0||t.getToken.length>0)}const bs=`DisableKeepAlivePolicy`;function createDisableKeepAlivePolicy(){return{name:bs,sendRequest(e,t){return e.disableKeepAlive=!0,t(e)}}}function pipelineContainsDisableKeepAlivePolicy(e){return e.getOrderedPolicies().some(e=>e.name===bs)}function encodeByteArray(e){return uint8ArrayToString(e,`base64`)}function decodeString(e){return stringToUint8Array(e,`base64`)}function isPrimitiveBody(e,t){return t!==`Composite`&&t!==`Dictionary`&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||t?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||e==null)}const xs=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(e){return xs.test(e)}const Ss=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function isValidUuid(e){return Ss.test(e)}function handleNullableResponseAndWrappableBody(e){let t={...e.headers,...e.body};return e.hasNullableType&&Object.getOwnPropertyNames(t).length===0?e.shouldWrapBody?{body:null}:null:e.shouldWrapBody?{...e.headers,body:e.body}:t}function flattenResponse(e,t){let n=e.parsedHeaders;if(e.request.method===`HEAD`)return{...n,body:e.parsedBody};let r=t&&t.bodyMapper,i=!!r?.nullable,a=r?.type.name;if(a===`Stream`)return{...n,blobBody:e.blobBody,readableStreamBody:e.readableStreamBody};let o=a===`Composite`&&r.type.modelProperties||{},s=Object.keys(o).some(e=>o[e].serializedName===``);if(a===`Sequence`||s){let t=e.parsedBody??[];for(let n of Object.keys(o))o[n].serializedName&&(t[n]=e.parsedBody?.[n]);if(n)for(let e of Object.keys(n))t[e]=n[e];return i&&!e.parsedBody&&!n&&Object.getOwnPropertyNames(o).length===0?null:t}return handleNullableResponseAndWrappableBody({body:e.parsedBody,headers:n,hasNullableType:i,shouldWrapBody:isPrimitiveBody(e.parsedBody,a)})}var SerializerImpl=class{modelMappers;isXML;constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,n){let failValidation=(e,r)=>{throw Error(`"${n}" with value "${t}" should satisfy the constraint "${e}": ${r}.`)};if(e.constraints&&t!=null){let{ExclusiveMaximum:n,ExclusiveMinimum:r,InclusiveMaximum:i,InclusiveMinimum:a,MaxItems:o,MaxLength:s,MinItems:c,MinLength:l,MultipleOf:u,Pattern:d,UniqueItems:f}=e.constraints;if(n!==void 0&&t>=n&&failValidation(`ExclusiveMaximum`,n),r!==void 0&&t<=r&&failValidation(`ExclusiveMinimum`,r),i!==void 0&&t>i&&failValidation(`InclusiveMaximum`,i),a!==void 0&&to&&failValidation(`MaxItems`,o),s!==void 0&&t.length>s&&failValidation(`MaxLength`,s),c!==void 0&&t.lengthn.indexOf(e)!==t)&&failValidation(`UniqueItems`,f)}}serialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`}},a={},o=e.type.name;n||=e.serializedName,o.match(/^Sequence$/i)!==null&&(a=[]),e.isConstant&&(t=e.defaultValue);let{required:s,nullable:c}=e;if(s&&c&&t===void 0)throw Error(`${n} cannot be undefined.`);if(s&&!c&&t==null)throw Error(`${n} cannot be null or undefined.`);if(!s&&c===!1&&t===null)throw Error(`${n} cannot be null.`);return t==null?a=t:o.match(/^any$/i)===null?o.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)===null?o.match(/^Enum$/i)===null?o.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)===null?o.match(/^Composite$/i)!==null&&(a=serializeCompositeType(this,e,t,n,!!this.isXML,i)):a=serializeDictionaryType(this,e,t,n,!!this.isXML,i):a=serializeSequenceType(this,e,t,n,!!this.isXML,i):a=serializeBase64UrlType(n,t):a=serializeByteArrayType(n,t):a=serializeDateTypes(o,t,n):a=serializeEnumType(n,e.type.allowedValues,t):a=serializeBasicTypes(o,n,t):a=t,a}deserialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`},ignoreUnknownProperties:r.ignoreUnknownProperties??!1};if(t==null)return this.isXML&&e.type.name===`Sequence`&&!e.xmlIsWrapped&&(t=[]),e.defaultValue!==void 0&&(t=e.defaultValue),t;let a,o=e.type.name;if(n||=e.serializedName,o.match(/^Composite$/i)!==null)a=deserializeCompositeType(this,e,t,n,i);else{if(this.isXML){let e=i.xml.xmlCharKey;t.$!==void 0&&t[e]!==void 0&&(t=t[e])}o.match(/^Number$/i)===null?o.match(/^Boolean$/i)===null?o.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)===null?o.match(/^(Date|DateTime|DateTimeRfc1123)$/i)===null?o.match(/^UnixTime$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)!==null&&(a=deserializeDictionaryType(this,e,t,n,i)):a=deserializeSequenceType(this,e,t,n,i):a=base64UrlToByteArray(t):a=decodeString(t):a=unixTimeToDate(t):a=new Date(t):a=t:a=t===`true`||t!==`false`&&t:(a=parseFloat(t),isNaN(a)&&(a=t))}return e.isConstant&&(a=e.defaultValue),a}};function createSerializer(e={},t=!1){return new SerializerImpl(e,t)}function trimEnd(e,t){let n=e.length;for(;n-1>=0&&e[n-1]===t;)--n;return e.substr(0,n)}function bufferToBase64Url(e){if(e){if(!(e instanceof Uint8Array))throw Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);return trimEnd(encodeByteArray(e),`=`).replace(/\+/g,`-`).replace(/\//g,`_`)}}function base64UrlToByteArray(e){if(e){if(e&&typeof e.valueOf()!=`string`)throw Error(`Please provide an input of type string for converting to Uint8Array`);return e=e.replace(/-/g,`+`).replace(/_/g,`/`),decodeString(e)}}function splitSerializeName(e){let t=[],n=``;if(e){let r=e.split(`.`);for(let e of r)e.charAt(e.length-1)===`\\`?n+=e.substr(0,e.length-1)+`.`:(n+=e,t.push(n),n=``)}return t}function dateToUnixTime(e){if(e)return typeof e.valueOf()==`string`&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}function unixTimeToDate(e){if(e)return new Date(e*1e3)}function serializeBasicTypes(e,t,n){if(n!=null){if(e.match(/^Number$/i)!==null){if(typeof n!=`number`)throw Error(`${t} with value ${n} must be of type number.`)}else if(e.match(/^String$/i)!==null){if(typeof n.valueOf()!=`string`)throw Error(`${t} with value "${n}" must be of type string.`)}else if(e.match(/^Uuid$/i)!==null){if(!(typeof n.valueOf()==`string`&&isValidUuid(n)))throw Error(`${t} with value "${n}" must be of type string and a valid uuid.`)}else if(e.match(/^Boolean$/i)!==null){if(typeof n!=`boolean`)throw Error(`${t} with value ${n} must be of type boolean.`)}else if(e.match(/^Stream$/i)!==null){let e=typeof n;if(e!==`string`&&typeof n.pipe!=`function`&&typeof n.tee!=`function`&&!(n instanceof ArrayBuffer)&&!ArrayBuffer.isView(n)&&!((typeof Blob==`function`||typeof Blob==`object`)&&n instanceof Blob)&&e!==`function`)throw Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`)}}return n}function serializeEnumType(e,t,n){if(!t)throw Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);if(!t.some(e=>typeof e.valueOf()==`string`?e.toLowerCase()===n.toLowerCase():e===n))throw Error(`${n} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return n}function serializeByteArrayType(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=encodeByteArray(t)}return t}function serializeBase64UrlType(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=bufferToBase64Url(t)}return t}function serializeDateTypes(e,t,n){if(t!=null){if(e.match(/^Date$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(e.match(/^DateTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(e.match(/^DateTimeRfc1123$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(e.match(/^UnixTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=dateToUnixTime(t)}else if(e.match(/^TimeSpan$/i)!==null&&!isDuration(t))throw Error(`${n} must be a string in ISO 8601 format. Instead was "${t}".`)}return t}function serializeSequenceType(e,t,n,r,i,a){if(!Array.isArray(n))throw Error(`${r} must be of type Array.`);let o=t.type.element;if(!o||typeof o!=`object`)throw Error(`"element" metadata for an Array must be defined in the mapper and it must be of type "object" in ${r}.`);o.type.name===`Composite`&&o.type.className&&(o=e.modelMappers[o.type.className]??o);let s=[];for(let t=0;te!==i)&&Object.defineProperty(o,i,{value:e.serialize(c,n[i],r+`["`+i+`"]`,a),enumerable:!0,configurable:!0,writable:!0})}return o}return n}function getXmlObjectValue(e,t,n,r){if(!n||!e.xmlNamespace)return t;let i={[e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:`xmlns`]:e.xmlNamespace};if([`Composite`].includes(e.type.name)){if(t.$)return t;{let e={...t};return e.$=i,e}}let a={};return a[r.xml.xmlCharKey]=t,a.$=i,a}function isSpecialXmlProperty(e,t){return[`$`,t.xml.xmlCharKey].includes(e)}function deserializeCompositeType(e,t,n,r,i){let a=i.xml.xmlCharKey??`_`;getPolymorphicDiscriminatorRecursively(e,t)&&(t=getPolymorphicMapper(e,t,n,`serializedName`));let o=resolveModelProperties(e,t,r),s={},c=[];for(let l of Object.keys(o)){let u=o[l],d=splitSerializeName(o[l].serializedName);c.push(d[0]);let{serializedName:f,xmlName:p,xmlElementName:h}=u,g=r;f!==``&&f!==void 0&&(g=r+`.`+f);let v=u.headerCollectionPrefix;if(v){let t={};for(let r of Object.keys(n))r.startsWith(v)&&(t[r.substring(v.length)]=e.deserialize(u.type.value,n[r],g,i)),c.push(r);s[l]=t}else if(e.isXML){if(u.xmlIsAttribute&&n.$)s[l]=e.deserialize(u,n.$[p],g,i);else if(u.xmlIsMsText)n[a]===void 0?typeof n==`string`&&(s[l]=n):s[l]=n[a];else{let t=h||p||f;if(u.xmlIsWrapped){let t=n[p]?.[h]??[];Object.defineProperty(s,l,{value:e.deserialize(u,t,g,i),enumerable:!0,configurable:!0,writable:!0}),c.push(p)}else{let r=n[t];s[l]=e.deserialize(u,r,g,i),c.push(t)}}}else{let r,a=n,c=0;for(let e of d){if(!a)break;c++,a=a[e]}a===null&&c{for(let t of Object.keys(o))if(splitSerializeName(o[t].serializedName)[0]===e)return!1;return!0};for(let t of Object.keys(n))if(isAdditionalProperty(t)){let a=e.deserialize(l,n[t],r+`["`+t+`"]`,i);Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0})}}else if(n&&!i.ignoreUnknownProperties)for(let e of Object.keys(n))s[e]===void 0&&!c.includes(e)&&!isSpecialXmlProperty(e,i)&&Object.defineProperty(s,e,{value:n[e],enumerable:!0,configurable:!0,writable:!0});return s}function deserializeDictionaryType(e,t,n,r,i){let a=t.type.value;if(!a||typeof a!=`object`)throw Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${r}`);if(n){let t={};for(let o of Object.keys(n))t[o]=e.deserialize(a,n[o],r,i);return t}return n}function deserializeSequenceType(e,t,n,r,i){let a=t.type.element;if(!a||typeof a!=`object`)throw Error(`"element" metadata for an Array must be defined in the mapper and it must be of type "object" in ${r}`);if(n){Array.isArray(n)||(n=[n]),a.type.name===`Composite`&&a.type.className&&(a=e.modelMappers[a.type.className]??a);let t=[];for(let o=0;o{Object.defineProperty(e,"__esModule",{value:!0}),e.state=void 0,e.state={operationRequestMap:new WeakMap}}))().state;function getOperationArgumentValueFromParameter(e,t,n){let r=t.parameterPath,i=t.mapper,a;if(typeof r==`string`&&(r=[r]),Array.isArray(r)){if(r.length>0){if(i.isConstant)a=i.defaultValue;else{let t=getPropertyFromParameterPath(e,r);!t.propertyFound&&n&&(t=getPropertyFromParameterPath(n,r));let o=!1;t.propertyFound||(o=i.required||r[0]===`options`&&r.length===2),a=o?i.defaultValue:t.propertyValue}}}else{i.required&&(a={});for(let[t,o]of Object.entries(r)){let r=i.type.modelProperties[t],s=getOperationArgumentValueFromParameter(e,{parameterPath:o,mapper:r},n);s!==void 0&&(a||={},Object.defineProperty(a,t,{value:s,enumerable:!0,configurable:!0,writable:!0}))}}return a}function getPropertyFromParameterPath(e,t){let n={propertyFound:!1},r=0;for(;r=200&&n.status<300);s.headersMapper&&(a.parsedHeaders=o.serializer.deserialize(s.headersMapper,a.headers.toJSON(),`operationRes.parsedHeaders`,{xml:{},ignoreUnknownProperties:!0}))}return a}function isOperationSpecEmpty(e){let t=Object.keys(e.responses);return t.length===0||t.length===1&&t[0]==="default"}function handleErrorResponse(e,t,n,r){let i=200<=e.status&&e.status<300;if(isOperationSpecEmpty(t)?i:n){if(n){if(!n.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1}}let a=n??t.responses.default,o=e.request.streamResponseStatusCodes?.has(e.status)?`Unexpected status code: ${e.status}`:e.bodyAsText,s=new vs(o,{statusCode:e.status,request:e.request,response:e});if(!a&&!(e.parsedBody?.error?.code&&e.parsedBody?.error?.message))throw s;let c=a?.bodyMapper,l=a?.headersMapper;try{if(e.parsedBody){let n=e.parsedBody,i;if(c){let e=n;if(t.isXML&&c.type.name===Cs.Sequence){e=[];let t=c.xmlElementName;typeof n==`object`&&t&&(e=n[t])}i=t.serializer.deserialize(c,e,`error.response.parsedBody`,r)}let a=n.error||i||n;s.code=a.code,a.message&&(s.message=a.message),c&&(s.response.parsedBody=i)}e.headers&&l&&(s.response.parsedHeaders=t.serializer.deserialize(l,e.headers.toJSON(),`operationRes.parsedHeaders`))}catch(t){s.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:s,shouldReturnResponse:!1}}async function parse(e,t,n,r,i){if(!n.request.streamResponseStatusCodes?.has(n.status)&&n.bodyAsText){let a=n.bodyAsText,o=n.headers.get(`Content-Type`)||``,s=o?o.split(`;`).map(e=>e.toLowerCase()):[];try{if(s.length===0||s.some(t=>e.indexOf(t)!==-1))return n.parsedBody=JSON.parse(a),n;if(s.some(e=>t.indexOf(e)!==-1)){if(!i)throw Error(`Parsing XML not supported.`);return n.parsedBody=await i(a,r.xml),n}}catch(e){let t=`Error "${e}" occurred while parsing the response body - ${n.bodyAsText}.`,r=e.code||vs.PARSE_ERROR;throw new vs(t,{code:r,statusCode:n.status,request:n.request,response:n})}}return n}function getStreamingResponseStatusCodes(e){let t=new Set;for(let[n,r]of Object.entries(e.responses))r.bodyMapper&&r.bodyMapper.type.name===Cs.Stream&&t.add(Number(n));return t}function getPathStringFromParameter(e){let{parameterPath:t,mapper:n}=e,r;return r=typeof t==`string`?t:Array.isArray(t)?t.join(`.`):n.serializedName,r}function serializationPolicy(e={}){let t=e.stringifyXML;return{name:`serializationPolicy`,sendRequest(e,n){let r=getOperationRequestInfo(e),i=r?.operationSpec,a=r?.operationArguments;return i&&a&&(serializeHeaders(e,a,i),serializeRequestBody(e,a,i,t)),n(e)}}}function serializeHeaders(e,t,n){if(n.headerParameters)for(let r of n.headerParameters){let i=getOperationArgumentValueFromParameter(t,r);if(i!=null||r.mapper.required){i=n.serializer.serialize(r.mapper,i,getPathStringFromParameter(r));let t=r.mapper.headerCollectionPrefix;if(t)for(let n of Object.keys(i))e.headers.set(t+n,i[n]);else e.headers.set(r.mapper.serializedName||getPathStringFromParameter(r),i)}}let r=t.options?.requestOptions?.customHeaders;if(r)for(let t of Object.keys(r))e.headers.set(t,r[t])}function serializeRequestBody(e,t,n,r=function(){throw Error(`XML serialization unsupported!`)}){let i=t.options?.serializerOptions,a={xml:{rootName:i?.xml.rootName??``,includeRoot:i?.xml.includeRoot??!1,xmlCharKey:i?.xml.xmlCharKey??`_`}},o=a.xml.xmlCharKey;if(n.requestBody&&n.requestBody.mapper){e.body=getOperationArgumentValueFromParameter(t,n.requestBody);let i=n.requestBody.mapper,{required:s,serializedName:c,xmlName:l,xmlElementName:u,xmlNamespace:d,xmlNamespacePrefix:f,nullable:p}=i,h=i.type.name;try{if(e.body!==void 0&&e.body!==null||p&&e.body===null||s){let t=getPathStringFromParameter(n.requestBody);e.body=n.serializer.serialize(i,e.body,t,a);let s=h===Cs.Stream;if(n.isXML){let t=f?`xmlns:${f}`:`xmlns`,n=getXmlValueWithNamespace(d,t,h,e.body,a);h===Cs.Sequence?e.body=r(prepareXMLRootList(n,u||l||c,t,d),{rootName:l||c,xmlCharKey:o}):s||(e.body=r(n,{rootName:l||c,xmlCharKey:o}))}else if(h===Cs.String&&(n.contentType?.match(`text/plain`)||n.mediaType===`text`))return;else s||(e.body=JSON.stringify(e.body))}}catch(e){throw Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(c,void 0,` `)}.`)}}else if(n.formDataParameters&&n.formDataParameters.length>0){e.formData={};for(let r of n.formDataParameters){let i=getOperationArgumentValueFromParameter(t,r);if(i!=null){let t=r.mapper.serializedName||getPathStringFromParameter(r);e.formData[t]=n.serializer.serialize(r.mapper,i,getPathStringFromParameter(r),a)}}}}function getXmlValueWithNamespace(e,t,n,r,i){if(e&&![`Composite`,`Sequence`,`Dictionary`].includes(n)){let n={};return n[i.xml.xmlCharKey]=r,n.$={[t]:e},n}return r}function prepareXMLRootList(e,t,n,r){if(Array.isArray(e)||(e=[e]),!n||!r)return{[t]:e};let i={[t]:e};return i.$={[n]:r},i}function createClientPipeline(e={}){let t=createPipelineFromOptions(e??{});return e.credentialOptions&&t.addPolicy(bearerTokenAuthenticationPolicy({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(serializationPolicy(e.serializationOptions),{phase:`Serialize`}),t.addPolicy(deserializationPolicy(e.deserializationOptions),{phase:`Deserialize`}),t}let Os;function getCachedDefaultHttpClient$1(){return Os||=createDefaultHttpClient(),Os}const ks={CSV:`,`,SSV:` `,Multi:`Multi`,TSV:` `,Pipes:`|`};function getRequestUrl(e,t,n,r){let i=calculateUrlReplacements(t,n,r),a=!1,o=replaceAll(e,i);if(t.path){let e=replaceAll(t.path,i);t.path===`/{nextLink}`&&e.startsWith(`/`)&&(e=e.substring(1)),isAbsoluteUrl(e)?(o=e,a=!0):o=appendPath(o,e)}let{queryParams:s,sequenceParams:c}=calculateQueryParameters(t,n,r);return o=appendQueryParams(o,s,c,a),o}function replaceAll(e,t){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}function calculateUrlReplacements(e,t,n){let r=new Map;if(e.urlParameters?.length)for(let i of e.urlParameters){let a=getOperationArgumentValueFromParameter(t,i,n),o=getPathStringFromParameter(i);a=e.serializer.serialize(i.mapper,a,o),i.skipEncoding||(a=encodeURIComponent(a)),r.set(`{${i.mapper.serializedName||o}}`,a)}return r}function isAbsoluteUrl(e){return e.includes(`://`)}function appendPath(e,t){if(!t)return e;let n=new URL(e),r=n.pathname;r.endsWith(`/`)||(r=`${r}/`),t.startsWith(`/`)&&(t=t.substring(1));let i=t.indexOf(`?`);if(i!==-1){let e=t.substring(0,i),a=t.substring(i+1);r+=e,a&&(n.search=n.search?`${n.search}&${a}`:a)}else r+=t;return Object.assign(n,{pathname:r}),n.toString()}function calculateQueryParameters(e,t,n){let r=new Map,i=new Set;if(e.queryParameters?.length)for(let a of e.queryParameters){a.mapper.type.name===`Sequence`&&a.mapper.serializedName&&i.add(a.mapper.serializedName);let o=getOperationArgumentValueFromParameter(t,a,n);if(o!=null||a.mapper.required){o=e.serializer.serialize(a.mapper,o,getPathStringFromParameter(a));let t=a.collectionFormat?ks[a.collectionFormat]:``;if(Array.isArray(o)&&(o=o.map(e=>e??``)),a.collectionFormat===`Multi`&&o.length===0)continue;Array.isArray(o)&&(a.collectionFormat===`SSV`||a.collectionFormat===`TSV`)&&(o=o.join(t)),a.skipEncoding||(o=Array.isArray(o)?o.map(e=>encodeURIComponent(e)):encodeURIComponent(o)),Array.isArray(o)&&(a.collectionFormat===`CSV`||a.collectionFormat===`Pipes`)&&(o=o.join(t)),r.set(a.mapper.serializedName||getPathStringFromParameter(a),o)}}return{queryParams:r,sequenceParams:i}}function simpleParseQueryParams(e){let t=new Map;if(!e||e[0]!==`?`)return t;e=e.slice(1);let n=e.split(`&`);for(let e of n){let[n,r]=e.split(`=`,2),i=t.get(n);i?Array.isArray(i)?i.push(r):t.set(n,[i,r]):t.set(n,r)}return t}function appendQueryParams(e,t,n,r=!1){if(t.size===0)return e;let i=new URL(e),a=simpleParseQueryParams(i.search);for(let[e,i]of t){let t=a.get(e);if(Array.isArray(t)){if(Array.isArray(i)){t.push(...i);let n=new Set(t);a.set(e,Array.from(n))}else t.push(i)}else t?(Array.isArray(i)?i.unshift(t):n.has(e)&&a.set(e,[t,i]),r||a.set(e,i)):a.set(e,i)}let o=[];for(let[e,t]of a)if(typeof t==`string`)o.push(`${e}=${t}`);else if(Array.isArray(t))for(let n of t)o.push(`${e}=${n}`);else o.push(`${e}=${t}`);return i.search=o.length?`?${o.join(`&`)}`:``,i.toString()}const As=createClientLogger(`core-client`);var ServiceClient=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&As.warning(`The baseUri option for SDK Clients has been deprecated, please use endpoint instead.`),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||getCachedDefaultHttpClient$1(),this.pipeline=e.pipeline||createDefaultPipeline(e),e.additionalPolicies?.length)for(let{policy:t,position:n}of e.additionalPolicies){let e=n===`perRetry`?`Sign`:void 0;this.pipeline.addPolicy(t,{afterPhase:e})}}sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,t){let n=t.baseUrl||this._endpoint;if(!n)throw Error(`If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.`);let r=createPipelineRequest({url:getRequestUrl(n,t,e,this)});r.method=t.httpMethod;let i=getOperationRequestInfo(r);i.operationSpec=t,i.operationArguments=e;let a=t.contentType||this._requestContentType;a&&t.requestBody&&r.headers.set(`Content-Type`,a);let o=e.options;if(o){let e=o.requestOptions;e&&(e.timeout&&(r.timeout=e.timeout),e.onUploadProgress&&(r.onUploadProgress=e.onUploadProgress),e.onDownloadProgress&&(r.onDownloadProgress=e.onDownloadProgress),e.shouldDeserialize!==void 0&&(i.shouldDeserialize=e.shouldDeserialize),e.allowInsecureConnection&&(r.allowInsecureConnection=!0)),o.abortSignal&&(r.abortSignal=o.abortSignal),o.tracingOptions&&(r.tracingOptions=o.tracingOptions)}this._allowInsecureConnection&&(r.allowInsecureConnection=!0),r.streamResponseStatusCodes===void 0&&(r.streamResponseStatusCodes=getStreamingResponseStatusCodes(t));try{let e=await this.sendRequest(r),n=flattenResponse(e,t.responses[e.status]);return o?.onResponse&&o.onResponse(e,n),n}catch(e){if(typeof e==`object`&&e?.response){let n=e.response,r=flattenResponse(n,t.responses[e.statusCode]||t.responses.default);e.details=r,o?.onResponse&&o.onResponse(n,r,e)}throw e}}};function createDefaultPipeline(e){let t=getCredentialScopes(e),n=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return createClientPipeline({...e,credentialOptions:n})}function getCredentialScopes(e){if(e.credentialScopes)return e.credentialScopes;if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential)throw Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`)}const js={DefaultScope:`/.default`,HeaderConstants:{AUTHORIZATION:`authorization`}};function isUuid(e){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(e)}const authorizeRequestOnTenantChallenge=async e=>{let t=requestToOptions(e.request),n=getChallenge(e.response);if(n){let r=parseChallenge(n),i=buildScopes(e,r),a=extractTenantId(r);if(!a)return!1;let o=await e.getAccessToken(i,{...t,tenantId:a});return o?(e.request.headers.set(js.HeaderConstants.AUTHORIZATION,`${o.tokenType??`Bearer`} ${o.token}`),!0):!1}return!1};function extractTenantId(e){let t=new URL(e.authorization_uri).pathname.split(`/`)[1];if(t&&isUuid(t))return t}function buildScopes(e,t){if(!t.resource_id)return e.scopes;let n=new URL(t.resource_id),r=new URL(js.DefaultScope,n.origin).toString();return r===`https://disk.azure.com/.default`&&(r=`https://disk.azure.com//.default`),[r]}function getChallenge(e){let t=e.headers.get(`WWW-Authenticate`);if(e.status===401&&t)return t}function parseChallenge(e){return`${e.slice(7).trim()} `.split(` `).filter(e=>e).map(e=>(([e,t])=>({[e]:t}))(e.trim().split(`=`))).reduce((e,t)=>({...e,...t}),{})}function requestToOptions(e){return{abortSignal:e.abortSignal,requestOptions:{timeout:e.timeout},tracingOptions:e.tracingOptions}}const Ms=Symbol(`Original PipelineRequest`),Ns=Symbol.for(`@azure/core-client original request`),Ps=new Set([`url`,`method`,`withCredentials`,`timeout`,`requestId`,`abortSignal`,`body`,`formData`,`onDownloadProgress`,`onUploadProgress`,`proxySettings`,`streamResponseStatusCodes`,`agent`,`requestOverrides`]);function toPipelineRequest(e,t={}){let n=e[Ms],r=createHttpHeaders(e.headers.toJson({preserveCase:!0}));if(n)return n.headers=r,n;{let n=createPipelineRequest({url:e.url,method:e.method,headers:r,withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,disableKeepAlive:!!e.keepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides});return t.originalRequest&&(n[Ns]=t.originalRequest),n}}function toWebResourceLike(e,t){let n=t?.originalRequest??e,r={url:e.url,method:e.method,headers:toHttpHeadersLike(e.headers),withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.headers.get(`x-ms-client-request-id`)||e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,keepAlive:!!e.disableKeepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides,clone(){throw Error(`Cannot clone a non-proxied WebResourceLike`)},prepare(){throw Error(`WebResourceLike.prepare() is not supported by @azure/core-http-compat`)},validateRequestProperties(){}};return t?.createProxy?new Proxy(r,{get(t,i,a){return i===Ms?e:i===`clone`?()=>toWebResourceLike(toPipelineRequest(r,{originalRequest:n}),{createProxy:!0,originalRequest:n}):Reflect.get(t,i,a)},set(t,n,r,i){return n===`keepAlive`&&(e.disableKeepAlive=!r),typeof n==`string`&&Ps.has(n)&&(e[n]=r),Reflect.set(t,n,r,i)}}):r}function toHttpHeadersLike(e){return new Fs(e.toJSON({preserveCase:!0}))}function getHeaderKey(e){return e.toLowerCase()}var Fs=class HttpHeaders{_headersMap;constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t])}set(e,t){this._headersMap[getHeaderKey(e)]={name:e,value:t.toString()}}get(e){let t=this._headersMap[getHeaderKey(e)];return t?t.value:void 0}contains(e){return!!this._headersMap[getHeaderKey(e)]}remove(e){let t=this.contains(e);return delete this._headersMap[getHeaderKey(e)],t}rawHeaders(){return this.toJson({preserveCase:!0})}headersArray(){let e=[];for(let t in this._headersMap)e.push(this._headersMap[t]);return e}headerNames(){let e=[],t=this.headersArray();for(let n=0;ntoPipelineResponse(await e.sendRequest(toWebResourceLike(t,{createProxy:!0})))}}const zs=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function getAllMatches(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e`&&e[a]!==` `&&e[a]!==` `&&e[a]!==` +`,`utf-8`)],i=getTotalLength(r);i&&e.headers.set(`Content-Length`,i),e.body=await concat(r)}const vs=`multipartPolicy`,ys=new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);function assertValidBoundary(e){if(e.length>70)throw Error(`Multipart boundary "${e}" exceeds maximum length of 70 characters`);if(Array.from(e).some(e=>!ys.has(e)))throw Error(`Multipart boundary "${e}" contains invalid characters`)}function multipartPolicy$1(){return{name:vs,async sendRequest(e,t){if(!e.multipartBody)return t(e);if(e.body)throw Error(`multipartBody and regular body cannot be set at the same time`);let n=e.multipartBody.boundary,r=e.headers.get(`Content-Type`)??`multipart/mixed`,i=r.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!i)throw Error(`Got multipart request body, but content-type header was not multipart: ${r}`);let[,a,o]=i;if(o&&n&&o!==n)throw Error(`Multipart boundary was specified as ${o} in the header, but got ${n} in the request body`);return n??=o,n?assertValidBoundary(n):n=generateBoundary(),e.headers.set(`Content-Type`,`${a}; boundary=${n}`),await buildRequestBody(e,e.multipartBody.parts,n),e.multipartBody=void 0,t(e)}}}function createEmptyPipeline(){return createEmptyPipeline$1()}const bs=createLoggerContext({logLevelEnvVarName:`AZURE_LOG_LEVEL`,namespace:`azure`});bs.logger;function createClientLogger(e){return bs.createClientLogger(e)}const xs=createClientLogger(`core-rest-pipeline`);function logPolicy(e={}){return logPolicy$1({logger:xs.info,...e})}function redirectPolicy(e={}){return redirectPolicy$1(e)}function getHeaderName(){return`User-Agent`}async function setPlatformSpecificData(e){if(Te&&Te.versions){let t=`${ge.type()} ${ge.release()}; ${ge.arch()}`;Te.versions.bun?e.set(`Bun`,`${Te.versions.bun} (${t})`):Te.versions.deno?e.set(`Deno`,`${Te.versions.deno} (${t})`):Te.versions.node&&e.set(`Node`,`${Te.versions.node} (${t})`)}}const Ss=`1.25.0`;function getUserAgentString$1(e){let t=[];for(let[n,r]of e){let e=r?`${n}/${r}`:n;t.push(e)}return t.join(` `)}function getUserAgentHeaderName(){return getHeaderName()}async function getUserAgentValue(e){let t=new Map;t.set(`core-rest-pipeline`,Ss),await setPlatformSpecificData(t);let n=getUserAgentString$1(t);return e?`${e} ${n}`:n}const Cs=getUserAgentHeaderName();function userAgentPolicy(e={}){let t=getUserAgentValue(e.userAgentPrefix);return{name:`userAgentPolicy`,async sendRequest(e,n){return e.headers.has(Cs)||e.headers.set(Cs,await t),n(e)}}}const ws=Symbol(`rawContent`);function hasRawContent(e){return typeof e[ws]==`function`}function getRawContent$1(e){return hasRawContent(e)?e[ws]():e}const Ts=vs;function multipartPolicy(){let e=multipartPolicy$1();return{name:Ts,sendRequest:async(t,n)=>{if(t.multipartBody)for(let e of t.multipartBody.parts)hasRawContent(e.body)&&(e.body=getRawContent$1(e.body));return e.sendRequest(t,n)}}}function decompressResponsePolicy(){return decompressResponsePolicy$1()}function defaultRetryPolicy(e={}){return defaultRetryPolicy$1(e)}function formDataPolicy(){return formDataPolicy$1()}var AbortError=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function createAbortablePromise(e,t){let{cleanupBeforeAbort:n,abortSignal:r,abortErrorMsg:i}=t??{};return new Promise((t,a)=>{function rejectOnAbort(){a(new AbortError(i??`The operation was aborted.`))}function removeListeners(){r?.removeEventListener(`abort`,onAbort)}function onAbort(){n?.(),removeListeners(),rejectOnAbort()}if(r?.aborted)return rejectOnAbort();try{e(e=>{removeListeners(),t(e)},e=>{removeListeners(),a(e)})}catch(e){a(e)}r?.addEventListener(`abort`,onAbort)})}function delay$1(e,t){let n,{abortSignal:r,abortErrorMsg:i}=t??{};return createAbortablePromise(t=>{n=setTimeout(t,e)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:r,abortErrorMsg:i??`The delay was aborted.`})}function getErrorMessage(e){if(isError$1(e))return e.message;{let t;try{t=typeof e==`object`&&e?JSON.stringify(e):String(e)}catch{t=`[unable to stringify input]`}return`Unknown error ${t}`}}function isError(e){return isError$1(e)}function randomUUID$1(){return randomUUID$2()}function uint8ArrayToString(e,t){return uint8ArrayToString$1(e,t)}function stringToUint8Array(e,t){return stringToUint8Array$1(e,t)}function getDefaultProxySettings(e){return getDefaultProxySettings$1(e)}function proxyPolicy(e,t){return proxyPolicy$1(e,t)}function setClientRequestIdPolicy(e=`x-ms-client-request-id`){return{name:`setClientRequestIdPolicy`,async sendRequest(t,n){return t.headers.has(e)||t.headers.set(e,t.requestId),n(t)}}}function agentPolicy(e){return agentPolicy$1(e)}function tlsPolicy(e){return tlsPolicy$1(e)}const Es={span:Symbol.for(`@azure/core-tracing span`),namespace:Symbol.for(`@azure/core-tracing namespace`)};function createTracingContext(e={}){let t=new Ds(e.parentContext);return e.span&&(t=t.setValue(Es.span,e.span)),e.namespace&&(t=t.setValue(Es.namespace,e.namespace)),t}var Ds=class TracingContextImpl{_contextMap;constructor(e){this._contextMap=e instanceof TracingContextImpl?new Map(e._contextMap):new Map}setValue(e,t){let n=new TracingContextImpl(this);return n._contextMap.set(e,t),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let t=new TracingContextImpl(this);return t._contextMap.delete(e),t}};const Os=__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.state=void 0,e.state={instrumenterImplementation:void 0}}))().state;function createDefaultTracingSpan(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function createDefaultInstrumenter(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:createDefaultTracingSpan(),tracingContext:createTracingContext({parentContext:t.tracingContext})}),withContext(e,t,...n){return t(...n)}}}function getInstrumenter(){return Os.instrumenterImplementation||=createDefaultInstrumenter(),Os.instrumenterImplementation}function createTracingClient(e){let{namespace:t,packageName:n,packageVersion:r}=e;function startSpan(e,i,a){let o=getInstrumenter().startSpan(e,{...a,packageName:n,packageVersion:r,tracingContext:i?.tracingOptions?.tracingContext}),s=o.tracingContext,c=o.span;return s.getValue(Es.namespace)||(s=s.setValue(Es.namespace,t)),c.setAttribute(`az.namespace`,s.getValue(Es.namespace)),{span:c,updatedOptions:Object.assign({},i,{tracingOptions:{...i?.tracingOptions,tracingContext:s}})}}async function withSpan(e,t,n,r){let{span:i,updatedOptions:a}=startSpan(e,t,r);try{let e=await withContext(a.tracingOptions.tracingContext,()=>n(a,i));return i.setStatus({status:`success`}),e}catch(e){throw i.setStatus({status:`error`,error:e}),e}finally{i.end()}}function withContext(e,t,...n){return getInstrumenter().withContext(e,t,...n)}function parseTraceparentHeader(e){return getInstrumenter().parseTraceparentHeader(e)}function createRequestHeaders(e){return getInstrumenter().createRequestHeaders(e)}return{startSpan,withSpan,withContext,parseTraceparentHeader,createRequestHeaders}}const ks=Yo;function isRestError(e){return isRestError$1(e)}function tracingPolicy(e={}){let t=getUserAgentValue(e.userAgentPrefix),n=new Sanitizer({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),r=tryCreateTracingClient();return{name:`tracingPolicy`,async sendRequest(e,i){if(!r)return i(e);let a=await t,o={"http.url":n.sanitizeUrl(e.url),"http.method":e.method,"http.user_agent":a,requestId:e.requestId};a&&(o[`http.user_agent`]=a);let{span:s,tracingContext:c}=tryCreateSpan(r,e,o)??{};if(!s||!c)return i(e);try{let t=await r.withContext(c,i,e);return tryProcessResponse(s,t),t}catch(e){throw tryProcessError(s,e),e}}}}function tryCreateTracingClient(){try{return createTracingClient({namespace:``,packageName:`@azure/core-rest-pipeline`,packageVersion:Ss})}catch(e){xs.warning(`Error when creating the TracingClient: ${getErrorMessage(e)}`);return}}function tryCreateSpan(e,t,n){try{let{span:r,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:`client`,spanAttributes:n});if(!r.isRecording()){r.end();return}let a=e.createRequestHeaders(i.tracingOptions.tracingContext);for(let[e,n]of Object.entries(a))t.headers.set(e,n);return{span:r,tracingContext:i.tracingOptions.tracingContext}}catch(e){xs.warning(`Skipping creating a tracing span due to an error: ${getErrorMessage(e)}`);return}}function tryProcessError(e,t){try{e.setStatus({status:`error`,error:isError(t)?t:void 0}),isRestError(t)&&t.statusCode&&e.setAttribute(`http.status_code`,t.statusCode),e.end()}catch(e){xs.warning(`Skipping tracing span processing due to an error: ${getErrorMessage(e)}`)}}function tryProcessResponse(e,t){try{e.setAttribute(`http.status_code`,t.status);let n=t.headers.get(`x-ms-request-id`);n&&e.setAttribute(`serviceRequestId`,n),t.status>=400&&e.setStatus({status:`error`}),e.end()}catch(e){xs.warning(`Skipping tracing span processing due to an error: ${getErrorMessage(e)}`)}}function wrapAbortSignalLike(e){if(e instanceof AbortSignal)return{abortSignal:e};if(e.aborted)return{abortSignal:AbortSignal.abort(`reason`in e?e.reason:void 0)};let t=new AbortController,n=!0;function cleanup(){n&&=(e.removeEventListener(`abort`,listener),!1)}function listener(){t.abort(`reason`in e?e.reason:void 0),cleanup()}return e.addEventListener(`abort`,listener),{abortSignal:t.signal,cleanup}}function wrapAbortSignalLikePolicy(){return{name:`wrapAbortSignalLikePolicy`,sendRequest:async(e,t)=>{if(!e.abortSignal)return t(e);let{abortSignal:n,cleanup:r}=wrapAbortSignalLike(e.abortSignal);e.abortSignal=n;try{return await t(e)}finally{r?.()}}}}function createPipelineFromOptions(e){let t=createEmptyPipeline();return e.agent&&t.addPolicy(agentPolicy(e.agent)),e.tlsOptions&&t.addPolicy(tlsPolicy(e.tlsOptions)),t.addPolicy(proxyPolicy(e.proxyOptions)),t.addPolicy(decompressResponsePolicy()),t.addPolicy(wrapAbortSignalLikePolicy()),t.addPolicy(formDataPolicy(),{beforePolicies:[Ts]}),t.addPolicy(userAgentPolicy(e.userAgentOptions)),t.addPolicy(setClientRequestIdPolicy(e.telemetryOptions?.clientRequestIdHeaderName)),t.addPolicy(multipartPolicy(),{afterPhase:`Deserialize`}),t.addPolicy(defaultRetryPolicy(e.retryOptions),{phase:`Retry`}),t.addPolicy(tracingPolicy({...e.userAgentOptions,...e.loggingOptions}),{afterPhase:`Retry`}),t.addPolicy(redirectPolicy(e.redirectOptions),{afterPhase:`Retry`}),t.addPolicy(logPolicy(e.loggingOptions),{afterPhase:`Sign`}),t}function createDefaultHttpClient(){let e=createDefaultHttpClient$1();return{async sendRequest(t){let{abortSignal:n,cleanup:r}=t.abortSignal?wrapAbortSignalLike(t.abortSignal):{};try{return t.abortSignal=n,await e.sendRequest(t)}finally{r?.()}}}}function createHttpHeaders(e){return createHttpHeaders$1(e)}function createPipelineRequest(e){return createPipelineRequest$1(e)}const As={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};async function beginRefresh(e,t,n){async function tryGetAccessToken(){if(Date.now()e.getToken(t,s),a.retryIntervalInMs,r?.expiresOnTimestamp??Date.now()).then(e=>(n=null,r=e,i=s.tenantId,r)).catch(e=>{throw n=null,r=null,i=void 0,e})),n}return async(e,t)=>{let n=!!t.claims,a=i!==t.tenantId;return n&&(r=null),a||n||o.mustRefresh?refresh(e,t):(o.shouldRefresh&&refresh(e,t),r)}}async function trySendRequest(e,t){try{return[await t(e),void 0]}catch(e){if(isRestError(e)&&e.response)return[e.response,e];throw e}}async function defaultAuthorizeRequest(e){let{scopes:t,getAccessToken:n,request:r}=e,i=await n(t,{abortSignal:r.abortSignal,tracingOptions:r.tracingOptions,enableCae:!0});i&&e.request.headers.set(`Authorization`,`Bearer ${i.token}`)}function isChallengeResponse(e){return e.status===401&&e.headers.has(`WWW-Authenticate`)}async function authorizeRequestOnCaeChallenge(e,t){let{scopes:n}=e,r=await e.getAccessToken(n,{enableCae:!0,claims:t});return r?(e.request.headers.set(`Authorization`,`${r.tokenType??`Bearer`} ${r.token}`),!0):!1}function bearerTokenAuthenticationPolicy(e){let{credential:t,scopes:n,challengeCallbacks:r}=e,i=e.logger||xs,a={authorizeRequest:r?.authorizeRequest?.bind(r)??defaultAuthorizeRequest,authorizeRequestOnChallenge:r?.authorizeRequestOnChallenge?.bind(r)},o=t?createTokenCycler(t):()=>Promise.resolve(null);return{name:`bearerTokenAuthenticationPolicy`,async sendRequest(e,t){if(!e.url.toLowerCase().startsWith(`https://`))throw Error(`Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.`);await a.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:e,getAccessToken:o,logger:i});let r,s,c;if([r,s]=await trySendRequest(e,t),isChallengeResponse(r)){let l=getCaeChallengeClaims(r.headers.get(`WWW-Authenticate`));if(l){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await authorizeRequestOnCaeChallenge({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await trySendRequest(e,t))}else if(a.authorizeRequestOnChallenge&&(c=await a.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:e,response:r,getAccessToken:o,logger:i}),c&&([r,s]=await trySendRequest(e,t)),isChallengeResponse(r)&&(l=getCaeChallengeClaims(r.headers.get(`WWW-Authenticate`)??``),l))){let a;try{a=atob(l)}catch{return i.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${l}`),r}c=await authorizeRequestOnCaeChallenge({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await trySendRequest(e,t))}}if(s)throw s;return r}}}function parseChallenges(e){let t=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,n=/(\w+)="([^"]*)"/g,r=[],i;for(;(i=t.exec(e))!==null;){let e=i[1],t=i[2],a={},o;for(;(o=n.exec(t))!==null;)a[o[1]]=o[2];r.push({scheme:e,params:a})}return r}function getCaeChallengeClaims(e){if(e)return parseChallenges(e).find(e=>e.scheme===`Bearer`&&e.params.claims&&e.params.error===`insufficient_claims`)?.params.claims}function isTokenCredential(e){let t=e;return t&&typeof t.getToken==`function`&&(t.signRequest===void 0||t.getToken.length>0)}const js=`DisableKeepAlivePolicy`;function createDisableKeepAlivePolicy(){return{name:js,sendRequest(e,t){return e.disableKeepAlive=!0,t(e)}}}function pipelineContainsDisableKeepAlivePolicy(e){return e.getOrderedPolicies().some(e=>e.name===js)}function encodeByteArray(e){return uint8ArrayToString(e,`base64`)}function decodeString(e){return stringToUint8Array(e,`base64`)}function isPrimitiveBody(e,t){return t!==`Composite`&&t!==`Dictionary`&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||t?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||e==null)}const Ms=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(e){return Ms.test(e)}const Ns=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function isValidUuid(e){return Ns.test(e)}function handleNullableResponseAndWrappableBody(e){let t={...e.headers,...e.body};return e.hasNullableType&&Object.getOwnPropertyNames(t).length===0?e.shouldWrapBody?{body:null}:null:e.shouldWrapBody?{...e.headers,body:e.body}:t}function flattenResponse(e,t){let n=e.parsedHeaders;if(e.request.method===`HEAD`)return{...n,body:e.parsedBody};let r=t&&t.bodyMapper,i=!!r?.nullable,a=r?.type.name;if(a===`Stream`)return{...n,blobBody:e.blobBody,readableStreamBody:e.readableStreamBody};let o=a===`Composite`&&r.type.modelProperties||{},s=Object.keys(o).some(e=>o[e].serializedName===``);if(a===`Sequence`||s){let t=e.parsedBody??[];for(let n of Object.keys(o))o[n].serializedName&&(t[n]=e.parsedBody?.[n]);if(n)for(let e of Object.keys(n))t[e]=n[e];return i&&!e.parsedBody&&!n&&Object.getOwnPropertyNames(o).length===0?null:t}return handleNullableResponseAndWrappableBody({body:e.parsedBody,headers:n,hasNullableType:i,shouldWrapBody:isPrimitiveBody(e.parsedBody,a)})}var SerializerImpl=class{modelMappers;isXML;constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,n){let failValidation=(e,r)=>{throw Error(`"${n}" with value "${t}" should satisfy the constraint "${e}": ${r}.`)};if(e.constraints&&t!=null){let{ExclusiveMaximum:n,ExclusiveMinimum:r,InclusiveMaximum:i,InclusiveMinimum:a,MaxItems:o,MaxLength:s,MinItems:c,MinLength:l,MultipleOf:u,Pattern:d,UniqueItems:f}=e.constraints;if(n!==void 0&&t>=n&&failValidation(`ExclusiveMaximum`,n),r!==void 0&&t<=r&&failValidation(`ExclusiveMinimum`,r),i!==void 0&&t>i&&failValidation(`InclusiveMaximum`,i),a!==void 0&&to&&failValidation(`MaxItems`,o),s!==void 0&&t.length>s&&failValidation(`MaxLength`,s),c!==void 0&&t.lengthn.indexOf(e)!==t)&&failValidation(`UniqueItems`,f)}}serialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`}},a={},o=e.type.name;n||=e.serializedName,o.match(/^Sequence$/i)!==null&&(a=[]),e.isConstant&&(t=e.defaultValue);let{required:s,nullable:c}=e;if(s&&c&&t===void 0)throw Error(`${n} cannot be undefined.`);if(s&&!c&&t==null)throw Error(`${n} cannot be null or undefined.`);if(!s&&c===!1&&t===null)throw Error(`${n} cannot be null.`);return t==null?a=t:o.match(/^any$/i)===null?o.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)===null?o.match(/^Enum$/i)===null?o.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)===null?o.match(/^Composite$/i)!==null&&(a=serializeCompositeType(this,e,t,n,!!this.isXML,i)):a=serializeDictionaryType(this,e,t,n,!!this.isXML,i):a=serializeSequenceType(this,e,t,n,!!this.isXML,i):a=serializeBase64UrlType(n,t):a=serializeByteArrayType(n,t):a=serializeDateTypes(o,t,n):a=serializeEnumType(n,e.type.allowedValues,t):a=serializeBasicTypes(o,n,t):a=t,a}deserialize(e,t,n,r={xml:{}}){let i={xml:{rootName:r.xml.rootName??``,includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??`_`},ignoreUnknownProperties:r.ignoreUnknownProperties??!1};if(t==null)return this.isXML&&e.type.name===`Sequence`&&!e.xmlIsWrapped&&(t=[]),e.defaultValue!==void 0&&(t=e.defaultValue),t;let a,o=e.type.name;if(n||=e.serializedName,o.match(/^Composite$/i)!==null)a=deserializeCompositeType(this,e,t,n,i);else{if(this.isXML){let e=i.xml.xmlCharKey;t.$!==void 0&&t[e]!==void 0&&(t=t[e])}o.match(/^Number$/i)===null?o.match(/^Boolean$/i)===null?o.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)===null?o.match(/^(Date|DateTime|DateTimeRfc1123)$/i)===null?o.match(/^UnixTime$/i)===null?o.match(/^ByteArray$/i)===null?o.match(/^Base64Url$/i)===null?o.match(/^Sequence$/i)===null?o.match(/^Dictionary$/i)!==null&&(a=deserializeDictionaryType(this,e,t,n,i)):a=deserializeSequenceType(this,e,t,n,i):a=base64UrlToByteArray(t):a=decodeString(t):a=unixTimeToDate(t):a=new Date(t):a=t:a=t===`true`||t!==`false`&&t:(a=parseFloat(t),isNaN(a)&&(a=t))}return e.isConstant&&(a=e.defaultValue),a}};function createSerializer(e={},t=!1){return new SerializerImpl(e,t)}function trimEnd(e,t){let n=e.length;for(;n-1>=0&&e[n-1]===t;)--n;return e.substr(0,n)}function bufferToBase64Url(e){if(e){if(!(e instanceof Uint8Array))throw Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);return trimEnd(encodeByteArray(e),`=`).replace(/\+/g,`-`).replace(/\//g,`_`)}}function base64UrlToByteArray(e){if(e){if(e&&typeof e.valueOf()!=`string`)throw Error(`Please provide an input of type string for converting to Uint8Array`);return e=e.replace(/-/g,`+`).replace(/_/g,`/`),decodeString(e)}}function splitSerializeName(e){let t=[],n=``;if(e){let r=e.split(`.`);for(let e of r)e.charAt(e.length-1)===`\\`?n+=e.substr(0,e.length-1)+`.`:(n+=e,t.push(n),n=``)}return t}function dateToUnixTime(e){if(e)return typeof e.valueOf()==`string`&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}function unixTimeToDate(e){if(e)return new Date(e*1e3)}function serializeBasicTypes(e,t,n){if(n!=null){if(e.match(/^Number$/i)!==null){if(typeof n!=`number`)throw Error(`${t} with value ${n} must be of type number.`)}else if(e.match(/^String$/i)!==null){if(typeof n.valueOf()!=`string`)throw Error(`${t} with value "${n}" must be of type string.`)}else if(e.match(/^Uuid$/i)!==null){if(!(typeof n.valueOf()==`string`&&isValidUuid(n)))throw Error(`${t} with value "${n}" must be of type string and a valid uuid.`)}else if(e.match(/^Boolean$/i)!==null){if(typeof n!=`boolean`)throw Error(`${t} with value ${n} must be of type boolean.`)}else if(e.match(/^Stream$/i)!==null){let e=typeof n;if(e!==`string`&&typeof n.pipe!=`function`&&typeof n.tee!=`function`&&!(n instanceof ArrayBuffer)&&!ArrayBuffer.isView(n)&&!((typeof Blob==`function`||typeof Blob==`object`)&&n instanceof Blob)&&e!==`function`)throw Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`)}}return n}function serializeEnumType(e,t,n){if(!t)throw Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);if(!t.some(e=>typeof e.valueOf()==`string`?e.toLowerCase()===n.toLowerCase():e===n))throw Error(`${n} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return n}function serializeByteArrayType(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=encodeByteArray(t)}return t}function serializeBase64UrlType(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=bufferToBase64Url(t)}return t}function serializeDateTypes(e,t,n){if(t!=null){if(e.match(/^Date$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(e.match(/^DateTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(e.match(/^DateTimeRfc1123$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(e.match(/^UnixTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==`string`&&!isNaN(Date.parse(t))))throw Error(`${n} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=dateToUnixTime(t)}else if(e.match(/^TimeSpan$/i)!==null&&!isDuration(t))throw Error(`${n} must be a string in ISO 8601 format. Instead was "${t}".`)}return t}function serializeSequenceType(e,t,n,r,i,a){if(!Array.isArray(n))throw Error(`${r} must be of type Array.`);let o=t.type.element;if(!o||typeof o!=`object`)throw Error(`"element" metadata for an Array must be defined in the mapper and it must be of type "object" in ${r}.`);o.type.name===`Composite`&&o.type.className&&(o=e.modelMappers[o.type.className]??o);let s=[];for(let t=0;te!==i)&&Object.defineProperty(o,i,{value:e.serialize(c,n[i],r+`["`+i+`"]`,a),enumerable:!0,configurable:!0,writable:!0})}return o}return n}function getXmlObjectValue(e,t,n,r){if(!n||!e.xmlNamespace)return t;let i={[e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:`xmlns`]:e.xmlNamespace};if([`Composite`].includes(e.type.name)){if(t.$)return t;{let e={...t};return e.$=i,e}}let a={};return a[r.xml.xmlCharKey]=t,a.$=i,a}function isSpecialXmlProperty(e,t){return[`$`,t.xml.xmlCharKey].includes(e)}function deserializeCompositeType(e,t,n,r,i){let a=i.xml.xmlCharKey??`_`;getPolymorphicDiscriminatorRecursively(e,t)&&(t=getPolymorphicMapper(e,t,n,`serializedName`));let o=resolveModelProperties(e,t,r),s={},c=[];for(let l of Object.keys(o)){let u=o[l],d=splitSerializeName(o[l].serializedName);c.push(d[0]);let{serializedName:f,xmlName:p,xmlElementName:h}=u,g=r;f!==``&&f!==void 0&&(g=r+`.`+f);let v=u.headerCollectionPrefix;if(v){let t={};for(let r of Object.keys(n))r.startsWith(v)&&(t[r.substring(v.length)]=e.deserialize(u.type.value,n[r],g,i)),c.push(r);s[l]=t}else if(e.isXML){if(u.xmlIsAttribute&&n.$)s[l]=e.deserialize(u,n.$[p],g,i);else if(u.xmlIsMsText)n[a]===void 0?typeof n==`string`&&(s[l]=n):s[l]=n[a];else{let t=h||p||f;if(u.xmlIsWrapped){let t=n[p]?.[h]??[];Object.defineProperty(s,l,{value:e.deserialize(u,t,g,i),enumerable:!0,configurable:!0,writable:!0}),c.push(p)}else{let r=n[t];s[l]=e.deserialize(u,r,g,i),c.push(t)}}}else{let r,a=n,c=0;for(let e of d){if(!a)break;c++,a=a[e]}a===null&&c{for(let t of Object.keys(o))if(splitSerializeName(o[t].serializedName)[0]===e)return!1;return!0};for(let t of Object.keys(n))if(isAdditionalProperty(t)){let a=e.deserialize(l,n[t],r+`["`+t+`"]`,i);Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0})}}else if(n&&!i.ignoreUnknownProperties)for(let e of Object.keys(n))s[e]===void 0&&!c.includes(e)&&!isSpecialXmlProperty(e,i)&&Object.defineProperty(s,e,{value:n[e],enumerable:!0,configurable:!0,writable:!0});return s}function deserializeDictionaryType(e,t,n,r,i){let a=t.type.value;if(!a||typeof a!=`object`)throw Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${r}`);if(n){let t={};for(let o of Object.keys(n))t[o]=e.deserialize(a,n[o],r,i);return t}return n}function deserializeSequenceType(e,t,n,r,i){let a=t.type.element;if(!a||typeof a!=`object`)throw Error(`"element" metadata for an Array must be defined in the mapper and it must be of type "object" in ${r}`);if(n){Array.isArray(n)||(n=[n]),a.type.name===`Composite`&&a.type.className&&(a=e.modelMappers[a.type.className]??a);let t=[];for(let o=0;o{Object.defineProperty(e,"__esModule",{value:!0}),e.state=void 0,e.state={operationRequestMap:new WeakMap}}))().state;function getOperationArgumentValueFromParameter(e,t,n){let r=t.parameterPath,i=t.mapper,a;if(typeof r==`string`&&(r=[r]),Array.isArray(r)){if(r.length>0){if(i.isConstant)a=i.defaultValue;else{let t=getPropertyFromParameterPath(e,r);!t.propertyFound&&n&&(t=getPropertyFromParameterPath(n,r));let o=!1;t.propertyFound||(o=i.required||r[0]===`options`&&r.length===2),a=o?i.defaultValue:t.propertyValue}}}else{i.required&&(a={});for(let[t,o]of Object.entries(r)){let r=i.type.modelProperties[t],s=getOperationArgumentValueFromParameter(e,{parameterPath:o,mapper:r},n);s!==void 0&&(a||={},Object.defineProperty(a,t,{value:s,enumerable:!0,configurable:!0,writable:!0}))}}return a}function getPropertyFromParameterPath(e,t){let n={propertyFound:!1},r=0;for(;r=200&&n.status<300);s.headersMapper&&(a.parsedHeaders=o.serializer.deserialize(s.headersMapper,a.headers.toJSON(),`operationRes.parsedHeaders`,{xml:{},ignoreUnknownProperties:!0}))}return a}function isOperationSpecEmpty(e){let t=Object.keys(e.responses);return t.length===0||t.length===1&&t[0]==="default"}function handleErrorResponse(e,t,n,r){let i=200<=e.status&&e.status<300;if(isOperationSpecEmpty(t)?i:n){if(n){if(!n.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1}}let a=n??t.responses.default,o=e.request.streamResponseStatusCodes?.has(e.status)?`Unexpected status code: ${e.status}`:e.bodyAsText,s=new ks(o,{statusCode:e.status,request:e.request,response:e});if(!a&&!(e.parsedBody?.error?.code&&e.parsedBody?.error?.message))throw s;let c=a?.bodyMapper,l=a?.headersMapper;try{if(e.parsedBody){let n=e.parsedBody,i;if(c){let e=n;if(t.isXML&&c.type.name===Ps.Sequence){e=[];let t=c.xmlElementName;typeof n==`object`&&t&&(e=n[t])}i=t.serializer.deserialize(c,e,`error.response.parsedBody`,r)}let a=n.error||i||n;s.code=a.code,a.message&&(s.message=a.message),c&&(s.response.parsedBody=i)}e.headers&&l&&(s.response.parsedHeaders=t.serializer.deserialize(l,e.headers.toJSON(),`operationRes.parsedHeaders`))}catch(t){s.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:s,shouldReturnResponse:!1}}async function parse(e,t,n,r,i){if(!n.request.streamResponseStatusCodes?.has(n.status)&&n.bodyAsText){let a=n.bodyAsText,o=n.headers.get(`Content-Type`)||``,s=o?o.split(`;`).map(e=>e.toLowerCase()):[];try{if(s.length===0||s.some(t=>e.indexOf(t)!==-1))return n.parsedBody=JSON.parse(a),n;if(s.some(e=>t.indexOf(e)!==-1)){if(!i)throw Error(`Parsing XML not supported.`);return n.parsedBody=await i(a,r.xml),n}}catch(e){let t=`Error "${e}" occurred while parsing the response body - ${n.bodyAsText}.`,r=e.code||ks.PARSE_ERROR;throw new ks(t,{code:r,statusCode:n.status,request:n.request,response:n})}}return n}function getStreamingResponseStatusCodes(e){let t=new Set;for(let[n,r]of Object.entries(e.responses))r.bodyMapper&&r.bodyMapper.type.name===Ps.Stream&&t.add(Number(n));return t}function getPathStringFromParameter(e){let{parameterPath:t,mapper:n}=e,r;return r=typeof t==`string`?t:Array.isArray(t)?t.join(`.`):n.serializedName,r}function serializationPolicy(e={}){let t=e.stringifyXML;return{name:`serializationPolicy`,sendRequest(e,n){let r=getOperationRequestInfo(e),i=r?.operationSpec,a=r?.operationArguments;return i&&a&&(serializeHeaders(e,a,i),serializeRequestBody(e,a,i,t)),n(e)}}}function serializeHeaders(e,t,n){if(n.headerParameters)for(let r of n.headerParameters){let i=getOperationArgumentValueFromParameter(t,r);if(i!=null||r.mapper.required){i=n.serializer.serialize(r.mapper,i,getPathStringFromParameter(r));let t=r.mapper.headerCollectionPrefix;if(t)for(let n of Object.keys(i))e.headers.set(t+n,i[n]);else e.headers.set(r.mapper.serializedName||getPathStringFromParameter(r),i)}}let r=t.options?.requestOptions?.customHeaders;if(r)for(let t of Object.keys(r))e.headers.set(t,r[t])}function serializeRequestBody(e,t,n,r=function(){throw Error(`XML serialization unsupported!`)}){let i=t.options?.serializerOptions,a={xml:{rootName:i?.xml.rootName??``,includeRoot:i?.xml.includeRoot??!1,xmlCharKey:i?.xml.xmlCharKey??`_`}},o=a.xml.xmlCharKey;if(n.requestBody&&n.requestBody.mapper){e.body=getOperationArgumentValueFromParameter(t,n.requestBody);let i=n.requestBody.mapper,{required:s,serializedName:c,xmlName:l,xmlElementName:u,xmlNamespace:d,xmlNamespacePrefix:f,nullable:p}=i,h=i.type.name;try{if(e.body!==void 0&&e.body!==null||p&&e.body===null||s){let t=getPathStringFromParameter(n.requestBody);e.body=n.serializer.serialize(i,e.body,t,a);let s=h===Ps.Stream;if(n.isXML){let t=f?`xmlns:${f}`:`xmlns`,n=getXmlValueWithNamespace(d,t,h,e.body,a);h===Ps.Sequence?e.body=r(prepareXMLRootList(n,u||l||c,t,d),{rootName:l||c,xmlCharKey:o}):s||(e.body=r(n,{rootName:l||c,xmlCharKey:o}))}else if(h===Ps.String&&(n.contentType?.match(`text/plain`)||n.mediaType===`text`))return;else s||(e.body=JSON.stringify(e.body))}}catch(e){throw Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(c,void 0,` `)}.`)}}else if(n.formDataParameters&&n.formDataParameters.length>0){e.formData={};for(let r of n.formDataParameters){let i=getOperationArgumentValueFromParameter(t,r);if(i!=null){let t=r.mapper.serializedName||getPathStringFromParameter(r);e.formData[t]=n.serializer.serialize(r.mapper,i,getPathStringFromParameter(r),a)}}}}function getXmlValueWithNamespace(e,t,n,r,i){if(e&&![`Composite`,`Sequence`,`Dictionary`].includes(n)){let n={};return n[i.xml.xmlCharKey]=r,n.$={[t]:e},n}return r}function prepareXMLRootList(e,t,n,r){if(Array.isArray(e)||(e=[e]),!n||!r)return{[t]:e};let i={[t]:e};return i.$={[n]:r},i}function createClientPipeline(e={}){let t=createPipelineFromOptions(e??{});return e.credentialOptions&&t.addPolicy(bearerTokenAuthenticationPolicy({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(serializationPolicy(e.serializationOptions),{phase:`Serialize`}),t.addPolicy(deserializationPolicy(e.deserializationOptions),{phase:`Deserialize`}),t}let zs;function getCachedDefaultHttpClient$1(){return zs||=createDefaultHttpClient(),zs}const Bs={CSV:`,`,SSV:` `,Multi:`Multi`,TSV:` `,Pipes:`|`};function getRequestUrl(e,t,n,r){let i=calculateUrlReplacements(t,n,r),a=!1,o=replaceAll(e,i);if(t.path){let e=replaceAll(t.path,i);t.path===`/{nextLink}`&&e.startsWith(`/`)&&(e=e.substring(1)),isAbsoluteUrl(e)?(o=e,a=!0):o=appendPath(o,e)}let{queryParams:s,sequenceParams:c}=calculateQueryParameters(t,n,r);return o=appendQueryParams(o,s,c,a),o}function replaceAll(e,t){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}function calculateUrlReplacements(e,t,n){let r=new Map;if(e.urlParameters?.length)for(let i of e.urlParameters){let a=getOperationArgumentValueFromParameter(t,i,n),o=getPathStringFromParameter(i);a=e.serializer.serialize(i.mapper,a,o),i.skipEncoding||(a=encodeURIComponent(a)),r.set(`{${i.mapper.serializedName||o}}`,a)}return r}function isAbsoluteUrl(e){return e.includes(`://`)}function appendPath(e,t){if(!t)return e;let n=new URL(e),r=n.pathname;r.endsWith(`/`)||(r=`${r}/`),t.startsWith(`/`)&&(t=t.substring(1));let i=t.indexOf(`?`);if(i!==-1){let e=t.substring(0,i),a=t.substring(i+1);r+=e,a&&(n.search=n.search?`${n.search}&${a}`:a)}else r+=t;return Object.assign(n,{pathname:r}),n.toString()}function calculateQueryParameters(e,t,n){let r=new Map,i=new Set;if(e.queryParameters?.length)for(let a of e.queryParameters){a.mapper.type.name===`Sequence`&&a.mapper.serializedName&&i.add(a.mapper.serializedName);let o=getOperationArgumentValueFromParameter(t,a,n);if(o!=null||a.mapper.required){o=e.serializer.serialize(a.mapper,o,getPathStringFromParameter(a));let t=a.collectionFormat?Bs[a.collectionFormat]:``;if(Array.isArray(o)&&(o=o.map(e=>e??``)),a.collectionFormat===`Multi`&&o.length===0)continue;Array.isArray(o)&&(a.collectionFormat===`SSV`||a.collectionFormat===`TSV`)&&(o=o.join(t)),a.skipEncoding||(o=Array.isArray(o)?o.map(e=>encodeURIComponent(e)):encodeURIComponent(o)),Array.isArray(o)&&(a.collectionFormat===`CSV`||a.collectionFormat===`Pipes`)&&(o=o.join(t)),r.set(a.mapper.serializedName||getPathStringFromParameter(a),o)}}return{queryParams:r,sequenceParams:i}}function simpleParseQueryParams(e){let t=new Map;if(!e||e[0]!==`?`)return t;e=e.slice(1);let n=e.split(`&`);for(let e of n){let[n,r]=e.split(`=`,2),i=t.get(n);i?Array.isArray(i)?i.push(r):t.set(n,[i,r]):t.set(n,r)}return t}function appendQueryParams(e,t,n,r=!1){if(t.size===0)return e;let i=new URL(e),a=simpleParseQueryParams(i.search);for(let[e,i]of t){let t=a.get(e);if(Array.isArray(t)){if(Array.isArray(i)){t.push(...i);let n=new Set(t);a.set(e,Array.from(n))}else t.push(i)}else t?(Array.isArray(i)?i.unshift(t):n.has(e)&&a.set(e,[t,i]),r||a.set(e,i)):a.set(e,i)}let o=[];for(let[e,t]of a)if(typeof t==`string`)o.push(`${e}=${t}`);else if(Array.isArray(t))for(let n of t)o.push(`${e}=${n}`);else o.push(`${e}=${t}`);return i.search=o.length?`?${o.join(`&`)}`:``,i.toString()}const Vs=createClientLogger(`core-client`);var ServiceClient=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&Vs.warning(`The baseUri option for SDK Clients has been deprecated, please use endpoint instead.`),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||getCachedDefaultHttpClient$1(),this.pipeline=e.pipeline||createDefaultPipeline(e),e.additionalPolicies?.length)for(let{policy:t,position:n}of e.additionalPolicies){let e=n===`perRetry`?`Sign`:void 0;this.pipeline.addPolicy(t,{afterPhase:e})}}sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,t){let n=t.baseUrl||this._endpoint;if(!n)throw Error(`If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.`);let r=createPipelineRequest({url:getRequestUrl(n,t,e,this)});r.method=t.httpMethod;let i=getOperationRequestInfo(r);i.operationSpec=t,i.operationArguments=e;let a=t.contentType||this._requestContentType;a&&t.requestBody&&r.headers.set(`Content-Type`,a);let o=e.options;if(o){let e=o.requestOptions;e&&(e.timeout&&(r.timeout=e.timeout),e.onUploadProgress&&(r.onUploadProgress=e.onUploadProgress),e.onDownloadProgress&&(r.onDownloadProgress=e.onDownloadProgress),e.shouldDeserialize!==void 0&&(i.shouldDeserialize=e.shouldDeserialize),e.allowInsecureConnection&&(r.allowInsecureConnection=!0)),o.abortSignal&&(r.abortSignal=o.abortSignal),o.tracingOptions&&(r.tracingOptions=o.tracingOptions)}this._allowInsecureConnection&&(r.allowInsecureConnection=!0),r.streamResponseStatusCodes===void 0&&(r.streamResponseStatusCodes=getStreamingResponseStatusCodes(t));try{let e=await this.sendRequest(r),n=flattenResponse(e,t.responses[e.status]);return o?.onResponse&&o.onResponse(e,n),n}catch(e){if(typeof e==`object`&&e?.response){let n=e.response,r=flattenResponse(n,t.responses[e.statusCode]||t.responses.default);e.details=r,o?.onResponse&&o.onResponse(n,r,e)}throw e}}};function createDefaultPipeline(e){let t=getCredentialScopes(e),n=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return createClientPipeline({...e,credentialOptions:n})}function getCredentialScopes(e){if(e.credentialScopes)return e.credentialScopes;if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential)throw Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`)}const Hs={DefaultScope:`/.default`,HeaderConstants:{AUTHORIZATION:`authorization`}};function isUuid(e){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(e)}const authorizeRequestOnTenantChallenge=async e=>{let t=requestToOptions(e.request),n=getChallenge(e.response);if(n){let r=parseChallenge(n),i=buildScopes(e,r),a=extractTenantId(r);if(!a)return!1;let o=await e.getAccessToken(i,{...t,tenantId:a});return o?(e.request.headers.set(Hs.HeaderConstants.AUTHORIZATION,`${o.tokenType??`Bearer`} ${o.token}`),!0):!1}return!1};function extractTenantId(e){let t=new URL(e.authorization_uri).pathname.split(`/`)[1];if(t&&isUuid(t))return t}function buildScopes(e,t){if(!t.resource_id)return e.scopes;let n=new URL(t.resource_id),r=new URL(Hs.DefaultScope,n.origin).toString();return r===`https://disk.azure.com/.default`&&(r=`https://disk.azure.com//.default`),[r]}function getChallenge(e){let t=e.headers.get(`WWW-Authenticate`);if(e.status===401&&t)return t}function parseChallenge(e){return`${e.slice(7).trim()} `.split(` `).filter(e=>e).map(e=>(([e,t])=>({[e]:t}))(e.trim().split(`=`))).reduce((e,t)=>({...e,...t}),{})}function requestToOptions(e){return{abortSignal:e.abortSignal,requestOptions:{timeout:e.timeout},tracingOptions:e.tracingOptions}}const Us=Symbol(`Original PipelineRequest`),Ws=Symbol.for(`@azure/core-client original request`),Gs=new Set([`url`,`method`,`withCredentials`,`timeout`,`requestId`,`abortSignal`,`body`,`formData`,`onDownloadProgress`,`onUploadProgress`,`proxySettings`,`streamResponseStatusCodes`,`agent`,`requestOverrides`]);function toPipelineRequest(e,t={}){let n=e[Us],r=createHttpHeaders(e.headers.toJson({preserveCase:!0}));if(n)return n.headers=r,n;{let n=createPipelineRequest({url:e.url,method:e.method,headers:r,withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,disableKeepAlive:!!e.keepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides});return t.originalRequest&&(n[Ws]=t.originalRequest),n}}function toWebResourceLike(e,t){let n=t?.originalRequest??e,r={url:e.url,method:e.method,headers:toHttpHeadersLike(e.headers),withCredentials:e.withCredentials,timeout:e.timeout,requestId:e.headers.get(`x-ms-client-request-id`)||e.requestId,abortSignal:e.abortSignal,body:e.body,formData:e.formData,keepAlive:!!e.disableKeepAlive,onDownloadProgress:e.onDownloadProgress,onUploadProgress:e.onUploadProgress,proxySettings:e.proxySettings,streamResponseStatusCodes:e.streamResponseStatusCodes,agent:e.agent,requestOverrides:e.requestOverrides,clone(){throw Error(`Cannot clone a non-proxied WebResourceLike`)},prepare(){throw Error(`WebResourceLike.prepare() is not supported by @azure/core-http-compat`)},validateRequestProperties(){}};return t?.createProxy?new Proxy(r,{get(t,i,a){return i===Us?e:i===`clone`?()=>toWebResourceLike(toPipelineRequest(r,{originalRequest:n}),{createProxy:!0,originalRequest:n}):Reflect.get(t,i,a)},set(t,n,r,i){return n===`keepAlive`&&(e.disableKeepAlive=!r),typeof n==`string`&&Gs.has(n)&&(e[n]=r),Reflect.set(t,n,r,i)}}):r}function toHttpHeadersLike(e){return new Ks(e.toJSON({preserveCase:!0}))}function getHeaderKey(e){return e.toLowerCase()}var Ks=class HttpHeaders{_headersMap;constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t])}set(e,t){this._headersMap[getHeaderKey(e)]={name:e,value:t.toString()}}get(e){let t=this._headersMap[getHeaderKey(e)];return t?t.value:void 0}contains(e){return!!this._headersMap[getHeaderKey(e)]}remove(e){let t=this.contains(e);return delete this._headersMap[getHeaderKey(e)],t}rawHeaders(){return this.toJson({preserveCase:!0})}headersArray(){let e=[];for(let t in this._headersMap)e.push(this._headersMap[t]);return e}headerNames(){let e=[],t=this.headersArray();for(let n=0;ntoPipelineResponse(await e.sendRequest(toWebResourceLike(t,{createProxy:!0})))}}const Xs=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function getAllMatches(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e`&&e[a]!==` `&&e[a]!==` `&&e[a]!==` `&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!validateTagName(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,getErrorObject(`InvalidTag`,t,getLineNumberForPosition(e,a))}let l=readAttributeStr(e,a);if(l===!1)return getErrorObject(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,getLineNumberForPosition(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=validateAttributeString(u,t);if(i===!0)r=!0;else return getErrorObject(i.err.code,i.err.msg,getLineNumberForPosition(e,n+i.err.line))}else if(s){if(!l.tagClosed)return getErrorObject(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,getLineNumberForPosition(e,a));if(u.trim().length>0)return getErrorObject(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,getLineNumberForPosition(e,o));if(n.length===0)return getErrorObject(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,getLineNumberForPosition(e,o));{let t=n.pop();if(c!==t.tagName){let n=getLineNumberForPosition(e,t.tagStartPos);return getErrorObject(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,getLineNumberForPosition(e,o))}n.length==0&&(i=!0)}}else{let s=validateAttributeString(u,t);if(s!==!0)return getErrorObject(s.err.code,s.err.msg,getLineNumberForPosition(e,a-u.length+s.err.line));if(i===!0)return getErrorObject(`InvalidXml`,`Multiple possible root nodes found.`,getLineNumberForPosition(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a0?getErrorObject(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:getErrorObject(`InvalidXml`,`Start tag expected.`,1)}function isWhiteSpace(e){return e===` `||e===` `||e===` -`||e===`\r`}function readPI(e,t){let n=t;for(;t5&&r===`xml`)return getErrorObject(`InvalidXml`,`XML declaration allowed only at the start of the document.`,getLineNumberForPosition(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}continue}return t}function readCommentAndCDATA(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t`){t+=2;break}}return t}function readAttributeStr(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``&&{value:n,index:t,tagClosed:i}}const Us=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function validateAttributeString(e,t){let n=getAllMatches(e,Us),r={};for(let e=0;e`,lt:`<`,quot:`"`},Ks={nbsp:`\xA0`,copy:`©`,reg:`®`,trade:`™`,mdash:`—`,ndash:`–`,hellip:`…`,laquo:`«`,raquo:`»`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,bull:`•`,para:`¶`,sect:`§`,deg:`°`,frac12:`½`,frac14:`¼`,frac34:`¾`},qs=Object.freeze({ALLOW:`allow`,BLOCK:`block`,THROW:`throw`}),Js=new Set(`!?\\\\/[]$%{}^&*()<>|+`);function validateEntityName$1(e){if(e[0]===`#`)throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Js.has(t))throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function mergeEntityMaps(...e){let t=Object.create(null);for(let n of e)if(n)for(let e of Object.keys(n)){let r=n[e];if(typeof r==`string`)t[e]=r;else if(r&&typeof r==`object`&&r.val!==void 0){let n=r.val;typeof n==`string`&&(t[e]=n)}}return t}const Ys=`external`,Xs=`base`;function parseLimitTiers(e){return!e||e===Ys?new Set([Ys]):e===`all`?new Set([`all`]):e===Xs?new Set([Xs]):Array.isArray(e)?new Set(e):new Set([Ys])}const Zs=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Qs=new Set([9,10,13]);function parseNCRConfig(e){if(!e)return{xmlVersion:1,onLevel:Zs.allow,nullLevel:Zs.remove};let t=e.xmlVersion===1.1?1.1:1,n=Zs[e.onNCR]??Zs.allow,r=Zs[e.nullNCR]??Zs.remove;return{xmlVersion:t,onLevel:n,nullLevel:Math.max(r,Zs.remove)}}var EntityDecoder=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck==`function`?e.postCheck:e=>e,this._limitTiers=parseLimitTiers(this._limit.applyLimitsTo??Ys),this._numericAllowed=e.numericAllowed??!0,this._baseMap=mergeEntityMaps(Gs,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=parseNCRConfig(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel,this._onExternalEntity=typeof e.onExternalEntity==`function`?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity==`function`?e.onInputEntity:null}_applyRegistrationHook(e,t,n,r){if(!e)return!0;let i=e(t,n);if(i===qs.BLOCK)return!1;if(i===qs.THROW)throw Error(`[EntityDecoder] Registration of ${r} entity "&${t};" was rejected by hook`);return!0}setExternalEntities(e){if(e)for(let t of Object.keys(e))validateEntityName$1(t);if(!this._onExternalEntity){this._externalMap=mergeEntityMaps(e);return}let t=mergeEntityMaps(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onExternalEntity,e,r,`external`)&&(n[e]=r);this._externalMap=n}addExternalEntity(e,t){validateEntityName$1(e),typeof t==`string`&&t.indexOf(`&`)===-1&&this._applyRegistrationHook(this._onExternalEntity,e,t,`external`)&&(this._externalMap[e]=t)}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=mergeEntityMaps(e);return}let t=mergeEntityMaps(e),n=Object.create(null);for(let[e,r]of Object.entries(t))this._applyRegistrationHook(this._onInputEntity,e,r,`input`)&&(n[e]=r);this._inputMap=n}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!=`string`||e.length===0||e.indexOf(`&`)===-1)return e;let t=e,n=[],r=e.length,i=0,a=0,o=this._maxTotalExpansions>0,s=this._maxExpandedLength>0,c=o||s;for(;a=r||e.charCodeAt(t)!==59){a++;continue}let l=e.slice(a+1,t);if(l.length===0){a++;continue}let u,d;if(this._removeSet.has(l))u=``,d===void 0&&(d=Ys);else if(this._leaveSet.has(l)){a++;continue}else if(l.charCodeAt(0)===35){let e=this._resolveNCR(l);if(e===void 0){a++;continue}u=e,d=Xs}else{let e=this._resolveName(l);u=e?.value,d=e?.tier}if(u===void 0){a++;continue}if(a>i&&n.push(e.slice(i,a)),n.push(u),i=t+1,a=i,c&&this._tierCounts(d)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(s){let e=u.length-(l.length+2);if(e>0&&(this._expandedLength+=e,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Qs.has(e)?Zs.remove:-1}_applyNCRAction(e,t,n){switch(e){case Zs.allow:return String.fromCodePoint(n);case Zs.remove:return``;case Zs.leave:return;case Zs.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,`0`)})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(n=t===120||t===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let r=this._classifyNCR(n);if(!this._numericAllowed&&rBs.includes(e)?`__`+e:e,$s={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:defaultOnDangerousProperty};function validatePropertyName(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(Bs.some(e=>n===e.toLowerCase())||Vs.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function normalizeProcessEntities(e,t){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:`all`}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??`all`}:normalizeProcessEntities(!0)}const buildOptions=function(e){let t=Object.assign({},$s,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&validatePropertyName(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=defaultOnDangerousProperty),t.processEntities=normalizeProcessEntities(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t};let ec;ec=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var XmlNode=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][ec]={startIndex:t})}static getMetaDataSymbol(){return ec}};const buildRegexes=(e,t,n=``)=>{let r=`[${e.replace(`:`,``)}][${t.replace(`:`,``)}]*`;return{name:RegExp(`^[${e}][${t}]*$`,n),ncName:RegExp(`^${r}$`,n),qName:RegExp(`^${r}(?::${r})?$`,n),nmToken:RegExp(`^[${t}]+$`,n),nmTokens:RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`,n)}},tc=buildRegexes(`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,`:A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\\-\\.\\d·̀-ͯ‿-⁀`),nc=buildRegexes(`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,`:A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿\\-\\.\\d·̀-ͯ҇‿-⁀`,`u`),rc=buildRegexes(`:A-Za-z_`,`:A-Za-z_\\-\\.\\d`),getRegexes=(e=`1.0`,t=!1)=>t?rc:e===`1.1`?nc:tc,qName=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1}={})=>getRegexes(t,n).qName.test(e),ic=[`name`,`ncName`,`qName`,`nmToken`,`nmTokens`],createValidator=(e,{xmlVersion:t=`1.0`,asciiOnly:n=!1,maxCacheSize:r=2048}={})=>{if(!ic.includes(e))throw TypeError(`Unknown production "${e}". Must be one of: ${ic.join(`, `)}`);let i=getRegexes(t,n)[e],a=new Map,validator=e=>{let t=a.get(e);if(t!==void 0)return t;let n=i.test(e);return a.size{a=new Map},validator};var DocTypeReader=class{constructor(e,t){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=t||1}setXmlVersion(e=1){this.xmlVersion=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[i]=a,r++}}else if(a&&hasSeq(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&hasSeq(e,`!ATTLIST`,t))t+=8;else if(a&&hasSeq(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(hasSeq(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=skipWhitespace(e,t);let n=t;for(;tthis.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=skipWhitespace(e,t);let n=t;for(;t{for(;t=48&&i<=57||i===45)){if(i<1632){if(lc.has(i)){n=r;break}continue}if(i>=55296&&i<=56319){if(r+1=56320&&t<=57343){let e=65536+(i-55296<<10)+(t-56320);if(oc.has(e)){n=r;break}}}continue}if(cc[i-1632]!==255||lc.has(i)){n=r;break}}}if(n===-1)return e;let r=[];n>0&&r.push(e.slice(0,n));for(let i=n;i=48&&n<=57||n===45){r.push(e[i]);continue}if(n<1632){r.push(lc.has(n)?`-`:e[i]);continue}if(n>=55296&&n<=56319){if(i+1=56320&&t<=57343){let e=65536+(n-55296<<10)+(t-56320),a=oc.get(e);if(a!==void 0){r.push(String.fromCharCode(a+48)),i++;continue}}}r.push(e[i]);continue}if(lc.has(n)){r.push(`-`);continue}let a=cc[n-sc];r.push(a===255?e[i]:String.fromCharCode(a+48))}return r.join(``)}const uc=/^[-+]?0x[a-fA-F0-9]+$/,dc=/^0b[01]+$/,fc=/^0o[0-7]+$/,pc=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,mc={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`,unicode:!1};function toNumber(e,t={}){if(t=Object.assign({},mc,t),!e||typeof e!=`string`)return e;let n=e.trim();if(n.length===0||t.skipLike!==void 0&&t.skipLike.test(n))return e;if(n===`0`||t.unicode&&(n=anynum(n),n===`0`))return 0;if(t.hex&&uc.test(n))return parse_int(n,16);if(t.binary&&dc.test(n))return parse_int(n,2);if(t.octal&&fc.test(n))return parse_int(n,8);if(!isFinite(n))return handleInfinity(e,Number(n),t);if(n.includes(`e`)||n.includes(`E`))return resolveEnotation(e,n,t);{let r=pc.exec(n);if(r){let i=r[1]||``,a=r[2],o=trimZeros(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}return e}}const hc=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function resolveEnotation(e,t,n){if(!n.eNotation)return e;let r=t.match(hc);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}return e}function trimZeros(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function parse_int(e,t){let n=e.trim();if((t===2||t===8)&&(e=n.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function handleInfinity(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function getIgnoreAttributesFn$1(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Expression=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},Matcher=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new MatcherView(this),this._keptAttrs=[]}push(e,t=null,n=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length,a=this.siblingStacks[i];a||(a={counts:new Map,total:0},this.siblingStacks[i]=a);let o=n?`${n}:${e}`:e,s=a.counts.get(o)||0,c=a.total;a.counts.set(o,s+1),a.total++;let l={tag:e,position:c,counter:s};n!=null&&(l.namespace=n),t!=null&&(l.values=t),this.path.push(l);let u=this.path.length,d=r===null?null:r.keep;if(d!=null&&d.length>0&&t)for(let e=0;ethis.path.length+1&&(this.siblingStacks.length=this.path.length+1);let t=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=t;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return t[n].value}hasAnyParentAttr(e){let t=this._keptAttrs;for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let e=this.path.map(e=>e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--)if(this._matchSegment(r,this.path[e],e===this.path.length-1)){t=e-1,n--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),this._keptAttrs=(e.keptAttrs||[]).map(e=>({...e}))}readOnly(){return this._view}};const gc=[{id:`html-script-open`,description:`