diff --git a/.agents/skills/versioned-tool/SKILL.md b/.agents/skills/versioned-tool/SKILL.md index f1e837fe..a94717eb 100644 --- a/.agents/skills/versioned-tool/SKILL.md +++ b/.agents/skills/versioned-tool/SKILL.md @@ -16,6 +16,7 @@ This project manages external CLI tools through a **single-source-of-truth versi | OpenCode | `DEFAULT_OPENCODE_VERSION` | `opencode-version` | `github-releases` (`anomalyco/opencode`) | | oMo | `DEFAULT_OMO_VERSION` | `omo-version` | `npm` (`oh-my-openagent`) | | Bun | `DEFAULT_BUN_VERSION` | _(internal only)_ | `github-releases` (`oven-sh/bun`, extract `bun-v` prefix) | +| Systematic | `DEFAULT_SYSTEMATIC_VERSION` | `systematic-version` | `npm` (`@fro.bot/systematic`) | ## Quick Start diff --git a/.github/settings.yml b/.github/settings.yml index 207261eb..faeebea7 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -15,7 +15,7 @@ repository: allow_merge_commit: true allow_squash_merge: true allow_rebase_merge: false - delete_branch_on_merge: false + delete_branch_on_merge: true branches: - name: main diff --git a/AGENTS.md b/AGENTS.md index c61f5521..065c09ac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,18 +1,18 @@ # PROJECT KNOWLEDGE BASE -**Generated:** 2026-03-06 -**Commit:** 3985e1a +**Generated:** 2026-03-29 +**Commit:** 045cac8 **Branch:** main ## OVERVIEW -GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://github.com/code-yeongyu/oh-my-openagent) agents with **persistent session state** across CI runs. TypeScript, ESM-only, Node 24. +GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://github.com/code-yeongyu/oh-my-openagent) agents with **persistent session state** across CI runs. Includes bundled `@fro.bot/systematic` plugin injection during setup. TypeScript, ESM-only, Node 24. ## STRUCTURE ``` ./ -├── src/ # TypeScript source (132 source files, 13.6k lines) +├── src/ # TypeScript source (145 source files, 15.0k lines) │ ├── main.ts # Thin entry point → harness/run.ts │ ├── post.ts # Thin entry point → harness/post.ts │ ├── index.ts # Public API re-exports @@ -30,7 +30,10 @@ GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://githu │ ├── services/ # Layer 1: External adapters (GitHub, cache, session, setup) │ │ ├── github/ # Octokit client, context parsing, NormalizedEvent │ │ ├── session/ # Persistence layer (search, prune, storage, writeback) -│ │ ├── setup/ # Bun, oMo, OpenCode installation +│ │ ├── setup/ # Bun, oMo, OpenCode + Systematic config/install +│ │ │ ├── ci-config.ts # CI config assembly (extracted from setup.ts) +│ │ │ ├── systematic-config.ts # Systematic plugin config writer +│ │ │ └── adapters.ts # Extracted adapter factories │ │ └── cache/ # Cache restore/save with corruption detection │ ├── features/ # Layer 2: Business logic (agent, triggers, reviews, etc.) │ │ ├── agent/ # SDK execution, prompts, reactions, streaming @@ -55,27 +58,29 @@ GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://githu ## WHERE TO LOOK -| Task | Location | Notes | -| ---------------- | ---------------------------------- | -------------------------------------------------- | -| Add action logic | `src/harness/run.ts` | Main orchestration via phases | -| Post-action hook | `src/harness/post.ts` | Durable cache save (RFC-017) | -| Setup library | `src/services/setup/` | Bun/oMo/OpenCode installation (auto-setup) | -| Cache operations | `src/services/cache/` | `restore.ts`, `save.ts` | -| GitHub API | `src/services/github/client.ts` | `createClient()`, `createAppClient()` | -| Event parsing | `src/services/github/context.ts` | `parseGitHubContext()`, `normalizeEvent()` | -| Event types | `src/services/github/types.ts` | `NormalizedEvent` discriminated union (8 variants) | -| Agent execution | `src/features/agent/execution.ts` | `executeOpenCode()` logic | -| Prompt building | `src/features/agent/prompt.ts` | `buildAgentPrompt()`, response protocol sections | -| Session storage | `src/services/session/` | `storage.ts`, `storage-mappers.ts` | -| Session search | `src/services/session/search.ts` | `listSessions()`, `searchSessions()` | -| Event routing | `src/features/triggers/router.ts` | `routeEvent()` orchestration | -| Context hydrate | `src/features/context/` | GraphQL/REST issue/PR data (RFC-015) | -| Comment posting | `src/features/comments/writer.ts` | `postComment()`, GraphQL mutations | -| PR reviews | `src/features/reviews/reviewer.ts` | `submitReview()`, line comments | -| Input parsing | `src/harness/config/inputs.ts` | `parseActionInputs()` returns Result | -| Logging | `src/shared/logger.ts` | `createLogger()` with redaction | -| Core types | `src/shared/types.ts` | `ActionInputs`, `CacheResult`, `RunContext` | -| Build config | `tsdown.config.ts` | ESM shim, bundled deps, license extraction | +| Task | Location | Notes | +| --- | --- | --- | +| Add action logic | `src/harness/run.ts` | Main orchestration via phases | +| Post-action hook | `src/harness/post.ts` | Durable cache save (RFC-017) | +| Setup library | `src/services/setup/` | Bun/oMo/OpenCode installation (auto-setup) | +| CI config | `src/services/setup/ci-config.ts` | `buildCIConfig()` — assembles OPENCODE_CONFIG_CONTENT | +| Systematic config | `src/services/setup/systematic-config.ts` | `writeSystematicConfig()` — plugin config writer | +| Cache operations | `src/services/cache/` | `restore.ts`, `save.ts` | +| GitHub API | `src/services/github/client.ts` | `createClient()`, `createAppClient()` | +| Event parsing | `src/services/github/context.ts` | `parseGitHubContext()`, `normalizeEvent()` | +| Event types | `src/services/github/types.ts` | `NormalizedEvent` discriminated union (8 variants) | +| Agent execution | `src/features/agent/execution.ts` | `executeOpenCode()` logic | +| Prompt building | `src/features/agent/prompt.ts` | `buildAgentPrompt()`, response protocol sections | +| Session storage | `src/services/session/` | `storage.ts`, `storage-mappers.ts` | +| Session search | `src/services/session/search.ts` | `listSessions()`, `searchSessions()` | +| Event routing | `src/features/triggers/router.ts` | `routeEvent()` orchestration | +| Context hydrate | `src/features/context/` | GraphQL/REST issue/PR data (RFC-015) | +| Comment posting | `src/features/comments/writer.ts` | `postComment()`, GraphQL mutations | +| PR reviews | `src/features/reviews/reviewer.ts` | `submitReview()`, line comments | +| Input parsing | `src/harness/config/inputs.ts` | `parseActionInputs()` returns Result | +| Logging | `src/shared/logger.ts` | `createLogger()` with redaction | +| Core types | `src/shared/types.ts` | `ActionInputs`, `CacheResult`, `RunContext` | +| Build config | `tsdown.config.ts` | ESM shim, bundled deps, license extraction | ## CODE MAP @@ -84,6 +89,8 @@ GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://githu | `run` | Function | `src/harness/run.ts` | Main entry, phase orchestration | | `runPost` | Function | `src/harness/post.ts` | Post-action cache save | | `runSetup` | Function | `src/services/setup/setup.ts` | Setup orchestration | +| `buildCIConfig` | Function | `src/services/setup/ci-config.ts` | CI config assembly with plugin injection | +| `writeSystematicConfig` | Function | `src/services/setup/systematic-config.ts` | Systematic plugin config writer | | `restoreCache` | Function | `src/services/cache/restore.ts` | Restore OpenCode state | | `saveCache` | Function | `src/services/cache/save.ts` | Persist state to cache | | `executeOpenCode` | Function | `src/features/agent/execution.ts` | SDK execution orchestration | @@ -100,6 +107,7 @@ GitHub Action harness for [OpenCode](https://opencode.ai/) + [oMo](https://githu | `submitReview` | Function | `src/features/reviews/reviewer.ts` | Submit PR review | | `parseActionInputs` | Function | `src/harness/config/inputs.ts` | Parse/validate inputs | | `createLogger` | Function | `src/shared/logger.ts` | Logger with redaction | +| `DEFAULT_SYSTEMATIC_VERSION` | Constant | `src/shared/constants.ts` | Pinned Systematic version | | `ActionInputs` | Interface | `src/shared/types.ts` | Input schema | | `NormalizedEvent` | Union | `src/services/github/types.ts` | 8-variant discriminated event union | | `TriggerDirective` | Interface | `src/features/agent/prompt.ts` | Directive + appendMode for triggers | @@ -126,18 +134,18 @@ post.ts → harness/post.ts ## COMPLEXITY HOTSPOTS -| File | Lines | Reason | -| --------------------------------- | ----- | ----------------------------------------- | -| `features/triggers/__fixtures__/` | 627 | Factory-style payload generation | -| `features/agent/prompt.ts` | 420 | Prompt templates, trigger directives | -| `services/session/types.ts` | 292 | Session/message/part type hierarchy | -| `features/context/types.ts` | 279 | GraphQL context types, budget constraints | -| `features/comments/reader.ts` | 257 | Thread reading, pagination | -| `services/github/api.ts` | 255 | Reactions, labels, branch discovery | -| `services/setup/setup.ts` | 247 | Setup orchestration | -| `services/github/context.ts` | 226 | normalizeEvent() 8-variant union builder | -| `harness/config/inputs.ts` | 224 | Input parsing and validation | -| `services/session/search.ts` | 220 | Session listing and cross-session search | +| File | Lines | Reason | +| --------------------------------- | ----- | ------------------------------------------------------ | +| `features/triggers/__fixtures__/` | 627 | Factory-style payload generation | +| `features/agent/prompt.ts` | 512 | Prompt templates, trigger directives | +| `services/session/types.ts` | 292 | Session/message/part type hierarchy | +| `services/github/api.ts` | 289 | Reactions, labels, branch discovery | +| `features/context/types.ts` | 279 | GraphQL context types, budget constraints | +| `features/comments/reader.ts` | 257 | Thread reading, pagination | +| `services/github/context.ts` | 254 | normalizeEvent() 8-variant union builder | +| `harness/config/inputs.ts` | 247 | Input parsing and validation | +| `services/session/search.ts` | 220 | Session listing and cross-session search | +| `services/setup/setup.ts` | 209 | Refactored setup orchestration (split config/adapters) | ## CONVENTIONS @@ -181,6 +189,7 @@ pnpm build # Type check + bundle to dist/ (must stay in sync) - **Node 24 required**: Matches `action.yaml` runtime - **19 RFCs total**: Foundation, cache, GitHub client, sessions, triggers, security, observability, comments, PR review, delegated work, setup, execution, SDK mode, file attachments, GraphQL context, additional triggers, post-action hook, plugin, S3 backend - **SDK-based execution**: Uses `@opencode-ai/sdk` for server lifecycle + event streaming +- **Bundled Systematic plugin**: Setup injects `@fro.bot/systematic@` into CI OpenCode config by default - **Persistent memory**: Sessions survive across CI runs via GitHub Actions cache - **NormalizedEvent**: All webhook payloads pass through `normalizeEvent()` before routing; router never touches raw payloads - **Dual action entry points**: `main.ts` (execution) and `post.ts` (durable cache save) diff --git a/README.md b/README.md index 2ab80369..b107c24f 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,7 @@ concurrency: | `aws-region` | No | — | AWS region for S3 bucket | | `skip-cache` | No | `false` | Skip cache restore (useful for debugging) | | `omo-config` | No | — | Custom oMo configuration JSON (deep-merged) | +| `systematic-config` | No | — | Custom Systematic configuration JSON (deep-merged) | | `opencode-config` | No | — | Custom OpenCode configuration JSON (deep-merged) | ### Action Outputs diff --git a/action.yaml b/action.yaml index 1edf35cb..bfc5337f 100644 --- a/action.yaml +++ b/action.yaml @@ -67,6 +67,9 @@ inputs: Custom oMo configuration JSON. Written before installer runs. Deep-merged with existing config. required: false + systematic-config: + description: Custom Systematic plugin configuration JSON (deep-merged with existing config). + required: false dedup-window: description: >- Deduplication window in milliseconds. Skip execution if the agent already diff --git a/dist/artifact-DnDoCHSt.js b/dist/artifact-DhOKZxjK.js similarity index 87% rename from dist/artifact-DnDoCHSt.js rename to dist/artifact-DhOKZxjK.js index 8c6c3a75..b35eae0f 100644 --- a/dist/artifact-DnDoCHSt.js +++ b/dist/artifact-DhOKZxjK.js @@ -13,75 +13,75 @@ Content-Type: ${c.type||`application/octet-stream`}\r\n\r\n`);a.push(e,c,o),type ${n.count} ${n.noun} ${n.is} pending: ${e.format(t)} -`.trim())}}})),Mt=U(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=ke(),i=lt();o()===void 0&&a(new i);function a(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 o(){return globalThis[n]}t.exports={setGlobalDispatcher:a,getGlobalDispatcher:o}})),Nt=U(((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)}}})),Pt=U(((e,t)=>{let n=tt();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)}}})),Ft=U(((e,t)=>{let n=ft();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),It=U(((e,t)=>{let n=Me(),{InvalidArgumentError:r,RequestAbortedError:i}=ke(),a=Nt();var o=class extends a{#e=1024*1024;#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 s({maxSize:e}={maxSize:1024*1024}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new o({maxSize:i},r))}}t.exports=s})),Lt=U(((e,t)=>{let{isIP:n}=W(`node:net`),{lookup:r}=W(`node:dns`),i=Nt(),{InvalidArgumentError:a,InformationalError:o}=ke(),s=2**31-1;var c=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,typeof e.ttl==`number`?e.ttl=Math.min(e.ttl,this.#e):e.ttl=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 l(this,e,t)}},l=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);break}}};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 c({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)}}})),Rt=U(((e,t)=>{let{kConstruct:n}=Oe(),{kEnumerableProperty:r}=Me(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=qe(),{webidl:s}=Ke(),c=W(`node:assert`),l=W(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function f(e){return e===10||e===13||e===9||e===32}function p(e){let t=0,n=e.length;for(;n>t&&f(e.charCodeAt(n-1));)--n;for(;n>t&&f(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function m(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function h(e,t,n){if(n=p(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(b(e)===`immutable`)throw TypeError(`immutable`);return S(e).append(t,n,!1)}function g(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}else{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(g)}}},y=class e{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new v,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),m(this,e)))}append(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.append`);let r=`Headers.append`;return t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),h(this,t,n)}delete(t){if(s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.delete`),t=s.converters.ByteString(t,`Headers.delete`,`name`),!a(t))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.get`);let n=`Headers.get`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.get(t,!1)}has(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.has`);let n=`Headers.has`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.contains(t,!1)}set(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.set`);let r=`Headers.set`;if(t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),n=p(n),!a(t))throw s.errors.invalidArgument({prefix:r,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:r,value:n,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(t,n,!1)}getSetCookie(){s.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}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:m,compareHeaderName:g,Headers:y,HeadersList:v,getHeadersGuard:b,setHeadersGuard:x,setHeadersList:C,getHeadersList:S}})),zt=U(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Rt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=Qe(),m=Me(),h=W(`node:util`),{kEnumerableProperty:g}=m,{isValidReasonPhrase:v,isCancelled:y,isAborted:b,isBlobLike:x,serializeJavascriptValueToJSONString:S,isErrorLike:C,isomorphicEncode:w,environmentSettingsObject:T}=qe(),{redirectStatusSet:E,nullBodyStatus:D}=Ue(),{kState:O,kHeaders:k}=Je(),{webidl:A}=Ke(),{FormData:j}=Xe(),{URLSerializer:M}=Ge(),{kConstruct:N}=Oe(),P=W(`node:assert`),{types:F}=W(`node:util`),I=new TextEncoder(`utf-8`);var L=class e{static error(){return re(ee(),`immutable`)}static json(e,t={}){A.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=A.converters.ResponseInit(t));let n=c(I.encode(S(e))),r=re(z({}),`response`);return H(r,t,{body:n[0],type:`application/json`}),r}static redirect(e,t=302){A.argumentLengthCheck(arguments,1,`Response.redirect`),e=A.converters.USVString(e),t=A.converters[`unsigned short`](t);let n;try{n=new URL(e,T.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!E.has(t))throw RangeError(`Invalid status code ${t}`);let r=re(z({}),`immutable`);r[O].status=t;let i=w(M(n));return r[O].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(A.util.markAsUncloneable(this),e===N)return;e!==null&&(e=A.converters.BodyInit(e)),t=A.converters.ResponseInit(t),this[O]=z({}),this[k]=new n(N),o(this[k],`response`),s(this[k],this[O].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}H(this,t,r)}get type(){return A.brandCheck(this,e),this[O].type}get url(){A.brandCheck(this,e);let t=this[O].urlList,n=t[t.length-1]??null;return n===null?``:M(n,!0)}get redirected(){return A.brandCheck(this,e),this[O].urlList.length>1}get status(){return A.brandCheck(this,e),this[O].status}get ok(){return A.brandCheck(this,e),this[O].status>=200&&this[O].status<=299}get statusText(){return A.brandCheck(this,e),this[O].statusText}get headers(){return A.brandCheck(this,e),this[k]}get body(){return A.brandCheck(this,e),this[O].body?this[O].body.stream:null}get bodyUsed(){return A.brandCheck(this,e),!!this[O].body&&m.isDisturbed(this[O].body.stream)}clone(){if(A.brandCheck(this,e),p(this))throw A.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=R(this[O]);return d&&this[O].body?.stream&&f.register(this,new WeakRef(this[O].body.stream)),re(t,a(this[k]))}[h.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 ${h.formatWithOptions(t,n)}`}};u(L),Object.defineProperties(L.prototype,{type:g,url:g,status:g,ok:g,redirected:g,statusText:g,headers:g,clone:g,body:g,bodyUsed:g,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(L,{json:g,redirect:g,error:g});function R(e){if(e.internalResponse)return V(R(e.internalResponse),e.type);let t=z({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function z(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 ee(e){return z({type:`error`,status:0,error:C(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function B(e){return e.type===`error`&&e.status===0}function te(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 P(!(n in t)),e[n]=r,!0}})}function V(e,t){if(t===`basic`)return te(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return te(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return te(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return te(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});P(!1)}function ne(e,t=null){return P(y(e)),b(e)?ee(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):ee(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function H(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&&!v(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[O].status=t.status),`statusText`in t&&t.statusText!=null&&(e[O].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[k],t.headers),n){if(D.includes(e.status))throw A.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[O].body=n.body,n.type!=null&&!e[O].headersList.contains(`content-type`,!0)&&e[O].headersList.append(`content-type`,n.type,!0)}}function re(e,t){let r=new L(N);return r[O]=e,r[k]=new n(N),s(r[k],e.headersList),o(r[k],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}A.converters.ReadableStream=A.interfaceConverter(ReadableStream),A.converters.FormData=A.interfaceConverter(j),A.converters.URLSearchParams=A.interfaceConverter(URLSearchParams),A.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?A.converters.USVString(e,t,n):x(e)?A.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||F.isArrayBuffer(e)?A.converters.BufferSource(e,t,n):m.isFormDataLike(e)?A.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?A.converters.URLSearchParams(e,t,n):A.converters.DOMString(e,t,n)},A.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?A.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:A.converters.XMLHttpRequestBodyInit(e,t,n)},A.converters.ResponseInit=A.dictionaryConverter([{key:`status`,converter:A.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:A.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:A.converters.HeadersInit}]),t.exports={isNetworkError:B,makeNetworkError:ee,makeResponse:z,makeAppropriateNetworkError:ne,filterResponse:V,Response:L,cloneResponse:R,fromInnerResponse:re}})),Bt=U(((e,t)=>{let{kConnected:n,kSize:r}=Oe();var i=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},a=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:i,FinalizationRegistry:a}):{WeakRef,FinalizationRegistry}}})),Vt=U(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=Qe(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Rt(),{FinalizationRegistry:p}=Bt()(),m=Me(),h=W(`node:util`),{isValidHTTPToken:g,sameOrigin:v,environmentSettingsObject:y}=qe(),{forbiddenMethodsSet:b,corsSafeListedMethodsSet:x,referrerPolicy:S,requestRedirect:C,requestMode:w,requestCredentials:T,requestCache:E,requestDuplex:D}=Ue(),{kEnumerableProperty:O,normalizedMethodRecordsBase:k,normalizedMethodRecords:A}=m,{kHeaders:j,kSignal:M,kState:N,kDispatcher:P}=Je(),{webidl:F}=Ke(),{URLSerializer:I}=Ge(),{kConstruct:L}=Oe(),R=W(`node:assert`),{getMaxListeners:z,setMaxListeners:ee,getEventListeners:B,defaultMaxListeners:te}=W(`node:events`),V=Symbol(`abortController`),ne=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),H=new WeakMap;function re(e){return t;function t(){let n=e.deref();if(n!==void 0){ne.unregister(t),this.removeEventListener(`abort`,t),n.abort(this.reason);let e=H.get(n.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()}H.delete(n.signal)}}}}let ie=!1;var ae=class e{constructor(t,r={}){if(F.util.markAsUncloneable(this),t===L)return;let i=`Request constructor`;F.argumentLengthCheck(arguments,1,i),t=F.converters.RequestInfo(t,i,`input`),r=F.converters.RequestInit(r,i,`init`);let u=null,p=null,h=y.settingsObject.baseUrl,S=null;if(typeof t==`string`){this[P]=r.dispatcher;let e;try{e=new URL(t,h)}catch(e){throw TypeError(`Failed to parse URL from `+t,{cause:e})}if(e.username||e.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+t);u=oe({urlList:[e]}),p=`cors`}else this[P]=r.dispatcher||t[P],R(t instanceof e),u=t[N],S=t[M];let C=y.settingsObject.origin,w=`client`;if(u.window?.constructor?.name===`EnvironmentSettingsObject`&&v(u.window,C)&&(w=u.window),r.window!=null)throw TypeError(`'window' option '${w}' must be null`);`window`in r&&(w=`no-window`),u=oe({method:u.method,headersList:u.headersList,unsafeRequest:u.unsafeRequest,client:y.settingsObject,window:w,priority:u.priority,origin:u.origin,referrer:u.referrer,referrerPolicy:u.referrerPolicy,mode:u.mode,credentials:u.credentials,cache:u.cache,redirect:u.redirect,integrity:u.integrity,keepalive:u.keepalive,reloadNavigation:u.reloadNavigation,historyNavigation:u.historyNavigation,urlList:[...u.urlList]});let T=Object.keys(r).length!==0;if(T&&(u.mode===`navigate`&&(u.mode=`same-origin`),u.reloadNavigation=!1,u.historyNavigation=!1,u.origin=`client`,u.referrer=`client`,u.referrerPolicy=``,u.url=u.urlList[u.urlList.length-1],u.urlList=[u.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)u.referrer=`no-referrer`;else{let t;try{t=new URL(e,h)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||C&&!v(t,y.settingsObject.baseUrl)?u.referrer=`client`:u.referrer=t}}r.referrerPolicy!==void 0&&(u.referrerPolicy=r.referrerPolicy);let E;if(E=r.mode===void 0?p:r.mode,E===`navigate`)throw F.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(E!=null&&(u.mode=E),r.credentials!==void 0&&(u.credentials=r.credentials),r.cache!==void 0&&(u.cache=r.cache),u.cache===`only-if-cached`&&u.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(u.redirect=r.redirect),r.integrity!=null&&(u.integrity=String(r.integrity)),r.keepalive!==void 0&&(u.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method,t=A[e];if(t!==void 0)u.method=t;else{if(!g(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(b.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=k[t]??e,u.method=e}!ie&&u.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`}),ie=!0)}r.signal!==void 0&&(S=r.signal),this[N]=u;let D=new AbortController;if(this[M]=D.signal,S!=null){if(!S||typeof S.aborted!=`boolean`||typeof S.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(S.aborted)D.abort(S.reason);else{this[V]=D;let e=re(new WeakRef(D));try{(typeof z==`function`&&z(S)===te||B(S,`abort`).length>=te)&&ee(1500,S)}catch{}m.addAbortListener(S,e),ne.register(D,{signal:S,abort:e},e)}}if(this[j]=new o(L),d(this[j],u.headersList),l(this[j],`request`),E===`no-cors`){if(!x.has(u.method))throw TypeError(`'${u.method} is unsupported in no-cors mode.`);l(this[j],`request-no-cors`)}if(T){let e=f(this[j]),t=r.headers===void 0?new c(e):r.headers;if(e.clear(),t instanceof c){for(let{name:n,value:r}of t.rawValues())e.append(n,r,!1);e.cookies=t.cookies}else s(this[j],t)}let O=t instanceof e?t[N].body:null;if((r.body!=null||O!=null)&&(u.method===`GET`||u.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let I=null;if(r.body!=null){let[e,t]=n(r.body,u.keepalive);I=e,t&&!f(this[j]).contains(`content-type`,!0)&&this[j].append(`content-type`,t)}let H=I??O;if(H!=null&&H.source==null){if(I!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(u.mode!==`same-origin`&&u.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);u.useCORSPreflightFlag=!0}let ae=H;if(I==null&&O!=null){if(a(t))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let e=new TransformStream;O.stream.pipeThrough(e),ae={source:O.source,length:O.length,stream:e.readable}}this[N].body=ae}get method(){return F.brandCheck(this,e),this[N].method}get url(){return F.brandCheck(this,e),I(this[N].url)}get headers(){return F.brandCheck(this,e),this[j]}get destination(){return F.brandCheck(this,e),this[N].destination}get referrer(){return F.brandCheck(this,e),this[N].referrer===`no-referrer`?``:this[N].referrer===`client`?`about:client`:this[N].referrer.toString()}get referrerPolicy(){return F.brandCheck(this,e),this[N].referrerPolicy}get mode(){return F.brandCheck(this,e),this[N].mode}get credentials(){return this[N].credentials}get cache(){return F.brandCheck(this,e),this[N].cache}get redirect(){return F.brandCheck(this,e),this[N].redirect}get integrity(){return F.brandCheck(this,e),this[N].integrity}get keepalive(){return F.brandCheck(this,e),this[N].keepalive}get isReloadNavigation(){return F.brandCheck(this,e),this[N].reloadNavigation}get isHistoryNavigation(){return F.brandCheck(this,e),this[N].historyNavigation}get signal(){return F.brandCheck(this,e),this[M]}get body(){return F.brandCheck(this,e),this[N].body?this[N].body.stream:null}get bodyUsed(){return F.brandCheck(this,e),!!this[N].body&&m.isDisturbed(this[N].body.stream)}get duplex(){return F.brandCheck(this,e),`half`}clone(){if(F.brandCheck(this,e),a(this))throw TypeError(`unusable`);let t=se(this[N]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let e=H.get(this.signal);e===void 0&&(e=new Set,H.set(this.signal,e));let t=new WeakRef(n);e.add(t),m.addAbortListener(n.signal,re(t))}return ce(t,n.signal,u(this[j]))}[h.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 ${h.formatWithOptions(t,n)}`}};r(ae);function oe(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 se(e){let t=oe({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function ce(e,t,n){let r=new ae(L);return r[N]=e,r[M]=t,r[j]=new o(L),d(r[j],e.headersList),l(r[j],n),r}Object.defineProperties(ae.prototype,{method:O,url:O,headers:O,redirect:O,clone:O,signal:O,duplex:O,destination:O,body:O,bodyUsed:O,isHistoryNavigation:O,isReloadNavigation:O,keepalive:O,integrity:O,cache:O,credentials:O,attribute:O,referrerPolicy:O,referrer:O,mode:O,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),F.converters.Request=F.interfaceConverter(ae),F.converters.RequestInfo=function(e,t,n){return typeof e==`string`?F.converters.USVString(e,t,n):e instanceof ae?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:S},{key:`mode`,converter:F.converters.DOMString,allowedValues:w},{key:`credentials`,converter:F.converters.DOMString,allowedValues:T},{key:`cache`,converter:F.converters.DOMString,allowedValues:E},{key:`redirect`,converter:F.converters.DOMString,allowedValues:C},{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:D},{key:`dispatcher`,converter:F.converters.any}]),t.exports={Request:ae,makeRequest:oe,fromInnerRequest:ce,cloneRequest:se}})),Ht=U(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=zt(),{HeadersList:s}=Rt(),{Request:c,cloneRequest:l}=Vt(),u=W(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:m,TAOCheck:h,appendRequestOriginHeader:g,responseLocationURL:v,requestCurrentURL:y,setRequestReferrerPolicyOnRedirect:b,tryUpgradeRequestToAPotentiallyTrustworthyURL:x,createOpaqueTimingInfo:S,appendFetchMetadata:C,corsCheck:w,crossOriginResourcePolicyCheck:T,determineRequestsReferrer:E,coarsenedSharedCurrentTime:D,createDeferredPromise:O,isBlobLike:k,sameOrigin:A,isCancelled:j,isAborted:M,isErrorLike:N,fullyReadBody:P,readableStreamClose:F,isomorphicEncode:I,urlIsLocal:L,urlIsHttpHttpsScheme:R,urlHasHttpsScheme:z,clampAndCoarsenConnectionTimingInfo:ee,simpleRangeHeaderValue:B,buildContentRange:te,createInflate:V,extractMimeType:ne}=qe(),{kState:H,kDispatcher:re}=Je(),ie=W(`node:assert`),{safelyExtractBody:ae,extractBody:oe}=Qe(),{redirectStatusSet:se,nullBodyStatus:ce,safeMethodsSet:le,requestBodyHeader:ue,subresourceSet:U}=Ue(),de=W(`node:events`),{Readable:fe,pipeline:pe,finished:me}=W(`node:stream`),{addAbortListener:he,isErrored:ge,isReadable:_e,bufferToLowerCasedHeaderName:ve}=Me(),{dataURLProcessor:ye,serializeAMimeType:be,minimizeSupportedMimeType:xe}=Ge(),{getGlobalDispatcher:Se}=Mt(),{webidl:Ce}=Ke(),{STATUS_CODES:we}=W(`node:http`),Te=[`GET`,`HEAD`],Ee=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,De;var Oe=class extends de{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 ke(e){je(e,`fetch`)}function Ae(e,t=void 0){Ce.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=O(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[H];if(r.signal.aborted)return Pe(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 he(r.signal,()=>{s=!0,ie(l!=null),l.abort(r.signal.reason);let e=a?.deref();Pe(n,i,e,r.signal.reason)}),l=Fe({request:i,processResponseEndOfBody:ke,processResponse:e=>{if(!s){if(e.aborted){Pe(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[re]}),n.promise}function je(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;R(n)&&r!==null&&(e.timingAllowPassed||(r=S({startTime:r.startTime}),i=``),r.endTime=D(),e.timingInfo=r,Ne(r,n.href,t,globalThis,i))}let Ne=performance.markResourceTiming;function Pe(e,t,n,r){if(e&&e.reject(r),t.body!=null&&_e(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[H];i.body!=null&&_e(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function Fe({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=Se()}){ie(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=S({startTime:D(l)}),d={controller:new Oe(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return ie(!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.client==null?e.policyContainer=f():e.policyContainer=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,U.has(e.destination),Ie(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Ie(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!L(y(r))&&(a=n(`local URLs only`)),x(r),m(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=E(r)),a===null&&(a=await(async()=>{let t=y(r);return A(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await Le(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await Le(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):R(y(r))?(r.responseTainting=`cors`,await Be(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`):ie(!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`||ce.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let t=t=>ze(e,n(t));if(r.responseTainting===`opaque`||a.body==null){t(a.error);return}await P(a.body,n=>{if(!d(n,r.integrity)){t(`integrity mismatch`);return}a.body=ae(n)[0],ze(e,a)},t)}else ze(e,a)}function Le(e){if(j(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=y(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{De||=W(`node:buffer`).resolveObjectURL;let e=y(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=De(e.toString());if(t.method!==`GET`||!k(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=I(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=B(t.headersList.get(`range`,!0),!0);if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:a,rangeEndValue:s}=e;if(a===null)a=o-s,s=a+s-1;else{if(a>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(s===null||s>=o)&&(s=o-1)}let l=r.slice(a,s,c);i.body=oe(l)[0];let u=I(`${l.size}`),d=te(a,s,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,u,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,d,!0)}else{let e=oe(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=ye(y(t));if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let r=be(e.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:r}]],body:ae(e.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return Be(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function Re(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function ze(e,t){let n=e.timingInfo,r=()=>{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=S(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=ne(t.headersList);e!==`failure`&&(a.contentType=xe(e))}e.request.initiatorType!=null&&Ne(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let i=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>i())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let i=t.type===`error`?t:t.internalResponse??t;i.body==null?r():me(i.body.stream,()=>{r()})}async function Be(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 He(e),t.responseTainting===`cors`&&w(t,r)===`failure`)return n(`cors failure`);h(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&T(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(se.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 Ve(e,r):ie(!1)),r.timingInfo=a,r)}function Ve(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=v(i,y(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!R(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)&&!A(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&&!Te.includes(r.method)){r.method=`GET`,r.body=null;for(let e of ue)r.headersList.delete(e)}A(y(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&&(ie(r.body.source!=null),r.body=ae(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=D(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),b(r,i),Ie(e,!0)}async function He(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=I(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,I(s.referrer.href),!0),g(s),C(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,Ee),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)||(z(y(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 We(o,u,i);!le.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():j(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(j(e))return r(e);e.controller.connection.destroy(),c=await He(e,t,!0)}return c}async function We(e,t=!1,i=!1){ie(!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 t=async function*(t){j(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{j(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{j(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await g({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 f=async()=>{await e.controller.resume()},p=t=>{j(e)||e.controller.abort(t)},m=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)},type:`bytes`});c.body={stream:m,source:null,length:null},e.controller.onAborted=h,e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(M(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),Re(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),ge(m)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function h(t){M(e)?(c.aborted=!0,_e(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):_e(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:N(t)?t:void 0})),e.controller.connection.destroy()}return c;function g({body:t}){let n=y(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=ee(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=D(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=D(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(V({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?pe(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`)}})),Wt=U(((e,t)=>{let{webidl:n}=Ke(),r=Symbol(`ProgressEvent state`);var i=class e 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,e),this[r].lengthComputable}get loaded(){return n.brandCheck(this,e),this[r].loaded}get total(){return n.brandCheck(this,e),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}})),Gt=U(((e,t)=>{function n(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:n}})),Kt=U(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Ut(),{ProgressEvent:s}=Wt(),{getEncoding:c}=Gt(),{serializeAMimeType:l,parseMIMEType:u}=Ge(),{types:d}=W(`node:util`),{StringDecoder:f}=W(`string_decoder`),{btoa:p}=W(`node:buffer`),m={enumerable:!0,writable:!1,configurable:!1};function h(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:m,value:h}=await f;if(p&&!e[a]&&queueMicrotask(()=>{g(`loadstart`,e)}),p=!1,!m&&d.isUint8Array(h))u.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{g(`progress`,e)})),f=l.read();else if(m){queueMicrotask(()=>{e[n]=`done`;try{let n=v(u,s,t.type,c);if(e[a])return;e[i]=n,g(`load`,e)}catch(t){e[r]=t,g(`error`,e)}e[n]!==`loading`&&g(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,g(`error`,e),e[n]!==`loading`&&g(`loadend`,e)});break}})()}function g(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function v(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`),y(e,t)}case`ArrayBuffer`:return x(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 y(e,t){let n=x(e),r=b(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 b(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 x(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:m,readOperation:h,fireAProgressEvent:g}})),qt=U(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=Kt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Ut(),{webidl:u}=Ke(),{kEnumerableProperty:d}=Me();var f=class e 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(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`BinaryString`)}readAsText(t,n=void 0){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n,`FileReader.readAsText`,`encoding`)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`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,e),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,e),this[s]}get error(){return u.brandCheck(this,e),this[o]}get onloadend(){return u.brandCheck(this,e),this[c].loadend}set onloadend(t){u.brandCheck(this,e),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof t==`function`?(this[c].loadend=t,this.addEventListener(`loadend`,t)):this[c].loadend=null}get onerror(){return u.brandCheck(this,e),this[c].error}set onerror(t){u.brandCheck(this,e),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof t==`function`?(this[c].error=t,this.addEventListener(`error`,t)):this[c].error=null}get onloadstart(){return u.brandCheck(this,e),this[c].loadstart}set onloadstart(t){u.brandCheck(this,e),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof t==`function`?(this[c].loadstart=t,this.addEventListener(`loadstart`,t)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,e),this[c].progress}set onprogress(t){u.brandCheck(this,e),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof t==`function`?(this[c].progress=t,this.addEventListener(`progress`,t)):this[c].progress=null}get onload(){return u.brandCheck(this,e),this[c].load}set onload(t){u.brandCheck(this,e),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof t==`function`?(this[c].load=t,this.addEventListener(`load`,t)):this[c].load=null}get onabort(){return u.brandCheck(this,e),this[c].abort}set onabort(t){u.brandCheck(this,e),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof t==`function`?(this[c].abort=t,this.addEventListener(`abort`,t)):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}})),Jt=U(((e,t)=>{t.exports={kConstruct:Oe().kConstruct}})),Yt=U(((e,t)=>{let n=W(`node:assert`),{URLSerializer:r}=Ge(),{isValidHeaderName:i}=qe();function a(e,t,n=!1){return r(e,n)===r(t,n)}function o(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:a,getFieldValues:o}})),Xt=U(((e,t)=>{let{kConstruct:n}=Jt(),{urlEquals:r,getFieldValues:i}=Yt(),{kEnumerableProperty:a,isDisturbed:o}=Me(),{webidl:s}=Ke(),{Response:c,cloneResponse:l,fromInnerResponse:u}=zt(),{Request:d,fromInnerRequest:f}=Vt(),{kState:p}=Je(),{fetching:m}=Ht(),{urlIsHttpHttpsScheme:h,createDeferredPromise:g,readAllBytes:v}=qe(),y=W(`node:assert`);var b=class e{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){s.brandCheck(this,e);let r=`Cache.match`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=this.#i(t,n,1);if(i.length!==0)return i[0]}async matchAll(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.matchAll`;return t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`),this.#i(t,n)}async add(t){s.brandCheck(this,e);let n=`Cache.add`;s.argumentLengthCheck(arguments,1,n),t=s.converters.RequestInfo(t,n,`request`);let r=[t];return await this.addAll(r)}async addAll(t){s.brandCheck(this,e);let n=`Cache.addAll`;s.argumentLengthCheck(arguments,1,n);let r=[],a=[];for(let e of t){if(e===void 0)throw s.errors.conversionFailed({prefix:n,argument:`Argument 1`,types:[`undefined is not allowed`]});if(e=s.converters.RequestInfo(e),typeof e==`string`)continue;let t=e[p];if(!h(t.url)||t.method!==`GET`)throw s.errors.exception({header:n,message:`Expected http/s scheme when method is not GET.`})}let o=[];for(let e of t){let t=new d(e)[p];if(!h(t.url))throw s.errors.exception({header:n,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,a.push(t);let c=g();o.push(m({request:t,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 o)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),r.push(c.promise)}let c=await Promise.all(r),l=[],u=0;for(let e of c){let t={type:`put`,request:a[u],response:e};l.push(t),u++}let f=g(),v=null;try{this.#t(l)}catch(e){v=e}return queueMicrotask(()=>{v===null?f.resolve(void 0):f.reject(v)}),f.promise}async put(t,n){s.brandCheck(this,e);let r=`Cache.put`;s.argumentLengthCheck(arguments,2,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.Response(n,r,`response`);let a=null;if(a=t instanceof d?t[p]:new d(t)[p],!h(a.url)||a.method!==`GET`)throw s.errors.exception({header:r,message:`Expected an http/s scheme when method is not GET`});let c=n[p];if(c.status===206)throw s.errors.exception({header:r,message:`Got 206 status`});if(c.headersList.contains(`vary`)){let e=i(c.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:r,message:`Got * vary field value`})}if(c.body&&(o(c.body.stream)||c.body.stream.locked))throw s.errors.exception({header:r,message:`Response body is locked or disturbed`});let u=l(c),f=g();c.body==null?f.resolve(void 0):v(c.body.stream.getReader()).then(f.resolve,f.reject);let m=[],y={type:`put`,request:a,response:u};m.push(y);let b=await f.promise;u.body!=null&&(u.body.source=b);let x=g(),S=null;try{this.#t(m)}catch(e){S=e}return queueMicrotask(()=>{S===null?x.resolve():x.reject(S)}),x.promise}async delete(t,n={}){s.brandCheck(this,e);let r=`Cache.delete`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return!1}else y(typeof t==`string`),i=new d(t)[p];let a=[],o={type:`delete`,request:i,options:n};a.push(o);let c=g(),l=null,u;try{u=this.#t(a)}catch(e){l=e}return queueMicrotask(()=>{l===null?c.resolve(!!u?.length):c.reject(l)}),c.promise}async keys(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.keys`;t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t!==void 0)if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(i=new d(t)[p]);let a=g(),o=[];if(t===void 0)for(let e of this.#e)o.push(e[0]);else{let e=this.#n(i,n);for(let t of e)o.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of o){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}a.resolve(Object.freeze(e))}),a.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);y(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(!h(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);y(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(b.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let x=[{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(x),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...x,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:b}})),Zt=U(((e,t)=>{let{kConstruct:n}=Jt(),{Cache:r}=Xt(),{webidl:i}=Ke(),{kEnumerableProperty:a}=Me();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),t=i.converters.RequestInfo(t),a=i.converters.MultiCacheQueryOptions(a),a.cacheName!=null){if(this.#e.has(a.cacheName))return await new r(n,this.#e.get(a.cacheName)).match(t,a)}else for(let e of this.#e.values()){let i=await new r(n,e).match(t,a);if(i!==void 0)return i}}async has(t){i.brandCheck(this,e);let n=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.has(t)}async open(t){i.brandCheck(this,e);let a=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,a),t=i.converters.DOMString(t,a,`cacheName`),this.#e.has(t))return new r(n,this.#e.get(t));let o=[];return this.#e.set(t,o),new r(n,o)}async delete(t){i.brandCheck(this,e);let n=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.delete(t)}async keys(){return i.brandCheck(this,e),[...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}})),Qt=U(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),$t=U(((e,t)=>{function n(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function r(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 i(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 a(e){for(let t=0;tt.toString().padStart(2,`0`));function u(e){return typeof e==`number`&&(e=new Date(e)),`${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`}function d(e){if(e<0)throw Error(`Invalid cookie max-age`)}function f(e){if(e.name.length===0)return null;r(e.name),i(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`&&(d(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(o(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(a(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${u(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(`=`);t.push(`${e.trim()}=${r.join(`=`)}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab:n,validateCookieName:r,validateCookiePath:a,validateCookieValue:i,toIMFDate:u,stringify:f}})),en=U(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=Qt(),{isCTLExcludingHtab:i}=$t(),{collectASequenceOfCodePointsFast:a}=Ge(),o=W(`node:assert`);function s(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,...c(r)}}function c(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 c(e,t);let l=i.toLowerCase();if(l===`expires`)t.expires=new Date(s);else if(l===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return c(e,t);t.maxAge=Number(s)}else if(l===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(l===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(l===`secure`)t.secure=!0;else if(l===`httponly`)t.httpOnly=!0;else if(l===`samesite`){let e=`Default`,n=s.toLowerCase();n.includes(`none`)&&(e=`None`),n.includes(`strict`)&&(e=`Strict`),n.includes(`lax`)&&(e=`Lax`),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return c(e,t)}t.exports={parseSetCookie:s,parseUnparsedAttributes:c}})),tn=U(((e,t)=>{let{parseSetCookie:n}=en(),{stringify:r}=$t(),{webidl:i}=Ke(),{Headers:a}=Rt();function o(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 s(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),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function l(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:o,deleteCookie:s,getSetCookies:c,setCookie:l}})),nn=U(((e,t)=>{let{webidl:n}=Ke(),{kEnumerableProperty:r}=Me(),{kConstruct:i}=Oe(),{MessagePort:a}=W(`node:worker_threads`);var o=class e 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,e),this.#e.data}get origin(){return n.brandCheck(this,e),this.#e.origin}get lastEventId(){return n.brandCheck(this,e),this.#e.lastEventId}get source(){return n.brandCheck(this,e),this.#e.source}get ports(){return n.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,r=!1,i=!1,a=null,o=``,s=``,c=null,l=[]){return n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}static createFastMessageEvent(t,n){let r=new e(i,t,n);return r.#e=n,r.#e.data??=null,r.#e.origin??=``,r.#e.lastEventId??=``,r.#e.source??=null,r.#e.ports??=[],r}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class e 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,e),this.#e.wasClean}get code(){return n.brandCheck(this,e),this.#e.code}get reason(){return n.brandCheck(this,e),this.#e.reason}},l=class e 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,e),this.#e.message}get filename(){return n.brandCheck(this,e),this.#e.filename}get lineno(){return n.brandCheck(this,e),this.#e.lineno}get colno(){return n.brandCheck(this,e),this.#e.colno}get error(){return n.brandCheck(this,e),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}})),rn=U(((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}}})),an=U(((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`)}})),on=U(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=an(),{states:s,opcodes:c}=rn(),{ErrorEvent:l,createFastMessageEvent:u}=nn(),{isUtf8:d}=W(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=Ge();function m(e){return e[n]===s.CONNECTING}function h(e){return e[n]===s.OPEN}function g(e){return e[n]===s.CLOSING}function v(e){return e[n]===s.CLOSED}function y(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function b(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=N(r)}catch{w(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):x(r));y(`message`,e,u,{origin:e[o].origin,data:i})}function x(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function S(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 C(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function w(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&y(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function T(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function E(e){return e===c.CONTINUATION}function D(e){return e===c.TEXT||e===c.BINARY}function O(e){return D(e)||E(e)||T(e)}function k(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 j=typeof process.versions.icu==`string`,M=j?new TextDecoder(`utf-8`,{fatal:!0}):void 0,N=j?M.decode.bind(M):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting:m,isEstablished:h,isClosing:g,isClosed:v,fireEvent:y,isValidSubprotocol:S,isValidStatusCode:C,failWebsocketConnection:w,websocketMessageReceived:b,utf8Decode:N,isControlFrame:T,isContinuationFrame:E,isTextBinaryFrame:D,isValidOpcode:O,parseExtensions:k,isValidClientWindowBits:A}})),sn=U(((e,t)=>{let{maxUnsigned16Bit:n}=rn(),r=16386,i,a=null,o=r;try{i=W(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;tn?(o+=8,a=127):i>125&&(o+=2,a=126);let c=Buffer.allocUnsafe(i+o);c[0]=c[1]=0,c[0]|=128,c[0]=(c[0]&240)+e,c[o-4]=r[0],c[o-3]=r[1],c[o-2]=r[2],c[o-1]=r[3],c[1]=a,a===126?c.writeUInt16BE(i,2):a===127&&(c[2]=c[3]=0,c.writeUIntBE(i,4,6)),c[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=rn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=an(),{fireEvent:f,failWebsocketConnection:p,isClosing:m,isClosed:h,isEstablished:g,parseExtensions:v}=on(),{channels:y}=Ne(),{CloseEvent:b}=nn(),{makeRequest:x}=Vt(),{fetching:S}=Ht(),{Headers:C,getHeadersList:w}=Rt(),{getDecodeSplit:T}=qe(),{WebsocketFrameSend:E}=sn(),D;try{D=W(`node:crypto`)}catch{}function O(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=x({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=w(new C(o.headers)));let l=D.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`),S({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`)!==D.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=v(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&&!T(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,A),e.socket.on(`close`,j),e.socket.on(`error`,M),y.open.hasSubscribers&&y.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function k(e,t,n,l){if(!(m(e)||h(e)))if(!g(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 E;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 A(e){this.ws[l].write(e)||this.pause()}function j(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,A),t.socket.off(`close`,j),t.socket.off(`error`,M);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 b(e,t),{wasClean:n,code:a,reason:o}),y.close.hasSubscribers&&y.close.publish({websocket:e,code:a,reason:o})}function M(e){let{ws:t}=this;t[s]=r.CLOSING,y.socketError.hasSubscribers&&y.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:O,closeWebSocketConnection:k}})),ln=U(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=W(`node:zlib`),{isValidClientWindowBits:i}=on(),{MessageSizeExceededError:a}=ke(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=!1;#r=null;constructor(e){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`)}decompress(e,t,l){if(this.#n){l(new a);return}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.#n){if(this.#e[c]+=e.length,this.#e[c]>4194304){if(this.#n=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#r){let e=this.#r;this.#r=null,e(new a)}return}this.#e[s].push(e)}}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#r=l,this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(this.#n||!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,this.#r=null,l(null,e)})}}}})),un=U(((e,t)=>{let{Writable:n}=W(`node:stream`),r=W(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=rn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=an(),{channels:p}=Ne(),{isValidStatusCode:m,isValidOpcode:h,failWebsocketConnection:g,websocketMessageReceived:v,utf8Decode:y,isControlFrame:b,isTextBinaryFrame:x,isContinuationFrame:S}=on(),{WebsocketFrameSend:C}=sn(),{closeWebSocketConnection:w}=cn(),{PerMessageDeflate:T}=ln();t.exports={ByteParser:class extends n{#e=[];#t=0;#n=!1;#r=i.INFO;#i={};#a=[];#o;constructor(e,t){super(),this.ws=e,this.#o=t??new Map,this.#o.has(`permessage-deflate`)&&this.#o.set(`permessage-deflate`,new T(t))}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#r===i.INFO){if(this.#t<2)return e();let t=this.consume(2),n=(t[0]&128)!=0,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(!h(r))return g(this.ws,`Invalid opcode received`),e();if(o)return g(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#o.has(`permessage-deflate`)){g(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){g(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!x(r)){g(this.ws,`Invalid frame type was fragmented.`);return}if(x(r)&&this.#a.length>0){g(this.ws,`Expected continuation frame`);return}if(this.#i.fragmented&&s){g(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&b(r)){g(this.ws,`Control frame either too large or fragmented`);return}if(S(r)&&this.#a.length===0&&!this.#i.compressed){g(this.ws,`Unexpected continuation frame`);return}c<=125?(this.#i.payloadLength=c,this.#r=i.READ_DATA):c===126?this.#r=i.PAYLOADLENGTH_16:c===127&&(this.#r=i.PAYLOADLENGTH_64),x(r)&&(this.#i.binaryType=r,this.#i.compressed=l!==0),this.#i.opcode=r,this.#i.masked=o,this.#i.fin=n,this.#i.fragmented=s}else if(this.#r===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#i.payloadLength=t.readUInt16BE(0),this.#r=i.READ_DATA}else if(this.#r===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){g(this.ws,`Received payload length > 2^31 bytes.`);return}this.#i.payloadLength=r,this.#r=i.READ_DATA}else if(this.#r===i.READ_DATA){if(this.#t{if(t){g(this.ws,t.message);return}if(this.#a.push(n),!this.#i.fin){this.#r=i.INFO,this.#n=!0,this.run(e);return}v(this.ws,this.#i.binaryType,Buffer.concat(this.#a)),this.#n=!0,this.#r=i.INFO,this.#a.length=0,this.run(e)}),this.#n=!1;break}else{if(this.#a.push(t),!this.#i.fragmented&&this.#i.fin){let e=Buffer.concat(this.#a);v(this.ws,this.#i.binaryType,e),this.#a.length=0}this.#r=i.INFO}}}consume(e){if(e>this.#t)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#t-=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}else if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}else t.set(this.#e.shift(),n),n+=r.length}return this.#t-=e,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!m(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=y(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.#i;if(t===a.CLOSE){if(n===1)return g(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:e,reason:t}=this.#i.closeInfo;return w(this.ws,e,t,t.length),g(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#i.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#i.closeInfo.code,0));let t=new C(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}else if(t===a.PING){if(!this.ws[f]){let t=new C(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.#i.closeInfo}}}})),dn=U(((e,t)=>{let{WebsocketFrameSend:n}=sn(),{opcodes:r,sendHints:i}=rn(),a=it(),o=Buffer[Symbol.species];var s=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=c(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=c(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 c(e,t){return new n(l(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function l(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:s}})),fn=U(((e,t)=>{let{webidl:n}=Ke(),{URLSerializer:r}=Ge(),{environmentSettingsObject:i}=qe(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=rn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:m,kByteParser:h}=an(),{isConnecting:g,isEstablished:v,isClosing:y,isValidSubprotocol:b,fireEvent:x}=on(),{establishWebSocketConnection:S,closeWebSocketConnection:C}=cn(),{ByteParser:w}=un(),{kEnumerableProperty:T,isBlobLike:E}=Me(),{getGlobalDispatcher:D}=Mt(),{types:O}=W(`node:util`),{ErrorEvent:k,CloseEvent:A}=nn(),{SendQueue:j}=dn();var M=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(t,r=[]){super(),n.util.markAsUncloneable(this);let a=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,a);let o=n.converters[`DOMString or sequence or WebSocketInit`](r,a,`options`);t=n.converters.USVString(t,a,`url`),r=o.protocols;let c=i.settingsObject.baseUrl,p;try{p=new URL(t,c)}catch(e){throw new DOMException(e,`SyntaxError`)}if(p.protocol===`http:`?p.protocol=`ws:`:p.protocol===`https:`&&(p.protocol=`wss:`),p.protocol!==`ws:`&&p.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${p.protocol}`,`SyntaxError`);if(p.hash||p.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof r==`string`&&(r=[r]),r.length!==new Set(r.map(e=>e.toLowerCase())).size||r.length>0&&!r.every(e=>b(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(p.href);let h=i.settingsObject;this[d]=S(p,r,h,this,(e,t)=>this.#a(e,t),o),this[u]=e.CONNECTING,this[m]=s.NOT_SENT,this[f]=`blob`}close(t=void 0,r=void 0){n.brandCheck(this,e);let i=`WebSocket.close`;if(t!==void 0&&(t=n.converters[`unsigned short`](t,i,`code`,{clamp:!0})),r!==void 0&&(r=n.converters.USVString(r,i,`reason`)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let a=0;if(r!==void 0&&(a=Buffer.byteLength(r),a>123))throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);C(this,t,r,a)}send(t){n.brandCheck(this,e);let r=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,r),t=n.converters.WebSocketSendData(t,r,`data`),g(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!v(this)||y(this)))if(typeof t==`string`){let e=Buffer.byteLength(t);this.#t+=e,this.#i.add(t,()=>{this.#t-=e},c.string)}else O.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.typedArray)):E(t)&&(this.#t+=t.size,this.#i.add(t,()=>{this.#t-=t.size},c.blob))}get readyState(){return n.brandCheck(this,e),this[u]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),r(this[l])}get extensions(){return n.brandCheck(this,e),this.#r}get protocol(){return n.brandCheck(this,e),this.#n}get onopen(){return n.brandCheck(this,e),this.#e.open}set onopen(t){n.brandCheck(this,e),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof t==`function`?(this.#e.open=t,this.addEventListener(`open`,t)):this.#e.open=null}get onerror(){return n.brandCheck(this,e),this.#e.error}set onerror(t){n.brandCheck(this,e),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof t==`function`?(this.#e.error=t,this.addEventListener(`error`,t)):this.#e.error=null}get onclose(){return n.brandCheck(this,e),this.#e.close}set onclose(t){n.brandCheck(this,e),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof t==`function`?(this.#e.close=t,this.addEventListener(`close`,t)):this.#e.close=null}get onmessage(){return n.brandCheck(this,e),this.#e.message}set onmessage(t){n.brandCheck(this,e),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof t==`function`?(this.#e.message=t,this.addEventListener(`message`,t)):this.#e.message=null}get binaryType(){return n.brandCheck(this,e),this[f]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[f]=`blob`:this[f]=t}#a(e,t){this[p]=e;let n=new w(this,t);n.on(`drain`,N),n.on(`error`,P.bind(this)),e.socket.ws=this,this[h]=n,this.#i=new j(e.socket),this[u]=o.OPEN;let r=e.headersList.get(`sec-websocket-extensions`);r!==null&&(this.#r=r);let i=e.headersList.get(`sec-websocket-protocol`);i!==null&&(this.#n=i),x(`open`,this)}};M.CONNECTING=M.prototype.CONNECTING=o.CONNECTING,M.OPEN=M.prototype.OPEN=o.OPEN,M.CLOSING=M.prototype.CLOSING=o.CLOSING,M.CLOSED=M.prototype.CLOSED=o.CLOSED,Object.defineProperties(M.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:T,readyState:T,bufferedAmount:T,onopen:T,onerror:T,onclose:T,close:T,onmessage:T,binaryType:T,send:T,extensions:T,protocol:T,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(M,{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:()=>D()},{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(E(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||O.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function N(){this.ws[p].socket.resume()}function P(e){let t,n;e instanceof A?(t=e.reason,n=e.code):t=e.message,x(`error`,this,()=>new k(`error`,{error:e,message:t})),C(this,n)}t.exports={WebSocket:M}})),pn=U(((e,t)=>{function n(e){return e.indexOf(`\0`)===-1}function r(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function i(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId:n,isASCIINumber:r,delay:i}})),mn=U(((e,t)=>{let{Transform:n}=W(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=pn(),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]):this.buffer=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;break}for(;this.pos0&&(t[a]=o);break}}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}}}}})),hn=U(((e,t)=>{let{pipeline:n}=W(`node:stream`),{fetching:r}=Ht(),{makeRequest:i}=Vt(),{webidl:a}=Ke(),{EventSourceStream:o}=mn(),{parseMIMEType:s}=Ge(),{createFastMessageEvent:c}=nn(),{isNetworkError:l}=zt(),{delay:u}=pn(),{kEnumerableProperty:d}=Me(),{environmentSettingsObject:f}=qe(),p=!1,m=3e3;var h=class e 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:m};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}else{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,e),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 g={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(h,g),Object.defineProperties(h.prototype,g),Object.defineProperties(h.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:h,defaultReconnectionTime:m}})),gn=U(((e,t)=>{let n=rt(),r=Fe(),i=st(),a=ct(),o=lt(),s=ut(),c=dt(),l=pt(),u=ke(),d=Me(),{InvalidArgumentError:f}=u,p=St(),m=Re(),h=Dt(),g=jt(),v=Ot(),y=Ct(),b=ft(),{getGlobalDispatcher:x,setGlobalDispatcher:S}=Mt(),C=Nt(),w=tt(),T=nt();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=b,t.exports.DecoratorHandler=C,t.exports.RedirectHandler=w,t.exports.createRedirectInterceptor=T,t.exports.interceptors={redirect:Pt(),retry:Ft(),dump:It(),dns:Lt()},t.exports.buildConnector=m,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function E(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=x()}=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=S,t.exports.getGlobalDispatcher=x;let D=Ht().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=Rt().Headers,t.exports.Response=zt().Response,t.exports.Request=Vt().Request,t.exports.FormData=Xe().FormData,t.exports.File=globalThis.File??W(`node:buffer`).File,t.exports.FileReader=qt().FileReader;let{setGlobalOrigin:O,getGlobalOrigin:k}=We();t.exports.setGlobalOrigin=O,t.exports.getGlobalOrigin=k;let{CacheStorage:A}=Zt(),{kConstruct:j}=Jt();t.exports.caches=new A(j);let{deleteCookie:M,getCookies:N,getSetCookies:P,setCookie:F}=tn();t.exports.deleteCookie=M,t.exports.getCookies=N,t.exports.getSetCookies=P,t.exports.setCookie=F;let{parseMIMEType:I,serializeAMimeType:L}=Ge();t.exports.parseMIMEType=I,t.exports.serializeAMimeType=L;let{CloseEvent:R,ErrorEvent:z,MessageEvent:ee}=nn();t.exports.WebSocket=fn().WebSocket,t.exports.CloseEvent=R,t.exports.ErrorEvent=z,t.exports.MessageEvent=ee,t.exports.request=E(p.request),t.exports.stream=E(p.stream),t.exports.pipeline=E(p.pipeline),t.exports.connect=E(p.connect),t.exports.upgrade=E(p.upgrade),t.exports.MockClient=h,t.exports.MockPool=v,t.exports.MockAgent=g,t.exports.mockErrors=y;let{EventSource:B}=hn();t.exports.EventSource=B})),_n=pe(De(),1),vn=gn(),yn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},bn;(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`})(bn||={});var xn;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(xn||={});var Sn;(function(e){e.ApplicationJson=`application/json`})(Sn||={});const Cn=[bn.MovedPermanently,bn.ResourceMoved,bn.SeeOther,bn.TemporaryRedirect,bn.PermanentRedirect],wn=[bn.BadGateway,bn.ServiceUnavailable,bn.GatewayTimeout],Tn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var En=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}},Dn=class{constructor(e){this.message=e}readBody(){return yn(this,void 0,void 0,function*(){return new Promise(e=>yn(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 yn(this,void 0,void 0,function*(){return new Promise(e=>yn(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},On=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 yn(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return yn(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return yn(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return yn(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return yn(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return yn(this,arguments,void 0,function*(e,t={}){t[xn.Accept]=this._getExistingOrDefaultHeader(t,xn.Accept,Sn.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return yn(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&&Tn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===bn.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&&Cn.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||!wn.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}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 i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new Dn(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=Se(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?g:h;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({},kn(this.requestOptions.headers),kn(e||{})):kn(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=kn(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=kn(this.requestOptions.headers)[xn.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[xn.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=Se(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||h.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?_n.httpsOverHttps:_n.httpsOverHttp:o?_n.httpOverHttps:_n.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new g.Agent(e):new h.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 vn.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(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 yn(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 yn(this,void 0,void 0,function*(){return new Promise((n,r)=>yn(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===bn.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new En(e,i);t.result=a.result,r(t)}else n(a)}))})}};const kn=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var An=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},jn=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 An(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},Mn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{access:Nn,appendFile:Pn,writeFile:Fn}=l,In=`GITHUB_STEP_SUMMARY`,Ln=new class{constructor(){this._buffer=``}filePath(){return Mn(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,s.R_OK|s.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 Mn(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 Mn(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(i)}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 Rn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{chmod:zn,copyFile:Bn,lstat:Vn,mkdir:Hn,open:Un,readdir:Wn,rename:Gn,rm:Kn,rmdir:qn,stat:Jn,symlink:Yn,unlink:Xn}=o.promises,Zn=process.platform===`win32`;function Qn(e){return Rn(this,void 0,void 0,function*(){let t=yield o.promises.readlink(e);return Zn&&!t.endsWith(`\\`)?`${t}\\`:t})}o.constants.O_RDONLY;function $n(e){return Rn(this,void 0,void 0,function*(){try{yield Jn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function er(e){if(e=nr(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Zn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function tr(e,t){return Rn(this,void 0,void 0,function*(){let n;try{n=yield Jn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Zn){let n=f.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(rr(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield Jn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Zn){try{let t=f.dirname(e),n=f.basename(e).toUpperCase();for(let r of yield Wn(t))if(n===r.toUpperCase()){e=f.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else if(rr(n))return e}}return``})}function nr(e){return e||=``,Zn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function rr(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 ir=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function ar(e,t){return ir(this,arguments,void 0,function*(e,t,n={}){let{force:r,recursive:i,copySourceDirectory:a}=ur(n),o=(yield $n(t))?yield Jn(t):null;if(o&&o.isFile()&&!r)return;let s=o&&o.isDirectory()&&a?f.join(t,f.basename(e)):t;if(!(yield $n(e)))throw Error(`no such file or directory: ${e}`);if((yield Jn(e)).isDirectory())if(i)yield dr(e,s,0,r);else throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);else{if(f.relative(e,s)===``)throw Error(`'${s}' and '${e}' are the same file`);yield fr(e,s,r)}})}function or(e){return ir(this,void 0,void 0,function*(){if(Zn&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield Kn(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw Error(`File was unable to be removed ${e}`)}})}function sr(e){return ir(this,void 0,void 0,function*(){x(e,`a path argument must be provided`),yield Hn(e,{recursive:!0})})}function cr(e,t){return ir(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield cr(e,!1);if(!t)throw Error(Zn?`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 lr(e);return n&&n.length>0?n[0]:``})}function lr(e){return ir(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Zn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(f.delimiter))e&&t.push(e);if(er(e)){let n=yield tr(e,t);return n?[n]:[]}if(e.includes(f.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(f.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield tr(f.join(i,e),t);n&&r.push(n)}return r})}function ur(e){return{force:e.force==null?!0:e.force,recursive:!!e.recursive,copySourceDirectory:e.copySourceDirectory==null?!0:!!e.copySourceDirectory}}function dr(e,t,n,r){return ir(this,void 0,void 0,function*(){if(n>=255)return;n++,yield sr(t);let i=yield Wn(e);for(let a of i){let i=`${e}/${a}`,o=`${t}/${a}`;(yield Vn(i)).isDirectory()?yield dr(i,o,n,r):yield fr(i,o,r)}yield zn(t,(yield Jn(e)).mode)})}function fr(e,t,n){return ir(this,void 0,void 0,function*(){if((yield Vn(e)).isSymbolicLink()){try{yield Vn(t),yield Xn(t)}catch(e){e.code===`EPERM`&&(yield zn(t,`0666`),yield Xn(t))}yield Yn(yield Qn(e),t,Zn?`junction`:null)}else (!(yield $n(t))||n)&&(yield Bn(e,t))})}var pr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const mr=process.platform===`win32`;var hr=class extends v.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(mr)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,t,r){try{let i=t+e.toString(),a=i.indexOf(n.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+n.EOL.length),a=i.indexOf(n.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return mr&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(mr&&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 pr(this,void 0,void 0,function*(){return!er(this.toolPath)&&(this.toolPath.includes(`/`)||mr&&this.toolPath.includes(`\\`))&&(this.toolPath=f.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield cr(this.toolPath,!0),new Promise((e,t)=>pr(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)+n.EOL);let i=new _r(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield $n(this.options.cwd)))return t(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`,(n,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),n?t(n):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function gr(e){let t=[],n=!1,r=!1,i=``;function a(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let o=0;o0&&(t.push(i),i=``);continue}a(s)}return i.length>0&&t.push(i.trim()),t}var _r=class e extends v.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(e.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()}}},vr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function yr(e,t,n){return vr(this,void 0,void 0,function*(){let r=gr(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 hr(i,t,n).exec()})}function br(e,t,n){return vr(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 yr(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}r.platform(),r.arch();var xr;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(xr||={});function Sr(e,t){let n=me(t);if(process.env[e]=n,process.env.GITHUB_ENV)return be(`ENV`,xe(e,t));ge(`set-env`,{name:e},n)}function Cr(e){ge(`add-mask`,{},e)}function wr(e){process.env.GITHUB_PATH?be(`PATH`,e):ge(`add-path`,{},e),process.env.PATH=`${e}${f.delimiter}${process.env.PATH}`}function Tr(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 Er(e,t){if(process.env.GITHUB_OUTPUT)return be(`OUTPUT`,xe(e,t));process.stdout.write(n.EOL),ge(`set-output`,{name:e},me(t))}function Dr(e){process.exitCode=xr.Failure,kr(e)}function Or(){return process.env.RUNNER_DEBUG===`1`}function G(e){ge(`debug`,{},e)}function kr(e,t={}){ge(`error`,he(t),e instanceof Error?e.toString():e)}function Ar(e,t={}){ge(`warning`,he(t),e instanceof Error?e.toString():e)}function jr(e){process.stdout.write(e+n.EOL)}function Mr(e,t){if(process.env.GITHUB_STATE)return be(`STATE`,xe(e,t));ge(`save-state`,{name:e},me(t))}function Nr(e){return process.env[`STATE_${e}`]||``}function Pr(e){return e instanceof Error?e.message:String(e)}const Fr=[`token`,`password`,`secret`,`key`,`auth`,`credential`,`bearer`,`apikey`,`api_key`,`access_token`,`refresh_token`,`private`];function Ir(e,t){let n=e.toLowerCase();return t.some(e=>n.includes(e.toLowerCase()))}function Lr(e,t=Fr){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Lr(e,t));let n={};for(let[r,i]of Object.entries(e))Ir(r,t)&&typeof i==`string`?n[r]=`[REDACTED]`:typeof i==`object`&&i?n[r]=Lr(i,t):n[r]=i;return n}function Rr(e,t,n,r){let i=Lr({...n,...r}),a={timestamp:new Date().toISOString(),level:e,message:t,...i};if(r!=null&&`error`in r&&r.error instanceof Error){let e=r.error;a.error={message:e.message,name:e.name,stack:e.stack}}return JSON.stringify(a)}function zr(e){return{debug:(t,n)=>{G(Rr(`debug`,t,e,n))},info:(t,n)=>{jr(Rr(`info`,t,e,n))},warning:(t,n)=>{Ar(Rr(`warning`,t,e,n))},error:(t,n)=>{kr(Rr(`error`,t,e,n))}}}const Br={SHOULD_SAVE_CACHE:`shouldSaveCache`,SESSION_ID:`sessionId`,CACHE_SAVED:`cacheSaved`,ARTIFACT_UPLOADED:`artifactUploaded`,OPENCODE_VERSION:`opencodeVersion`},Vr=`sisyphus`,Hr=18e5,Ur={providerID:`opencode`,modelID:`big-pickle`},Wr=`1.3.6`,Gr=`1.3.11`,Kr=`3.14.0`,qr=`2.1.0`,Jr=`opencode-storage`,Yr=`opencode-tools`,Xr=6e5,Zr=`fro-bot-dedup-v1`;function Qr(){let e=t.env.XDG_DATA_HOME;return e!=null&&e.trim().length>0?e:F.join(I.homedir(),`.local`,`share`)}function $r(){return F.join(Qr(),`opencode`,`storage`)}function ei(){return F.join(Qr(),`opencode`,`auth.json`)}function ti(){return F.join(Qr(),`opencode`,`log`)}function ni(){let e=t.env.OPENCODE_PROMPT_ARTIFACT;return e===`true`||e===`1`}function ri(){let e=t.env.RUNNER_OS;if(e!=null&&e.trim().length>0)return e;switch(I.platform()){case`darwin`:return`macOS`;case`win32`:return`Windows`;case`aix`:case`android`:case`freebsd`:case`haiku`:case`linux`:case`openbsd`:case`sunos`:case`cygwin`:case`netbsd`:return`Linux`}}function ii(){let e=t.env.GITHUB_REPOSITORY;return e!=null&&e.trim().length>0?e:`unknown/unknown`}function ai(){let e=t.env.GITHUB_REF_NAME;return e!=null&&e.trim().length>0?e:`main`}function oi(){let e=t.env.GITHUB_RUN_ID;return e!=null&&e.trim().length>0?Number(e):0}function si(){let e=t.env.GITHUB_RUN_ATTEMPT;if(e!=null&&e.trim().length>0){let t=Number(e);if(Number.isFinite(t)&&t>0)return t}return 1}function ci(){let e=t.env.GITHUB_WORKSPACE;return e!=null&&e.trim().length>0?e:t.cwd()}var li=class{constructor(){if(this.payload={},process.env.GITHUB_EVENT_PATH)if(c(process.env.GITHUB_EVENT_PATH))this.payload=JSON.parse(u(process.env.GITHUB_EVENT_PATH,{encoding:`utf8`}));else{let e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${i}`)}this.eventName=process.env.GITHUB_EVENT_NAME,this.sha=process.env.GITHUB_SHA,this.ref=process.env.GITHUB_REF,this.workflow=process.env.GITHUB_WORKFLOW,this.action=process.env.GITHUB_ACTION,this.actor=process.env.GITHUB_ACTOR,this.job=process.env.GITHUB_JOB,this.runAttempt=parseInt(process.env.GITHUB_RUN_ATTEMPT,10),this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10),this.runId=parseInt(process.env.GITHUB_RUN_ID,10),this.apiUrl=process.env.GITHUB_API_URL??`https://api.github.com`,this.serverUrl=process.env.GITHUB_SERVER_URL??`https://github.com`,this.graphqlUrl=process.env.GITHUB_GRAPHQL_URL??`https://api.github.com/graphql`}get issue(){let e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){let[e,t]=process.env.GITHUB_REPOSITORY.split(`/`);return{owner:e,repo:t}}if(this.payload.repository)return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name};throw Error(`context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'`)}},ui=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getProxyUrl=t,e.checkBypass=n;function t(e){let t=e.protocol===`https:`;if(n(e))return;let r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new i(r)}catch{if(!r.startsWith(`http://`)&&!r.startsWith(`https://`))return new i(`http://${r}`)}else return}function n(e){if(!e.hostname)return!1;let t=e.hostname;if(r(t))return!0;let n=process.env.no_proxy||process.env.NO_PROXY||``;if(!n)return!1;let i;e.port?i=Number(e.port):e.protocol===`http:`?i=80:e.protocol===`https:`&&(i=443);let a=[e.hostname.toUpperCase()];typeof i==`number`&&a.push(`${a[0]}:${i}`);for(let e of n.split(`,`).map(e=>e.trim().toUpperCase()).filter(e=>e))if(e===`*`||a.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(`.`)&&t.endsWith(`${e}`)))return!0;return!1}function r(e){let t=e.toLowerCase();return t===`localhost`||t.startsWith(`127.`)||t.startsWith(`[::1]`)||t.startsWith(`[0:0:0:0:0:0:0:1]`)}var i=class extends URL{constructor(e,t){super(e,t),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}})),di=pe(U((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(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;oi(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 i(this,void 0,void 0,function*(){return new Promise(e=>i(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}};e.HttpClientResponse=y;function b(e){return new URL(e).protocol===`https:`}e.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 i(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return i(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return i(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return i(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return i(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return i(this,arguments,void 0,function*(e,t={}){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,f.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return i(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&&g.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===u.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&&m.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||!h.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}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 i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new y(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=s.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?o:a;let s=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s,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({},x(this.requestOptions.headers),x(e||{})):x(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=x(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=x(this.requestOptions.headers)[d.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[d.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=s.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:`,l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||a.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,a=n.protocol===`https:`;r=i?a?c.httpsOverHttps:c.httpsOverHttp:a?c.httpOverHttps:c.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:l};t=i?new o.Agent(e):new a.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 l.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(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 i(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 i(this,void 0,void 0,function*(){return new Promise((n,r)=>i(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===u.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new v(e,i);t.result=a.result,r(t)}else n(a)}))})}};let x=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})}))(),1),fi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function pi(e,t){if(!e&&!t.auth)throw Error(`Parameter token or opts.auth is required`);if(e&&t.auth)throw Error(`Parameters token and opts.auth may not both be specified`);return typeof t.auth==`string`?t.auth:`token ${e}`}function mi(e){return new di.HttpClient().getAgent(e)}function hi(e){return new di.HttpClient().getAgentDispatcher(e)}function gi(e){let t=hi(e);return(e,n)=>fi(this,void 0,void 0,function*(){return(0,vn.fetch)(e,Object.assign(Object.assign({},n),{dispatcher:t}))})}function _i(){return process.env.GITHUB_API_URL||`https://api.github.com`}function vi(){return typeof navigator==`object`&&`userAgent`in navigator?navigator.userAgent:typeof process==`object`&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:``}function yi(e,t,n,r){if(typeof n!=`function`)throw Error(`method for before hook must be a function`);return r||={},Array.isArray(t)?t.reverse().reduce((t,n)=>yi.bind(null,e,n,t,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((e,t)=>t.hook.bind(null,e,r),n)():n(r))}function bi(e,t,n,r){let i=r;e.registry[n]||(e.registry[n]=[]),t===`before`&&(r=(e,t)=>Promise.resolve().then(i.bind(null,t)).then(e.bind(null,t))),t===`after`&&(r=(e,t)=>{let n;return Promise.resolve().then(e.bind(null,t)).then(e=>(n=e,i(n,t))).then(()=>n)}),t===`error`&&(r=(e,t)=>Promise.resolve().then(e.bind(null,t)).catch(e=>i(e,t))),e.registry[n].push({hook:r,orig:i})}function xi(e,t,n){if(!e.registry[t])return;let r=e.registry[t].map(e=>e.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Si=Function.bind,Ci=Si.bind(Si);function wi(e,t,n){let r=Ci(xi,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,[`before`,`error`,`after`,`wrap`].forEach(r=>{let i=n?[t,r,n]:[t,r];e[r]=e.api[r]=Ci(bi,null).apply(null,i)})}function Ti(){let e=Symbol(`Singular`),t={registry:{}},n=yi.bind(null,t,e);return wi(n,t,e),n}function Ei(){let e={registry:{}},t=yi.bind(null,e);return wi(t,e),t}var Di={Singular:Ti,Collection:Ei},Oi=`octokit-endpoint.js/0.0.0-development ${vi()}`,ki={method:`GET`,baseUrl:`https://api.github.com`,headers:{accept:`application/vnd.github.v3+json`,"user-agent":Oi},mediaType:{format:``}};function Ai(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function ji(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function Mi(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(r=>{ji(t[r])&&r in e?n[r]=Mi(e[r],t[r]):Object.assign(n,{[r]:t[r]})}),n}function Ni(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function Pi(e,t,n){if(typeof t==`string`){let[e,r]=t.split(` `);n=Object.assign(r?{method:e,url:r}:{url:e},n)}else n=Object.assign({},t);n.headers=Ai(n.headers),Ni(n),Ni(n.headers);let r=Mi(e||{},n);return n.url===`/graphql`&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(e=>e.replace(/-preview/,``))),r}function Fi(e,t){let n=/\?/.test(e)?`&`:`?`,r=Object.keys(t);return r.length===0?e:e+n+r.map(e=>e===`q`?`q=`+t.q.split(`+`).map(encodeURIComponent).join(`+`):`${e}=${encodeURIComponent(t[e])}`).join(`&`)}var Ii=/\{[^{}}]+\}/g;function Li(e){return e.replace(/(?:^\W+)|(?:(?e.concat(t),[]):[]}function zi(e,t){let n={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Bi(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`)),e}).join(``)}function Vi(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return`%`+e.charCodeAt(0).toString(16).toUpperCase()})}function Hi(e,t,n){return t=e===`+`||e===`#`?Bi(t):Vi(t),n?Vi(n)+`=`+t:t}function Ui(e){return e!=null}function Wi(e){return e===`;`||e===`&`||e===`?`}function Gi(e,t,n,r){var i=e[n],a=[];if(Ui(i)&&i!==``)if(typeof i==`string`||typeof i==`number`||typeof i==`bigint`||typeof i==`boolean`)i=i.toString(),r&&r!==`*`&&(i=i.substring(0,parseInt(r,10))),a.push(Hi(t,i,Wi(t)?n:``));else if(r===`*`)Array.isArray(i)?i.filter(Ui).forEach(function(e){a.push(Hi(t,e,Wi(t)?n:``))}):Object.keys(i).forEach(function(e){Ui(i[e])&&a.push(Hi(t,i[e],e))});else{let e=[];Array.isArray(i)?i.filter(Ui).forEach(function(n){e.push(Hi(t,n))}):Object.keys(i).forEach(function(n){Ui(i[n])&&(e.push(Vi(n)),e.push(Hi(t,i[n].toString())))}),Wi(t)?a.push(Vi(n)+`=`+e.join(`,`)):e.length!==0&&a.push(e.join(`,`))}else t===`;`?Ui(i)&&a.push(Vi(n)):i===``&&(t===`&`||t===`?`)?a.push(Vi(n)+`=`):i===``&&a.push(``);return a}function Ki(e){return{expand:qi.bind(null,e)}}function qi(e,t){var n=[`+`,`#`,`.`,`/`,`;`,`?`,`&`];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,r,i){if(r){let e=``,i=[];if(n.indexOf(r.charAt(0))!==-1&&(e=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(n){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(n);i.push(Gi(t,e,r[1],r[2]||r[3]))}),e&&e!==`+`){var a=`,`;return e===`?`?a=`&`:e!==`#`&&(a=e),(i.length===0?``:e)+i.join(a)}else return i.join(`,`)}else return Bi(i)}),e===`/`?e:e.replace(/\/$/,``)}function Ji(e){let t=e.method.toUpperCase(),n=(e.url||`/`).replace(/:([a-z]\w+)/g,`{$1}`),r=Object.assign({},e.headers),i,a=zi(e,[`method`,`baseUrl`,`url`,`headers`,`request`,`mediaType`]),o=Ri(n);n=Ki(n).expand(a),/^http/.test(n)||(n=e.baseUrl+n);let s=zi(a,Object.keys(e).filter(e=>o.includes(e)).concat(`baseUrl`));return/application\/octet-stream/i.test(r.accept)||(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(`,`)),n.endsWith(`/graphql`)&&e.mediaType.previews?.length&&(r.accept=(r.accept.match(/(?`application/vnd.github.${t}-preview${e.mediaType.format?`.${e.mediaType.format}`:`+json`}`).join(`,`))),[`GET`,`HEAD`].includes(t)?n=Fi(n,s):`data`in s?i=s.data:Object.keys(s).length&&(i=s),!r[`content-type`]&&i!==void 0&&(r[`content-type`]=`application/json; charset=utf-8`),[`PATCH`,`PUT`].includes(t)&&i===void 0&&(i=``),Object.assign({method:t,url:n,headers:r},i===void 0?null:{body:i},e.request?{request:e.request}:null)}function Yi(e,t,n){return Ji(Pi(e,t,n))}function Xi(e,t){let n=Pi(e,t),r=Yi.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Xi.bind(null,n),merge:Pi.bind(null,n),parse:Ji})}var Zi=Xi(null,ki),Qi=U(((e,t)=>{let n=function(){};n.prototype=Object.create(null);let r=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,i=/\\([\v\u0020-\u00ff])/gu,a=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,o={type:``,parameters:new n};Object.freeze(o.parameters),Object.freeze(o);function s(e){if(typeof e!=`string`)throw TypeError(`argument header is required and must be a string`);let t=e.indexOf(`;`),o=t===-1?e.trim():e.slice(0,t).trim();if(a.test(o)===!1)throw TypeError(`invalid media type`);let s={type:o.toLowerCase(),parameters:new n};if(t===-1)return s;let c,l,u;for(r.lastIndex=t;l=r.exec(e);){if(l.index!==t)throw TypeError(`invalid parameter format`);t+=l[0].length,c=l[1].toLowerCase(),u=l[2],u[0]===`"`&&(u=u.slice(1,u.length-1),i.test(u)&&(u=u.replace(i,`$1`))),s.parameters[c]=u}if(t!==e.length)throw TypeError(`invalid parameter format`);return s}function c(e){if(typeof e!=`string`)return o;let t=e.indexOf(`;`),s=t===-1?e.trim():e.slice(0,t).trim();if(a.test(s)===!1)return o;let c={type:s.toLowerCase(),parameters:new n};if(t===-1)return c;let l,u,d;for(r.lastIndex=t;u=r.exec(e);){if(u.index!==t)return o;t+=u[0].length,l=u[1].toLowerCase(),d=u[2],d[0]===`"`&&(d=d.slice(1,d.length-1),i.test(d)&&(d=d.replace(i,`$1`))),c.parameters[l]=d}return t===e.length?c:o}t.exports.default={parse:s,safeParse:c},t.exports.parse=s,t.exports.safeParse=c,t.exports.defaultContentType=o}));const $i=/^-?\d+$/,ea=/^-?\d+n+$/,ta=JSON.stringify,na=JSON.parse,ra=/^-?\d+n$/,ia=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,aa=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,oa=(e,t,n)=>`rawJSON`in JSON?ta(e,(e,n)=>typeof n==`bigint`?JSON.rawJSON(n.toString()):typeof t==`function`?t(e,n):(Array.isArray(t)&&t.includes(e),n),n):e?ta(e,(e,n)=>typeof n==`string`&&n.match(ea)||typeof n==`bigint`?n.toString()+`n`:typeof t==`function`?t(e,n):(Array.isArray(t)&&t.includes(e),n),n).replace(ia,`$1$2$3`).replace(aa,`$1$2$3`):ta(e,t,n),sa=()=>JSON.parse(`1`,(e,t,n)=>!!n&&n.source===`1`),ca=(e,t,n,r)=>typeof t==`string`&&t.match(ra)?BigInt(t.slice(0,-1)):typeof t==`string`&&t.match(ea)?t.slice(0,-1):typeof r==`function`?r(e,t,n):t,la=(e,t)=>JSON.parse(e,(e,n,r)=>{let i=typeof n==`number`&&(n>2**53-1||n<-(2**53-1)),a=r&&$i.test(r.source);return i&&a?BigInt(r.source):typeof t==`function`?t(e,n,r):n}),ua=(2**53-1).toString(),da=ua.length,fa=/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g,pa=/^"-?\d+n+"$/,ma=(e,t)=>e?sa()?la(e,t):na(e.replace(fa,(e,t,n,r)=>{let i=e[0]===`"`;if(i&&e.match(pa))return e.substring(0,e.length-1)+`n"`;let a=n||r,o=t&&(t.lengthca(e,n,r,t)):na(e,t);var ha=class extends Error{name;status;request;response;constructor(e,t,n){super(e,{cause:n.cause}),this.name=`HttpError`,this.status=Number.parseInt(t),Number.isNaN(this.status)&&(this.status=0),`response`in n&&(this.response=n.response);let r=Object.assign({},n.request);n.request.headers.authorization&&(r.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?``;async function xa(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw Error(`fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing`);let n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=ya(e.body)||Array.isArray(e.body)?oa(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,String(t)])),o;try{o=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:`half`}})}catch(t){let n=`Unknown Error`;if(t instanceof Error){if(t.name===`AbortError`)throw t.status=500,t;n=t.message,t.name===`TypeError`&&`cause`in t&&(t.cause instanceof Error?n=t.cause.message:typeof t.cause==`string`&&(n=t.cause))}let r=new ha(n,500,{request:e});throw r.cause=t,r}let s=o.status,c=o.url,l={};for(let[e,t]of o.headers)l[e]=t;let u={url:c,status:s,headers:l,data:``};if(`deprecation`in l){let t=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),r=t&&t.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${r?`. See ${r}`:``}`)}if(s===204||s===205)return u;if(e.method===`HEAD`){if(s<400)return u;throw new ha(o.statusText,s,{response:u,request:e})}if(s===304)throw u.data=await Sa(o),new ha(`Not modified`,s,{response:u,request:e});if(s>=400)throw u.data=await Sa(o),new ha(wa(u.data),s,{response:u,request:e});return u.data=r?await Sa(o):o.body,u}async function Sa(e){let t=e.headers.get(`content-type`);if(!t)return e.text().catch(ba);let n=(0,ga.safeParse)(t);if(Ca(n)){let t=``;try{return t=await e.text(),ma(t)}catch{return t}}else if(n.type.startsWith(`text/`)||n.parameters.charset?.toLowerCase()===`utf-8`)return e.text().catch(ba);else return e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Ca(e){return e.type===`application/json`||e.type===`application/scim+json`}function wa(e){if(typeof e==`string`)return e;if(e instanceof ArrayBuffer)return`Unknown error`;if(`message`in e){let t=`documentation_url`in e?` - ${e.documentation_url}`:``;return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(e=>JSON.stringify(e)).join(`, `)}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function Ta(e,t){let n=e.defaults(t);return Object.assign(function(e,t){let r=n.merge(e,t);if(!r.request||!r.request.hook)return xa(n.parse(r));let i=(e,t)=>xa(n.parse(n.merge(e,t)));return Object.assign(i,{endpoint:n,defaults:Ta.bind(null,n)}),r.request.hook(i,r)},{endpoint:n,defaults:Ta.bind(null,n)})}var Ea=Ta(Zi,va),Da=`0.0.0-development`;function Oa(e){return`Request failed due to following response errors: +`.trim())}}})),Mt=U(((e,t)=>{let n=Symbol.for(`undici.globalDispatcher.1`),{InvalidArgumentError:r}=ke(),i=lt();o()===void 0&&a(new i);function a(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 o(){return globalThis[n]}t.exports={setGlobalDispatcher:a,getGlobalDispatcher:o}})),Nt=U(((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)}}})),Pt=U(((e,t)=>{let n=tt();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)}}})),Ft=U(((e,t)=>{let n=ft();t.exports=e=>t=>function(r,i){return t(r,new n({...r,retryOptions:{...e,...r.retryOptions}},{handler:i,dispatch:t}))}})),It=U(((e,t)=>{let n=Me(),{InvalidArgumentError:r,RequestAbortedError:i}=ke(),a=Nt();var o=class extends a{#e=1024*1024;#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 s({maxSize:e}={maxSize:1024*1024}){return t=>function(n,r){let{dumpMaxSize:i=e}=n;return t(n,new o({maxSize:i},r))}}t.exports=s})),Lt=U(((e,t)=>{let{isIP:n}=W(`node:net`),{lookup:r}=W(`node:dns`),i=Nt(),{InvalidArgumentError:a,InformationalError:o}=ke(),s=2**31-1;var c=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,typeof e.ttl==`number`?e.ttl=Math.min(e.ttl,this.#e):e.ttl=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 l(this,e,t)}},l=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);break}}};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 c({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)}}})),Rt=U(((e,t)=>{let{kConstruct:n}=Oe(),{kEnumerableProperty:r}=Me(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=qe(),{webidl:s}=Ke(),c=W(`node:assert`),l=W(`node:util`),u=Symbol(`headers map`),d=Symbol(`headers map sorted`);function f(e){return e===10||e===13||e===9||e===32}function p(e){let t=0,n=e.length;for(;n>t&&f(e.charCodeAt(n-1));)--n;for(;n>t&&f(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function m(e,t){if(Array.isArray(t))for(let n=0;n>`,`record`]})}function h(e,t,n){if(n=p(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(b(e)===`immutable`)throw TypeError(`immutable`);return S(e).append(t,n,!1)}function g(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}else{let e=0;for(let{0:n,1:{value:r}}of this[u])t[e++]=[n,r],c(r!==null);return t.sort(g)}}},y=class e{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new v,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers contructor`,`init`),m(this,e)))}append(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.append`);let r=`Headers.append`;return t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),h(this,t,n)}delete(t){if(s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.delete`),t=s.converters.ByteString(t,`Headers.delete`,`name`),!a(t))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.get`);let n=`Headers.get`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.get(t,!1)}has(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.has`);let n=`Headers.has`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.contains(t,!1)}set(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.set`);let r=`Headers.set`;if(t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),n=p(n),!a(t))throw s.errors.invalidArgument({prefix:r,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:r,value:n,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(t,n,!1)}getSetCookie(){s.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}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:m,compareHeaderName:g,Headers:y,HeadersList:v,getHeadersGuard:b,setHeadersGuard:x,setHeadersList:C,getHeadersList:S}})),zt=U(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Rt(),{extractBody:c,cloneBody:l,mixinBody:u,hasFinalizationRegistry:d,streamRegistry:f,bodyUnusable:p}=Qe(),m=Me(),h=W(`node:util`),{kEnumerableProperty:g}=m,{isValidReasonPhrase:v,isCancelled:y,isAborted:b,isBlobLike:x,serializeJavascriptValueToJSONString:S,isErrorLike:C,isomorphicEncode:w,environmentSettingsObject:T}=qe(),{redirectStatusSet:E,nullBodyStatus:D}=Ue(),{kState:O,kHeaders:k}=Je(),{webidl:A}=Ke(),{FormData:j}=Xe(),{URLSerializer:M}=Ge(),{kConstruct:N}=Oe(),P=W(`node:assert`),{types:F}=W(`node:util`),I=new TextEncoder(`utf-8`);var L=class e{static error(){return re(ee(),`immutable`)}static json(e,t={}){A.argumentLengthCheck(arguments,1,`Response.json`),t!==null&&(t=A.converters.ResponseInit(t));let n=c(I.encode(S(e))),r=re(z({}),`response`);return H(r,t,{body:n[0],type:`application/json`}),r}static redirect(e,t=302){A.argumentLengthCheck(arguments,1,`Response.redirect`),e=A.converters.USVString(e),t=A.converters[`unsigned short`](t);let n;try{n=new URL(e,T.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!E.has(t))throw RangeError(`Invalid status code ${t}`);let r=re(z({}),`immutable`);r[O].status=t;let i=w(M(n));return r[O].headersList.append(`location`,i,!0),r}constructor(e=null,t={}){if(A.util.markAsUncloneable(this),e===N)return;e!==null&&(e=A.converters.BodyInit(e)),t=A.converters.ResponseInit(t),this[O]=z({}),this[k]=new n(N),o(this[k],`response`),s(this[k],this[O].headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}H(this,t,r)}get type(){return A.brandCheck(this,e),this[O].type}get url(){A.brandCheck(this,e);let t=this[O].urlList,n=t[t.length-1]??null;return n===null?``:M(n,!0)}get redirected(){return A.brandCheck(this,e),this[O].urlList.length>1}get status(){return A.brandCheck(this,e),this[O].status}get ok(){return A.brandCheck(this,e),this[O].status>=200&&this[O].status<=299}get statusText(){return A.brandCheck(this,e),this[O].statusText}get headers(){return A.brandCheck(this,e),this[k]}get body(){return A.brandCheck(this,e),this[O].body?this[O].body.stream:null}get bodyUsed(){return A.brandCheck(this,e),!!this[O].body&&m.isDisturbed(this[O].body.stream)}clone(){if(A.brandCheck(this,e),p(this))throw A.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=R(this[O]);return d&&this[O].body?.stream&&f.register(this,new WeakRef(this[O].body.stream)),re(t,a(this[k]))}[h.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 ${h.formatWithOptions(t,n)}`}};u(L),Object.defineProperties(L.prototype,{type:g,url:g,status:g,ok:g,redirected:g,statusText:g,headers:g,clone:g,body:g,bodyUsed:g,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(L,{json:g,redirect:g,error:g});function R(e){if(e.internalResponse)return V(R(e.internalResponse),e.type);let t=z({...e,body:null});return e.body!=null&&(t.body=l(t,e.body)),t}function z(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 ee(e){return z({type:`error`,status:0,error:C(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function B(e){return e.type===`error`&&e.status===0}function te(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 P(!(n in t)),e[n]=r,!0}})}function V(e,t){if(t===`basic`)return te(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return te(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return te(e,{type:`opaque`,urlList:Object.freeze([]),status:0,statusText:``,body:null});if(t===`opaqueredirect`)return te(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});P(!1)}function ne(e,t=null){return P(y(e)),b(e)?ee(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):ee(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function H(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&&!v(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(e[O].status=t.status),`statusText`in t&&t.statusText!=null&&(e[O].statusText=t.statusText),`headers`in t&&t.headers!=null&&i(e[k],t.headers),n){if(D.includes(e.status))throw A.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});e[O].body=n.body,n.type!=null&&!e[O].headersList.contains(`content-type`,!0)&&e[O].headersList.append(`content-type`,n.type,!0)}}function re(e,t){let r=new L(N);return r[O]=e,r[k]=new n(N),s(r[k],e.headersList),o(r[k],t),d&&e.body?.stream&&f.register(r,new WeakRef(e.body.stream)),r}A.converters.ReadableStream=A.interfaceConverter(ReadableStream),A.converters.FormData=A.interfaceConverter(j),A.converters.URLSearchParams=A.interfaceConverter(URLSearchParams),A.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?A.converters.USVString(e,t,n):x(e)?A.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||F.isArrayBuffer(e)?A.converters.BufferSource(e,t,n):m.isFormDataLike(e)?A.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?A.converters.URLSearchParams(e,t,n):A.converters.DOMString(e,t,n)},A.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?A.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:A.converters.XMLHttpRequestBodyInit(e,t,n)},A.converters.ResponseInit=A.dictionaryConverter([{key:`status`,converter:A.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:A.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:A.converters.HeadersInit}]),t.exports={isNetworkError:B,makeNetworkError:ee,makeResponse:z,makeAppropriateNetworkError:ne,filterResponse:V,Response:L,cloneResponse:R,fromInnerResponse:re}})),Bt=U(((e,t)=>{let{kConnected:n,kSize:r}=Oe();var i=class{constructor(e){this.value=e}deref(){return this.value[n]===0&&this.value[r]===0?void 0:this.value}},a=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:i,FinalizationRegistry:a}):{WeakRef,FinalizationRegistry}}})),Vt=U(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=Qe(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Rt(),{FinalizationRegistry:p}=Bt()(),m=Me(),h=W(`node:util`),{isValidHTTPToken:g,sameOrigin:v,environmentSettingsObject:y}=qe(),{forbiddenMethodsSet:b,corsSafeListedMethodsSet:x,referrerPolicy:S,requestRedirect:C,requestMode:w,requestCredentials:T,requestCache:E,requestDuplex:D}=Ue(),{kEnumerableProperty:O,normalizedMethodRecordsBase:k,normalizedMethodRecords:A}=m,{kHeaders:j,kSignal:M,kState:N,kDispatcher:P}=Je(),{webidl:F}=Ke(),{URLSerializer:I}=Ge(),{kConstruct:L}=Oe(),R=W(`node:assert`),{getMaxListeners:z,setMaxListeners:ee,getEventListeners:B,defaultMaxListeners:te}=W(`node:events`),V=Symbol(`abortController`),ne=new p(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),H=new WeakMap;function re(e){return t;function t(){let n=e.deref();if(n!==void 0){ne.unregister(t),this.removeEventListener(`abort`,t),n.abort(this.reason);let e=H.get(n.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()}H.delete(n.signal)}}}}let ie=!1;var ae=class e{constructor(t,r={}){if(F.util.markAsUncloneable(this),t===L)return;let i=`Request constructor`;F.argumentLengthCheck(arguments,1,i),t=F.converters.RequestInfo(t,i,`input`),r=F.converters.RequestInit(r,i,`init`);let u=null,p=null,h=y.settingsObject.baseUrl,S=null;if(typeof t==`string`){this[P]=r.dispatcher;let e;try{e=new URL(t,h)}catch(e){throw TypeError(`Failed to parse URL from `+t,{cause:e})}if(e.username||e.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+t);u=oe({urlList:[e]}),p=`cors`}else this[P]=r.dispatcher||t[P],R(t instanceof e),u=t[N],S=t[M];let C=y.settingsObject.origin,w=`client`;if(u.window?.constructor?.name===`EnvironmentSettingsObject`&&v(u.window,C)&&(w=u.window),r.window!=null)throw TypeError(`'window' option '${w}' must be null`);`window`in r&&(w=`no-window`),u=oe({method:u.method,headersList:u.headersList,unsafeRequest:u.unsafeRequest,client:y.settingsObject,window:w,priority:u.priority,origin:u.origin,referrer:u.referrer,referrerPolicy:u.referrerPolicy,mode:u.mode,credentials:u.credentials,cache:u.cache,redirect:u.redirect,integrity:u.integrity,keepalive:u.keepalive,reloadNavigation:u.reloadNavigation,historyNavigation:u.historyNavigation,urlList:[...u.urlList]});let T=Object.keys(r).length!==0;if(T&&(u.mode===`navigate`&&(u.mode=`same-origin`),u.reloadNavigation=!1,u.historyNavigation=!1,u.origin=`client`,u.referrer=`client`,u.referrerPolicy=``,u.url=u.urlList[u.urlList.length-1],u.urlList=[u.url]),r.referrer!==void 0){let e=r.referrer;if(e===``)u.referrer=`no-referrer`;else{let t;try{t=new URL(e,h)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||C&&!v(t,y.settingsObject.baseUrl)?u.referrer=`client`:u.referrer=t}}r.referrerPolicy!==void 0&&(u.referrerPolicy=r.referrerPolicy);let E;if(E=r.mode===void 0?p:r.mode,E===`navigate`)throw F.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(E!=null&&(u.mode=E),r.credentials!==void 0&&(u.credentials=r.credentials),r.cache!==void 0&&(u.cache=r.cache),u.cache===`only-if-cached`&&u.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(r.redirect!==void 0&&(u.redirect=r.redirect),r.integrity!=null&&(u.integrity=String(r.integrity)),r.keepalive!==void 0&&(u.keepalive=!!r.keepalive),r.method!==void 0){let e=r.method,t=A[e];if(t!==void 0)u.method=t;else{if(!g(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(b.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=k[t]??e,u.method=e}!ie&&u.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`}),ie=!0)}r.signal!==void 0&&(S=r.signal),this[N]=u;let D=new AbortController;if(this[M]=D.signal,S!=null){if(!S||typeof S.aborted!=`boolean`||typeof S.addEventListener!=`function`)throw TypeError(`Failed to construct 'Request': member signal is not of type AbortSignal.`);if(S.aborted)D.abort(S.reason);else{this[V]=D;let e=re(new WeakRef(D));try{(typeof z==`function`&&z(S)===te||B(S,`abort`).length>=te)&&ee(1500,S)}catch{}m.addAbortListener(S,e),ne.register(D,{signal:S,abort:e},e)}}if(this[j]=new o(L),d(this[j],u.headersList),l(this[j],`request`),E===`no-cors`){if(!x.has(u.method))throw TypeError(`'${u.method} is unsupported in no-cors mode.`);l(this[j],`request-no-cors`)}if(T){let e=f(this[j]),t=r.headers===void 0?new c(e):r.headers;if(e.clear(),t instanceof c){for(let{name:n,value:r}of t.rawValues())e.append(n,r,!1);e.cookies=t.cookies}else s(this[j],t)}let O=t instanceof e?t[N].body:null;if((r.body!=null||O!=null)&&(u.method===`GET`||u.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let I=null;if(r.body!=null){let[e,t]=n(r.body,u.keepalive);I=e,t&&!f(this[j]).contains(`content-type`,!0)&&this[j].append(`content-type`,t)}let H=I??O;if(H!=null&&H.source==null){if(I!=null&&r.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(u.mode!==`same-origin`&&u.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);u.useCORSPreflightFlag=!0}let ae=H;if(I==null&&O!=null){if(a(t))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let e=new TransformStream;O.stream.pipeThrough(e),ae={source:O.source,length:O.length,stream:e.readable}}this[N].body=ae}get method(){return F.brandCheck(this,e),this[N].method}get url(){return F.brandCheck(this,e),I(this[N].url)}get headers(){return F.brandCheck(this,e),this[j]}get destination(){return F.brandCheck(this,e),this[N].destination}get referrer(){return F.brandCheck(this,e),this[N].referrer===`no-referrer`?``:this[N].referrer===`client`?`about:client`:this[N].referrer.toString()}get referrerPolicy(){return F.brandCheck(this,e),this[N].referrerPolicy}get mode(){return F.brandCheck(this,e),this[N].mode}get credentials(){return this[N].credentials}get cache(){return F.brandCheck(this,e),this[N].cache}get redirect(){return F.brandCheck(this,e),this[N].redirect}get integrity(){return F.brandCheck(this,e),this[N].integrity}get keepalive(){return F.brandCheck(this,e),this[N].keepalive}get isReloadNavigation(){return F.brandCheck(this,e),this[N].reloadNavigation}get isHistoryNavigation(){return F.brandCheck(this,e),this[N].historyNavigation}get signal(){return F.brandCheck(this,e),this[M]}get body(){return F.brandCheck(this,e),this[N].body?this[N].body.stream:null}get bodyUsed(){return F.brandCheck(this,e),!!this[N].body&&m.isDisturbed(this[N].body.stream)}get duplex(){return F.brandCheck(this,e),`half`}clone(){if(F.brandCheck(this,e),a(this))throw TypeError(`unusable`);let t=se(this[N]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let e=H.get(this.signal);e===void 0&&(e=new Set,H.set(this.signal,e));let t=new WeakRef(n);e.add(t),m.addAbortListener(n.signal,re(t))}return ce(t,n.signal,u(this[j]))}[h.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 ${h.formatWithOptions(t,n)}`}};r(ae);function oe(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 se(e){let t=oe({...e,body:null});return e.body!=null&&(t.body=i(t,e.body)),t}function ce(e,t,n){let r=new ae(L);return r[N]=e,r[M]=t,r[j]=new o(L),d(r[j],e.headersList),l(r[j],n),r}Object.defineProperties(ae.prototype,{method:O,url:O,headers:O,redirect:O,clone:O,signal:O,duplex:O,destination:O,body:O,bodyUsed:O,isHistoryNavigation:O,isReloadNavigation:O,keepalive:O,integrity:O,cache:O,credentials:O,attribute:O,referrerPolicy:O,referrer:O,mode:O,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),F.converters.Request=F.interfaceConverter(ae),F.converters.RequestInfo=function(e,t,n){return typeof e==`string`?F.converters.USVString(e,t,n):e instanceof ae?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:S},{key:`mode`,converter:F.converters.DOMString,allowedValues:w},{key:`credentials`,converter:F.converters.DOMString,allowedValues:T},{key:`cache`,converter:F.converters.DOMString,allowedValues:E},{key:`redirect`,converter:F.converters.DOMString,allowedValues:C},{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:D},{key:`dispatcher`,converter:F.converters.any}]),t.exports={Request:ae,makeRequest:oe,fromInnerRequest:ce,cloneRequest:se}})),Ht=U(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o}=zt(),{HeadersList:s}=Rt(),{Request:c,cloneRequest:l}=Vt(),u=W(`node:zlib`),{bytesMatch:d,makePolicyContainer:f,clonePolicyContainer:p,requestBadPort:m,TAOCheck:h,appendRequestOriginHeader:g,responseLocationURL:v,requestCurrentURL:y,setRequestReferrerPolicyOnRedirect:b,tryUpgradeRequestToAPotentiallyTrustworthyURL:x,createOpaqueTimingInfo:S,appendFetchMetadata:C,corsCheck:w,crossOriginResourcePolicyCheck:T,determineRequestsReferrer:E,coarsenedSharedCurrentTime:D,createDeferredPromise:O,isBlobLike:k,sameOrigin:A,isCancelled:j,isAborted:M,isErrorLike:N,fullyReadBody:P,readableStreamClose:F,isomorphicEncode:I,urlIsLocal:L,urlIsHttpHttpsScheme:R,urlHasHttpsScheme:z,clampAndCoarsenConnectionTimingInfo:ee,simpleRangeHeaderValue:B,buildContentRange:te,createInflate:V,extractMimeType:ne}=qe(),{kState:H,kDispatcher:re}=Je(),ie=W(`node:assert`),{safelyExtractBody:ae,extractBody:oe}=Qe(),{redirectStatusSet:se,nullBodyStatus:ce,safeMethodsSet:le,requestBodyHeader:ue,subresourceSet:U}=Ue(),de=W(`node:events`),{Readable:fe,pipeline:pe,finished:me}=W(`node:stream`),{addAbortListener:he,isErrored:ge,isReadable:_e,bufferToLowerCasedHeaderName:ve}=Me(),{dataURLProcessor:ye,serializeAMimeType:be,minimizeSupportedMimeType:xe}=Ge(),{getGlobalDispatcher:Se}=Mt(),{webidl:Ce}=Ke(),{STATUS_CODES:we}=W(`node:http`),Te=[`GET`,`HEAD`],Ee=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,De;var Oe=class extends de{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 ke(e){je(e,`fetch`)}function Ae(e,t=void 0){Ce.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=O(),r;try{r=new c(e,t)}catch(e){return n.reject(e),n.promise}let i=r[H];if(r.signal.aborted)return Pe(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 he(r.signal,()=>{s=!0,ie(l!=null),l.abort(r.signal.reason);let e=a?.deref();Pe(n,i,e,r.signal.reason)}),l=Fe({request:i,processResponseEndOfBody:ke,processResponse:e=>{if(!s){if(e.aborted){Pe(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[re]}),n.promise}function je(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;R(n)&&r!==null&&(e.timingAllowPassed||(r=S({startTime:r.startTime}),i=``),r.endTime=D(),e.timingInfo=r,Ne(r,n.href,t,globalThis,i))}let Ne=performance.markResourceTiming;function Pe(e,t,n,r){if(e&&e.reject(r),t.body!=null&&_e(t.body?.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let i=n[H];i.body!=null&&_e(i.body?.stream)&&i.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e})}function Fe({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=Se()}){ie(s);let c=null,l=!1;e.client!=null&&(c=e.client.globalObject,l=e.client.crossOriginIsolatedCapability);let u=S({startTime:D(l)}),d={controller:new Oe(s),request:e,timingInfo:u,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:c,crossOriginIsolatedCapability:l};return ie(!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.client==null?e.policyContainer=f():e.policyContainer=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,U.has(e.destination),Ie(d).catch(e=>{d.controller.terminate(e)}),d.controller}async function Ie(e,t=!1){let r=e.request,a=null;if(r.localURLsOnly&&!L(y(r))&&(a=n(`local URLs only`)),x(r),m(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=E(r)),a===null&&(a=await(async()=>{let t=y(r);return A(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,await Le(e)):r.mode===`same-origin`?n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,await Le(e)):n(`redirect mode cannot be "follow" for "no-cors" request`):R(y(r))?(r.responseTainting=`cors`,await Be(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`):ie(!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`||ce.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let t=t=>ze(e,n(t));if(r.responseTainting===`opaque`||a.body==null){t(a.error);return}await P(a.body,n=>{if(!d(n,r.integrity)){t(`integrity mismatch`);return}a.body=ae(n)[0],ze(e,a)},t)}else ze(e,a)}function Le(e){if(j(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=y(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{De||=W(`node:buffer`).resolveObjectURL;let e=y(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=De(e.toString());if(t.method!==`GET`||!k(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=I(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=B(t.headersList.get(`range`,!0),!0);if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:a,rangeEndValue:s}=e;if(a===null)a=o-s,s=a+s-1;else{if(a>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(s===null||s>=o)&&(s=o-1)}let l=r.slice(a,s,c);i.body=oe(l)[0];let u=I(`${l.size}`),d=te(a,s,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,u,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,d,!0)}else{let e=oe(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=ye(y(t));if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let r=be(e.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:r}]],body:ae(e.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return Be(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function Re(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function ze(e,t){let n=e.timingInfo,r=()=>{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=S(n),i=``);let o=0;if(e.request.mode!==`navigator`||!t.hasCrossOriginRedirects){o=t.status;let e=ne(t.headersList);e!==`failure`&&(a.contentType=xe(e))}e.request.initiatorType!=null&&Ne(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let i=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>i())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let i=t.type===`error`?t:t.internalResponse??t;i.body==null?r():me(i.body.stream,()=>{r()})}async function Be(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 He(e),t.responseTainting===`cors`&&w(t,r)===`failure`)return n(`cors failure`);h(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&T(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(se.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 Ve(e,r):ie(!1)),r.timingInfo=a,r)}function Ve(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=v(i,y(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!R(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)&&!A(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&&!Te.includes(r.method)){r.method=`GET`,r.body=null;for(let e of ue)r.headersList.delete(e)}A(y(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&&(ie(r.body.source!=null),r.body=ae(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=D(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),b(r,i),Ie(e,!0)}async function He(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=I(`${d}`)),f!=null&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append(`referer`,I(s.referrer.href),!0),g(s),C(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,Ee),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)||(z(y(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 We(o,u,i);!le.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():j(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(j(e))return r(e);e.controller.connection.destroy(),c=await He(e,t,!0)}return c}async function We(e,t=!1,i=!1){ie(!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 t=async function*(t){j(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{j(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{j(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};d=(async function*(){try{for await(let e of o.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await g({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 f=async()=>{await e.controller.resume()},p=t=>{j(e)||e.controller.abort(t)},m=new ReadableStream({async start(t){e.controller.controller=t},async pull(e){await f(e)},async cancel(e){await p(e)},type:`bytes`});c.body={stream:m,source:null,length:null},e.controller.onAborted=h,e.controller.on(`terminated`,h),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(M(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),Re(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),ge(m)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function h(t){M(e)?(c.aborted=!0,_e(m)&&e.controller.controller.error(e.controller.serializedAbortReason)):_e(m)&&e.controller.controller.error(TypeError(`terminated`,{cause:N(t)?t:void 0})),e.controller.connection.destroy()}return c;function g({body:t}){let n=y(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=ee(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=D(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=D(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(V({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?pe(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`)}})),Wt=U(((e,t)=>{let{webidl:n}=Ke(),r=Symbol(`ProgressEvent state`);var i=class e 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,e),this[r].lengthComputable}get loaded(){return n.brandCheck(this,e),this[r].loaded}get total(){return n.brandCheck(this,e),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}})),Gt=U(((e,t)=>{function n(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:n}})),Kt=U(((e,t)=>{let{kState:n,kError:r,kResult:i,kAborted:a,kLastProgressEventFired:o}=Ut(),{ProgressEvent:s}=Wt(),{getEncoding:c}=Gt(),{serializeAMimeType:l,parseMIMEType:u}=Ge(),{types:d}=W(`node:util`),{StringDecoder:f}=W(`string_decoder`),{btoa:p}=W(`node:buffer`),m={enumerable:!0,writable:!1,configurable:!1};function h(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:m,value:h}=await f;if(p&&!e[a]&&queueMicrotask(()=>{g(`loadstart`,e)}),p=!1,!m&&d.isUint8Array(h))u.push(h),(e[o]===void 0||Date.now()-e[o]>=50)&&!e[a]&&(e[o]=Date.now(),queueMicrotask(()=>{g(`progress`,e)})),f=l.read();else if(m){queueMicrotask(()=>{e[n]=`done`;try{let n=v(u,s,t.type,c);if(e[a])return;e[i]=n,g(`load`,e)}catch(t){e[r]=t,g(`error`,e)}e[n]!==`loading`&&g(`loadend`,e)});break}}catch(t){if(e[a])return;queueMicrotask(()=>{e[n]=`done`,e[r]=t,g(`error`,e),e[n]!==`loading`&&g(`loadend`,e)});break}})()}function g(e,t){let n=new s(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function v(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`),y(e,t)}case`ArrayBuffer`:return x(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 y(e,t){let n=x(e),r=b(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 b(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 x(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:m,readOperation:h,fireAProgressEvent:g}})),qt=U(((e,t)=>{let{staticPropertyDescriptors:n,readOperation:r,fireAProgressEvent:i}=Kt(),{kState:a,kError:o,kResult:s,kEvents:c,kAborted:l}=Ut(),{webidl:u}=Ke(),{kEnumerableProperty:d}=Me();var f=class e 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(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsArrayBuffer`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`ArrayBuffer`)}readAsBinaryString(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsBinaryString`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`BinaryString`)}readAsText(t,n=void 0){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsText`),t=u.converters.Blob(t,{strict:!1}),n!==void 0&&(n=u.converters.DOMString(n,`FileReader.readAsText`,`encoding`)),r(this,t,`Text`,n)}readAsDataURL(t){u.brandCheck(this,e),u.argumentLengthCheck(arguments,1,`FileReader.readAsDataURL`),t=u.converters.Blob(t,{strict:!1}),r(this,t,`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,e),this[a]){case`empty`:return this.EMPTY;case`loading`:return this.LOADING;case`done`:return this.DONE}}get result(){return u.brandCheck(this,e),this[s]}get error(){return u.brandCheck(this,e),this[o]}get onloadend(){return u.brandCheck(this,e),this[c].loadend}set onloadend(t){u.brandCheck(this,e),this[c].loadend&&this.removeEventListener(`loadend`,this[c].loadend),typeof t==`function`?(this[c].loadend=t,this.addEventListener(`loadend`,t)):this[c].loadend=null}get onerror(){return u.brandCheck(this,e),this[c].error}set onerror(t){u.brandCheck(this,e),this[c].error&&this.removeEventListener(`error`,this[c].error),typeof t==`function`?(this[c].error=t,this.addEventListener(`error`,t)):this[c].error=null}get onloadstart(){return u.brandCheck(this,e),this[c].loadstart}set onloadstart(t){u.brandCheck(this,e),this[c].loadstart&&this.removeEventListener(`loadstart`,this[c].loadstart),typeof t==`function`?(this[c].loadstart=t,this.addEventListener(`loadstart`,t)):this[c].loadstart=null}get onprogress(){return u.brandCheck(this,e),this[c].progress}set onprogress(t){u.brandCheck(this,e),this[c].progress&&this.removeEventListener(`progress`,this[c].progress),typeof t==`function`?(this[c].progress=t,this.addEventListener(`progress`,t)):this[c].progress=null}get onload(){return u.brandCheck(this,e),this[c].load}set onload(t){u.brandCheck(this,e),this[c].load&&this.removeEventListener(`load`,this[c].load),typeof t==`function`?(this[c].load=t,this.addEventListener(`load`,t)):this[c].load=null}get onabort(){return u.brandCheck(this,e),this[c].abort}set onabort(t){u.brandCheck(this,e),this[c].abort&&this.removeEventListener(`abort`,this[c].abort),typeof t==`function`?(this[c].abort=t,this.addEventListener(`abort`,t)):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}})),Jt=U(((e,t)=>{t.exports={kConstruct:Oe().kConstruct}})),Yt=U(((e,t)=>{let n=W(`node:assert`),{URLSerializer:r}=Ge(),{isValidHeaderName:i}=qe();function a(e,t,n=!1){return r(e,n)===r(t,n)}function o(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:a,getFieldValues:o}})),Xt=U(((e,t)=>{let{kConstruct:n}=Jt(),{urlEquals:r,getFieldValues:i}=Yt(),{kEnumerableProperty:a,isDisturbed:o}=Me(),{webidl:s}=Ke(),{Response:c,cloneResponse:l,fromInnerResponse:u}=zt(),{Request:d,fromInnerRequest:f}=Vt(),{kState:p}=Je(),{fetching:m}=Ht(),{urlIsHttpHttpsScheme:h,createDeferredPromise:g,readAllBytes:v}=qe(),y=W(`node:assert`);var b=class e{#e;constructor(){arguments[0]!==n&&s.illegalConstructor(),s.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){s.brandCheck(this,e);let r=`Cache.match`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=this.#i(t,n,1);if(i.length!==0)return i[0]}async matchAll(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.matchAll`;return t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`),this.#i(t,n)}async add(t){s.brandCheck(this,e);let n=`Cache.add`;s.argumentLengthCheck(arguments,1,n),t=s.converters.RequestInfo(t,n,`request`);let r=[t];return await this.addAll(r)}async addAll(t){s.brandCheck(this,e);let n=`Cache.addAll`;s.argumentLengthCheck(arguments,1,n);let r=[],a=[];for(let e of t){if(e===void 0)throw s.errors.conversionFailed({prefix:n,argument:`Argument 1`,types:[`undefined is not allowed`]});if(e=s.converters.RequestInfo(e),typeof e==`string`)continue;let t=e[p];if(!h(t.url)||t.method!==`GET`)throw s.errors.exception({header:n,message:`Expected http/s scheme when method is not GET.`})}let o=[];for(let e of t){let t=new d(e)[p];if(!h(t.url))throw s.errors.exception({header:n,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,a.push(t);let c=g();o.push(m({request:t,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 o)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){c.reject(new DOMException(`aborted`,`AbortError`));return}c.resolve(e)}})),r.push(c.promise)}let c=await Promise.all(r),l=[],u=0;for(let e of c){let t={type:`put`,request:a[u],response:e};l.push(t),u++}let f=g(),v=null;try{this.#t(l)}catch(e){v=e}return queueMicrotask(()=>{v===null?f.resolve(void 0):f.reject(v)}),f.promise}async put(t,n){s.brandCheck(this,e);let r=`Cache.put`;s.argumentLengthCheck(arguments,2,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.Response(n,r,`response`);let a=null;if(a=t instanceof d?t[p]:new d(t)[p],!h(a.url)||a.method!==`GET`)throw s.errors.exception({header:r,message:`Expected an http/s scheme when method is not GET`});let c=n[p];if(c.status===206)throw s.errors.exception({header:r,message:`Got 206 status`});if(c.headersList.contains(`vary`)){let e=i(c.headersList.get(`vary`));for(let t of e)if(t===`*`)throw s.errors.exception({header:r,message:`Got * vary field value`})}if(c.body&&(o(c.body.stream)||c.body.stream.locked))throw s.errors.exception({header:r,message:`Response body is locked or disturbed`});let u=l(c),f=g();c.body==null?f.resolve(void 0):v(c.body.stream.getReader()).then(f.resolve,f.reject);let m=[],y={type:`put`,request:a,response:u};m.push(y);let b=await f.promise;u.body!=null&&(u.body.source=b);let x=g(),S=null;try{this.#t(m)}catch(e){S=e}return queueMicrotask(()=>{S===null?x.resolve():x.reject(S)}),x.promise}async delete(t,n={}){s.brandCheck(this,e);let r=`Cache.delete`;s.argumentLengthCheck(arguments,1,r),t=s.converters.RequestInfo(t,r,`request`),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return!1}else y(typeof t==`string`),i=new d(t)[p];let a=[],o={type:`delete`,request:i,options:n};a.push(o);let c=g(),l=null,u;try{u=this.#t(a)}catch(e){l=e}return queueMicrotask(()=>{l===null?c.resolve(!!u?.length):c.reject(l)}),c.promise}async keys(t=void 0,n={}){s.brandCheck(this,e);let r=`Cache.keys`;t!==void 0&&(t=s.converters.RequestInfo(t,r,`request`)),n=s.converters.CacheQueryOptions(n,r,`options`);let i=null;if(t!==void 0)if(t instanceof d){if(i=t[p],i.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(i=new d(t)[p]);let a=g(),o=[];if(t===void 0)for(let e of this.#e)o.push(e[0]);else{let e=this.#n(i,n);for(let t of e)o.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of o){let n=f(t,new AbortController().signal,`immutable`);e.push(n)}a.resolve(Object.freeze(e))}),a.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);y(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(!h(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);y(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(b.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:a,matchAll:a,add:a,addAll:a,put:a,delete:a,keys:a});let x=[{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(x),s.converters.MultiCacheQueryOptions=s.dictionaryConverter([...x,{key:`cacheName`,converter:s.converters.DOMString}]),s.converters.Response=s.interfaceConverter(c),s.converters[`sequence`]=s.sequenceConverter(s.converters.RequestInfo),t.exports={Cache:b}})),Zt=U(((e,t)=>{let{kConstruct:n}=Jt(),{Cache:r}=Xt(),{webidl:i}=Ke(),{kEnumerableProperty:a}=Me();var o=class e{#e=new Map;constructor(){arguments[0]!==n&&i.illegalConstructor(),i.util.markAsUncloneable(this)}async match(t,a={}){if(i.brandCheck(this,e),i.argumentLengthCheck(arguments,1,`CacheStorage.match`),t=i.converters.RequestInfo(t),a=i.converters.MultiCacheQueryOptions(a),a.cacheName!=null){if(this.#e.has(a.cacheName))return await new r(n,this.#e.get(a.cacheName)).match(t,a)}else for(let e of this.#e.values()){let i=await new r(n,e).match(t,a);if(i!==void 0)return i}}async has(t){i.brandCheck(this,e);let n=`CacheStorage.has`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.has(t)}async open(t){i.brandCheck(this,e);let a=`CacheStorage.open`;if(i.argumentLengthCheck(arguments,1,a),t=i.converters.DOMString(t,a,`cacheName`),this.#e.has(t))return new r(n,this.#e.get(t));let o=[];return this.#e.set(t,o),new r(n,o)}async delete(t){i.brandCheck(this,e);let n=`CacheStorage.delete`;return i.argumentLengthCheck(arguments,1,n),t=i.converters.DOMString(t,n,`cacheName`),this.#e.delete(t)}async keys(){return i.brandCheck(this,e),[...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}})),Qt=U(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),$t=U(((e,t)=>{function n(e){for(let t=0;t=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function r(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 i(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 a(e){for(let t=0;tt.toString().padStart(2,`0`));function u(e){return typeof e==`number`&&(e=new Date(e)),`${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`}function d(e){if(e<0)throw Error(`Invalid cookie max-age`)}function f(e){if(e.name.length===0)return null;r(e.name),i(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`&&(d(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(o(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(a(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${u(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(`=`);t.push(`${e.trim()}=${r.join(`=`)}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab:n,validateCookieName:r,validateCookiePath:a,validateCookieValue:i,toIMFDate:u,stringify:f}})),en=U(((e,t)=>{let{maxNameValuePairSize:n,maxAttributeValueSize:r}=Qt(),{isCTLExcludingHtab:i}=$t(),{collectASequenceOfCodePointsFast:a}=Ge(),o=W(`node:assert`);function s(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,...c(r)}}function c(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 c(e,t);let l=i.toLowerCase();if(l===`expires`)t.expires=new Date(s);else if(l===`max-age`){let n=s.charCodeAt(0);if((n<48||n>57)&&s[0]!==`-`||!/^\d+$/.test(s))return c(e,t);t.maxAge=Number(s)}else if(l===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(l===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(l===`secure`)t.secure=!0;else if(l===`httponly`)t.httpOnly=!0;else if(l===`samesite`){let e=`Default`,n=s.toLowerCase();n.includes(`none`)&&(e=`None`),n.includes(`strict`)&&(e=`Strict`),n.includes(`lax`)&&(e=`Lax`),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${i}=${s}`);return c(e,t)}t.exports={parseSetCookie:s,parseUnparsedAttributes:c}})),tn=U(((e,t)=>{let{parseSetCookie:n}=en(),{stringify:r}=$t(),{webidl:i}=Ke(),{Headers:a}=Rt();function o(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 s(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),l(e,{name:t,value:``,expires:new Date(0),...n})}function c(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),i.brandCheck(e,a,{strict:!1});let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function l(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:o,deleteCookie:s,getSetCookies:c,setCookie:l}})),nn=U(((e,t)=>{let{webidl:n}=Ke(),{kEnumerableProperty:r}=Me(),{kConstruct:i}=Oe(),{MessagePort:a}=W(`node:worker_threads`);var o=class e 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,e),this.#e.data}get origin(){return n.brandCheck(this,e),this.#e.origin}get lastEventId(){return n.brandCheck(this,e),this.#e.lastEventId}get source(){return n.brandCheck(this,e),this.#e.source}get ports(){return n.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,r=!1,i=!1,a=null,o=``,s=``,c=null,l=[]){return n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}static createFastMessageEvent(t,n){let r=new e(i,t,n);return r.#e=n,r.#e.data??=null,r.#e.origin??=``,r.#e.lastEventId??=``,r.#e.source??=null,r.#e.ports??=[],r}};let{createFastMessageEvent:s}=o;delete o.createFastMessageEvent;var c=class e 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,e),this.#e.wasClean}get code(){return n.brandCheck(this,e),this.#e.code}get reason(){return n.brandCheck(this,e),this.#e.reason}},l=class e 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,e),this.#e.message}get filename(){return n.brandCheck(this,e),this.#e.filename}get lineno(){return n.brandCheck(this,e),this.#e.lineno}get colno(){return n.brandCheck(this,e),this.#e.colno}get error(){return n.brandCheck(this,e),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}})),rn=U(((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}}})),an=U(((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`)}})),on=U(((e,t)=>{let{kReadyState:n,kController:r,kResponse:i,kBinaryType:a,kWebSocketURL:o}=an(),{states:s,opcodes:c}=rn(),{ErrorEvent:l,createFastMessageEvent:u}=nn(),{isUtf8:d}=W(`node:buffer`),{collectASequenceOfCodePointsFast:f,removeHTTPWhitespace:p}=Ge();function m(e){return e[n]===s.CONNECTING}function h(e){return e[n]===s.OPEN}function g(e){return e[n]===s.CLOSING}function v(e){return e[n]===s.CLOSED}function y(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function b(e,t,r){if(e[n]!==s.OPEN)return;let i;if(t===c.TEXT)try{i=N(r)}catch{w(e,`Received invalid UTF-8 in text frame.`);return}else t===c.BINARY&&(i=e[a]===`blob`?new Blob([r]):x(r));y(`message`,e,u,{origin:e[o].origin,data:i})}function x(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function S(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 C(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function w(e,t){let{[r]:n,[i]:a}=e;n.abort(),a?.socket&&!a.socket.destroyed&&a.socket.destroy(),t&&y(`error`,e,(e,t)=>new l(e,t),{error:Error(t),message:t})}function T(e){return e===c.CLOSE||e===c.PING||e===c.PONG}function E(e){return e===c.CONTINUATION}function D(e){return e===c.TEXT||e===c.BINARY}function O(e){return D(e)||E(e)||T(e)}function k(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 j=typeof process.versions.icu==`string`,M=j?new TextDecoder(`utf-8`,{fatal:!0}):void 0,N=j?M.decode.bind(M):function(e){if(d(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)};t.exports={isConnecting:m,isEstablished:h,isClosing:g,isClosed:v,fireEvent:y,isValidSubprotocol:S,isValidStatusCode:C,failWebsocketConnection:w,websocketMessageReceived:b,utf8Decode:N,isControlFrame:T,isContinuationFrame:E,isTextBinaryFrame:D,isValidOpcode:O,parseExtensions:k,isValidClientWindowBits:A}})),sn=U(((e,t)=>{let{maxUnsigned16Bit:n}=rn(),r=16386,i,a=null,o=r;try{i=W(`node:crypto`)}catch{i={randomFillSync:function(e,t,n){for(let t=0;tn?(o+=8,a=127):i>125&&(o+=2,a=126);let c=Buffer.allocUnsafe(i+o);c[0]=c[1]=0,c[0]|=128,c[0]=(c[0]&240)+e,c[o-4]=r[0],c[o-3]=r[1],c[o-2]=r[2],c[o-1]=r[3],c[1]=a,a===126?c.writeUInt16BE(i,2):a===127&&(c[2]=c[3]=0,c.writeUIntBE(i,4,6)),c[1]|=128;for(let e=0;e{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=rn(),{kReadyState:s,kSentClose:c,kByteParser:l,kReceivedClose:u,kResponse:d}=an(),{fireEvent:f,failWebsocketConnection:p,isClosing:m,isClosed:h,isEstablished:g,parseExtensions:v}=on(),{channels:y}=Ne(),{CloseEvent:b}=nn(),{makeRequest:x}=Vt(),{fetching:S}=Ht(),{Headers:C,getHeadersList:w}=Rt(),{getDecodeSplit:T}=qe(),{WebsocketFrameSend:E}=sn(),D;try{D=W(`node:crypto`)}catch{}function O(e,t,r,i,a,o){let s=e;s.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=x({urlList:[s],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`});o.headers&&(c.headersList=w(new C(o.headers)));let l=D.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`),S({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`)!==D.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=v(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&&!T(`sec-websocket-protocol`,c.headersList).includes(s)){p(i,`Protocol was not set in the opening handshake.`);return}e.socket.on(`data`,A),e.socket.on(`close`,j),e.socket.on(`error`,M),y.open.hasSubscribers&&y.open.publish({address:e.socket.address(),protocol:s,extensions:r}),a(e,o)}})}function k(e,t,n,l){if(!(m(e)||h(e)))if(!g(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 E;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 A(e){this.ws[l].write(e)||this.pause()}function j(){let{ws:e}=this,{[d]:t}=e;t.socket.off(`data`,A),t.socket.off(`close`,j),t.socket.off(`error`,M);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 b(e,t),{wasClean:n,code:a,reason:o}),y.close.hasSubscribers&&y.close.publish({websocket:e,code:a,reason:o})}function M(e){let{ws:t}=this;t[s]=r.CLOSING,y.socketError.hasSubscribers&&y.socketError.publish(e),this.destroy()}t.exports={establishWebSocketConnection:O,closeWebSocketConnection:k}})),ln=U(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=W(`node:zlib`),{isValidClientWindowBits:i}=on(),{MessageSizeExceededError:a}=ke(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=!1;#r=null;constructor(e){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`)}decompress(e,t,l){if(this.#n){l(new a);return}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.#n){if(this.#e[c]+=e.length,this.#e[c]>4194304){if(this.#n=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#r){let e=this.#r;this.#r=null,e(new a)}return}this.#e[s].push(e)}}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#r=l,this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(this.#n||!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,this.#r=null,l(null,e)})}}}})),un=U(((e,t)=>{let{Writable:n}=W(`node:stream`),r=W(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=rn(),{kReadyState:l,kSentClose:u,kResponse:d,kReceivedClose:f}=an(),{channels:p}=Ne(),{isValidStatusCode:m,isValidOpcode:h,failWebsocketConnection:g,websocketMessageReceived:v,utf8Decode:y,isControlFrame:b,isTextBinaryFrame:x,isContinuationFrame:S}=on(),{WebsocketFrameSend:C}=sn(),{closeWebSocketConnection:w}=cn(),{PerMessageDeflate:T}=ln();t.exports={ByteParser:class extends n{#e=[];#t=0;#n=!1;#r=i.INFO;#i={};#a=[];#o;constructor(e,t){super(),this.ws=e,this.#o=t??new Map,this.#o.has(`permessage-deflate`)&&this.#o.set(`permessage-deflate`,new T(t))}_write(e,t,n){this.#e.push(e),this.#t+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#r===i.INFO){if(this.#t<2)return e();let t=this.consume(2),n=(t[0]&128)!=0,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(!h(r))return g(this.ws,`Invalid opcode received`),e();if(o)return g(this.ws,`Frame cannot be masked`),e();if(l!==0&&!this.#o.has(`permessage-deflate`)){g(this.ws,`Expected RSV1 to be clear.`);return}if(u!==0||d!==0){g(this.ws,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!x(r)){g(this.ws,`Invalid frame type was fragmented.`);return}if(x(r)&&this.#a.length>0){g(this.ws,`Expected continuation frame`);return}if(this.#i.fragmented&&s){g(this.ws,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&b(r)){g(this.ws,`Control frame either too large or fragmented`);return}if(S(r)&&this.#a.length===0&&!this.#i.compressed){g(this.ws,`Unexpected continuation frame`);return}c<=125?(this.#i.payloadLength=c,this.#r=i.READ_DATA):c===126?this.#r=i.PAYLOADLENGTH_16:c===127&&(this.#r=i.PAYLOADLENGTH_64),x(r)&&(this.#i.binaryType=r,this.#i.compressed=l!==0),this.#i.opcode=r,this.#i.masked=o,this.#i.fin=n,this.#i.fragmented=s}else if(this.#r===i.PAYLOADLENGTH_16){if(this.#t<2)return e();let t=this.consume(2);this.#i.payloadLength=t.readUInt16BE(0),this.#r=i.READ_DATA}else if(this.#r===i.PAYLOADLENGTH_64){if(this.#t<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){g(this.ws,`Received payload length > 2^31 bytes.`);return}this.#i.payloadLength=r,this.#r=i.READ_DATA}else if(this.#r===i.READ_DATA){if(this.#t{if(t){g(this.ws,t.message);return}if(this.#a.push(n),!this.#i.fin){this.#r=i.INFO,this.#n=!0,this.run(e);return}v(this.ws,this.#i.binaryType,Buffer.concat(this.#a)),this.#n=!0,this.#r=i.INFO,this.#a.length=0,this.run(e)}),this.#n=!1;break}else{if(this.#a.push(t),!this.#i.fragmented&&this.#i.fin){let e=Buffer.concat(this.#a);v(this.ws,this.#i.binaryType,e),this.#a.length=0}this.#r=i.INFO}}}consume(e){if(e>this.#t)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;if(this.#e[0].length===e)return this.#t-=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}else if(i+n>e){t.set(r.subarray(0,e-n),n),this.#e[0]=r.subarray(e-n);break}else t.set(this.#e.shift(),n),n+=r.length}return this.#t-=e,t}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!m(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=y(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.#i;if(t===a.CLOSE){if(n===1)return g(this.ws,`Received close frame with a 1-byte body.`),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:e,reason:t}=this.#i.closeInfo;return w(this.ws,e,t,t.length),g(this.ws,t),!1}if(this.ws[u]!==c.SENT){let e=s;this.#i.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#i.closeInfo.code,0));let t=new C(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}else if(t===a.PING){if(!this.ws[f]){let t=new C(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.#i.closeInfo}}}})),dn=U(((e,t)=>{let{WebsocketFrameSend:n}=sn(),{opcodes:r,sendHints:i}=rn(),a=it(),o=Buffer[Symbol.species];var s=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,n){if(n!==i.blob){let r=c(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=c(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 c(e,t){return new n(l(e,t)).createFrame(t===i.string?r.TEXT:r.BINARY)}function l(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:s}})),fn=U(((e,t)=>{let{webidl:n}=Ke(),{URLSerializer:r}=Ge(),{environmentSettingsObject:i}=qe(),{staticPropertyDescriptors:a,states:o,sentCloseFrameState:s,sendHints:c}=rn(),{kWebSocketURL:l,kReadyState:u,kController:d,kBinaryType:f,kResponse:p,kSentClose:m,kByteParser:h}=an(),{isConnecting:g,isEstablished:v,isClosing:y,isValidSubprotocol:b,fireEvent:x}=on(),{establishWebSocketConnection:S,closeWebSocketConnection:C}=cn(),{ByteParser:w}=un(),{kEnumerableProperty:T,isBlobLike:E}=Me(),{getGlobalDispatcher:D}=Mt(),{types:O}=W(`node:util`),{ErrorEvent:k,CloseEvent:A}=nn(),{SendQueue:j}=dn();var M=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i;constructor(t,r=[]){super(),n.util.markAsUncloneable(this);let a=`WebSocket constructor`;n.argumentLengthCheck(arguments,1,a);let o=n.converters[`DOMString or sequence or WebSocketInit`](r,a,`options`);t=n.converters.USVString(t,a,`url`),r=o.protocols;let c=i.settingsObject.baseUrl,p;try{p=new URL(t,c)}catch(e){throw new DOMException(e,`SyntaxError`)}if(p.protocol===`http:`?p.protocol=`ws:`:p.protocol===`https:`&&(p.protocol=`wss:`),p.protocol!==`ws:`&&p.protocol!==`wss:`)throw new DOMException(`Expected a ws: or wss: protocol, got ${p.protocol}`,`SyntaxError`);if(p.hash||p.href.endsWith(`#`))throw new DOMException(`Got fragment`,`SyntaxError`);if(typeof r==`string`&&(r=[r]),r.length!==new Set(r.map(e=>e.toLowerCase())).size||r.length>0&&!r.every(e=>b(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this[l]=new URL(p.href);let h=i.settingsObject;this[d]=S(p,r,h,this,(e,t)=>this.#a(e,t),o),this[u]=e.CONNECTING,this[m]=s.NOT_SENT,this[f]=`blob`}close(t=void 0,r=void 0){n.brandCheck(this,e);let i=`WebSocket.close`;if(t!==void 0&&(t=n.converters[`unsigned short`](t,i,`code`,{clamp:!0})),r!==void 0&&(r=n.converters.USVString(r,i,`reason`)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);let a=0;if(r!==void 0&&(a=Buffer.byteLength(r),a>123))throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,`SyntaxError`);C(this,t,r,a)}send(t){n.brandCheck(this,e);let r=`WebSocket.send`;if(n.argumentLengthCheck(arguments,1,r),t=n.converters.WebSocketSendData(t,r,`data`),g(this))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!v(this)||y(this)))if(typeof t==`string`){let e=Buffer.byteLength(t);this.#t+=e,this.#i.add(t,()=>{this.#t-=e},c.string)}else O.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#i.add(t,()=>{this.#t-=t.byteLength},c.typedArray)):E(t)&&(this.#t+=t.size,this.#i.add(t,()=>{this.#t-=t.size},c.blob))}get readyState(){return n.brandCheck(this,e),this[u]}get bufferedAmount(){return n.brandCheck(this,e),this.#t}get url(){return n.brandCheck(this,e),r(this[l])}get extensions(){return n.brandCheck(this,e),this.#r}get protocol(){return n.brandCheck(this,e),this.#n}get onopen(){return n.brandCheck(this,e),this.#e.open}set onopen(t){n.brandCheck(this,e),this.#e.open&&this.removeEventListener(`open`,this.#e.open),typeof t==`function`?(this.#e.open=t,this.addEventListener(`open`,t)):this.#e.open=null}get onerror(){return n.brandCheck(this,e),this.#e.error}set onerror(t){n.brandCheck(this,e),this.#e.error&&this.removeEventListener(`error`,this.#e.error),typeof t==`function`?(this.#e.error=t,this.addEventListener(`error`,t)):this.#e.error=null}get onclose(){return n.brandCheck(this,e),this.#e.close}set onclose(t){n.brandCheck(this,e),this.#e.close&&this.removeEventListener(`close`,this.#e.close),typeof t==`function`?(this.#e.close=t,this.addEventListener(`close`,t)):this.#e.close=null}get onmessage(){return n.brandCheck(this,e),this.#e.message}set onmessage(t){n.brandCheck(this,e),this.#e.message&&this.removeEventListener(`message`,this.#e.message),typeof t==`function`?(this.#e.message=t,this.addEventListener(`message`,t)):this.#e.message=null}get binaryType(){return n.brandCheck(this,e),this[f]}set binaryType(t){n.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this[f]=`blob`:this[f]=t}#a(e,t){this[p]=e;let n=new w(this,t);n.on(`drain`,N),n.on(`error`,P.bind(this)),e.socket.ws=this,this[h]=n,this.#i=new j(e.socket),this[u]=o.OPEN;let r=e.headersList.get(`sec-websocket-extensions`);r!==null&&(this.#r=r);let i=e.headersList.get(`sec-websocket-protocol`);i!==null&&(this.#n=i),x(`open`,this)}};M.CONNECTING=M.prototype.CONNECTING=o.CONNECTING,M.OPEN=M.prototype.OPEN=o.OPEN,M.CLOSING=M.prototype.CLOSING=o.CLOSING,M.CLOSED=M.prototype.CLOSED=o.CLOSED,Object.defineProperties(M.prototype,{CONNECTING:a,OPEN:a,CLOSING:a,CLOSED:a,url:T,readyState:T,bufferedAmount:T,onopen:T,onerror:T,onclose:T,close:T,onmessage:T,binaryType:T,send:T,extensions:T,protocol:T,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(M,{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:()=>D()},{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(E(e))return n.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||O.isArrayBuffer(e))return n.converters.BufferSource(e)}return n.converters.USVString(e)};function N(){this.ws[p].socket.resume()}function P(e){let t,n;e instanceof A?(t=e.reason,n=e.code):t=e.message,x(`error`,this,()=>new k(`error`,{error:e,message:t})),C(this,n)}t.exports={WebSocket:M}})),pn=U(((e,t)=>{function n(e){return e.indexOf(`\0`)===-1}function r(e){if(e.length===0)return!1;for(let t=0;t57)return!1;return!0}function i(e){return new Promise(t=>{setTimeout(t,e).unref()})}t.exports={isValidLastEventId:n,isASCIINumber:r,delay:i}})),mn=U(((e,t)=>{let{Transform:n}=W(`node:stream`),{isASCIINumber:r,isValidLastEventId:i}=pn(),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]):this.buffer=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;break}for(;this.pos0&&(t[a]=o);break}}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}}}}})),hn=U(((e,t)=>{let{pipeline:n}=W(`node:stream`),{fetching:r}=Ht(),{makeRequest:i}=Vt(),{webidl:a}=Ke(),{EventSourceStream:o}=mn(),{parseMIMEType:s}=Ge(),{createFastMessageEvent:c}=nn(),{isNetworkError:l}=zt(),{delay:u}=pn(),{kEnumerableProperty:d}=Me(),{environmentSettingsObject:f}=qe(),p=!1,m=3e3;var h=class e 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:m};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}else{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,e),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 g={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(h,g),Object.defineProperties(h.prototype,g),Object.defineProperties(h.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:h,defaultReconnectionTime:m}})),gn=U(((e,t)=>{let n=rt(),r=Fe(),i=st(),a=ct(),o=lt(),s=ut(),c=dt(),l=pt(),u=ke(),d=Me(),{InvalidArgumentError:f}=u,p=St(),m=Re(),h=Dt(),g=jt(),v=Ot(),y=Ct(),b=ft(),{getGlobalDispatcher:x,setGlobalDispatcher:S}=Mt(),C=Nt(),w=tt(),T=nt();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=b,t.exports.DecoratorHandler=C,t.exports.RedirectHandler=w,t.exports.createRedirectInterceptor=T,t.exports.interceptors={redirect:Pt(),retry:Ft(),dump:It(),dns:Lt()},t.exports.buildConnector=m,t.exports.errors=u,t.exports.util={parseHeaders:d.parseHeaders,headerNameToString:d.headerNameToString};function E(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=x()}=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=S,t.exports.getGlobalDispatcher=x;let D=Ht().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=Rt().Headers,t.exports.Response=zt().Response,t.exports.Request=Vt().Request,t.exports.FormData=Xe().FormData,t.exports.File=globalThis.File??W(`node:buffer`).File,t.exports.FileReader=qt().FileReader;let{setGlobalOrigin:O,getGlobalOrigin:k}=We();t.exports.setGlobalOrigin=O,t.exports.getGlobalOrigin=k;let{CacheStorage:A}=Zt(),{kConstruct:j}=Jt();t.exports.caches=new A(j);let{deleteCookie:M,getCookies:N,getSetCookies:P,setCookie:F}=tn();t.exports.deleteCookie=M,t.exports.getCookies=N,t.exports.getSetCookies=P,t.exports.setCookie=F;let{parseMIMEType:I,serializeAMimeType:L}=Ge();t.exports.parseMIMEType=I,t.exports.serializeAMimeType=L;let{CloseEvent:R,ErrorEvent:z,MessageEvent:ee}=nn();t.exports.WebSocket=fn().WebSocket,t.exports.CloseEvent=R,t.exports.ErrorEvent=z,t.exports.MessageEvent=ee,t.exports.request=E(p.request),t.exports.stream=E(p.stream),t.exports.pipeline=E(p.pipeline),t.exports.connect=E(p.connect),t.exports.upgrade=E(p.upgrade),t.exports.MockClient=h,t.exports.MockPool=v,t.exports.MockAgent=g,t.exports.mockErrors=y;let{EventSource:B}=hn();t.exports.EventSource=B})),_n=pe(De(),1),vn=gn(),yn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},bn;(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`})(bn||={});var xn;(function(e){e.Accept=`accept`,e.ContentType=`content-type`})(xn||={});var Sn;(function(e){e.ApplicationJson=`application/json`})(Sn||={});const Cn=[bn.MovedPermanently,bn.ResourceMoved,bn.SeeOther,bn.TemporaryRedirect,bn.PermanentRedirect],wn=[bn.BadGateway,bn.ServiceUnavailable,bn.GatewayTimeout],Tn=[`OPTIONS`,`GET`,`DELETE`,`HEAD`];var En=class e extends Error{constructor(t,n){super(t),this.name=`HttpClientError`,this.statusCode=n,Object.setPrototypeOf(this,e.prototype)}},Dn=class{constructor(e){this.message=e}readBody(){return yn(this,void 0,void 0,function*(){return new Promise(e=>yn(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 yn(this,void 0,void 0,function*(){return new Promise(e=>yn(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}},On=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 yn(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return yn(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return yn(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return yn(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return yn(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return yn(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return yn(this,arguments,void 0,function*(e,t={}){t[xn.Accept]=this._getExistingOrDefaultHeader(t,xn.Accept,Sn.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return yn(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[xn.Accept]=this._getExistingOrDefaultHeader(n,xn.Accept,Sn.ApplicationJson),n[xn.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,Sn.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return yn(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&&Tn.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===bn.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&&Cn.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||!wn.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}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 i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new Dn(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=Se(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?g:h;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({},kn(this.requestOptions.headers),kn(e||{})):kn(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=kn(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=kn(this.requestOptions.headers)[xn.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[xn.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=Se(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||h.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?_n.httpsOverHttps:_n.httpsOverHttp:o?_n.httpOverHttps:_n.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:a};t=i?new g.Agent(e):new h.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 vn.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(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 yn(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 yn(this,void 0,void 0,function*(){return new Promise((n,r)=>yn(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===bn.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new En(e,i);t.result=a.result,r(t)}else n(a)}))})}};const kn=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{});var An=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},jn=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 An(this,void 0,void 0,function*(){throw Error(`not implemented`)})}},Mn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{access:Nn,appendFile:Pn,writeFile:Fn}=l,In=`GITHUB_STEP_SUMMARY`,Ln=new class{constructor(){this._buffer=``}filePath(){return Mn(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,s.R_OK|s.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 Mn(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 Mn(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(i)}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 Rn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const{chmod:zn,copyFile:Bn,lstat:Vn,mkdir:Hn,open:Un,readdir:Wn,rename:Gn,rm:Kn,rmdir:qn,stat:Jn,symlink:Yn,unlink:Xn}=o.promises,Zn=process.platform===`win32`;function Qn(e){return Rn(this,void 0,void 0,function*(){let t=yield o.promises.readlink(e);return Zn&&!t.endsWith(`\\`)?`${t}\\`:t})}o.constants.O_RDONLY;function $n(e){return Rn(this,void 0,void 0,function*(){try{yield Jn(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}return!0})}function er(e){if(e=nr(e),!e)throw Error(`isRooted() parameter "p" cannot be empty`);return Zn?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function tr(e,t){return Rn(this,void 0,void 0,function*(){let n;try{n=yield Jn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Zn){let n=f.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===n))return e}else if(rr(n))return e}let r=e;for(let i of t){e=r+i,n=void 0;try{n=yield Jn(e)}catch(t){t.code!==`ENOENT`&&console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}if(n&&n.isFile()){if(Zn){try{let t=f.dirname(e),n=f.basename(e).toUpperCase();for(let r of yield Wn(t))if(n===r.toUpperCase()){e=f.join(t,r);break}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else if(rr(n))return e}}return``})}function nr(e){return e||=``,Zn?(e=e.replace(/\//g,`\\`),e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function rr(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 ir=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function ar(e,t){return ir(this,arguments,void 0,function*(e,t,n={}){let{force:r,recursive:i,copySourceDirectory:a}=ur(n),o=(yield $n(t))?yield Jn(t):null;if(o&&o.isFile()&&!r)return;let s=o&&o.isDirectory()&&a?f.join(t,f.basename(e)):t;if(!(yield $n(e)))throw Error(`no such file or directory: ${e}`);if((yield Jn(e)).isDirectory())if(i)yield dr(e,s,0,r);else throw Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);else{if(f.relative(e,s)===``)throw Error(`'${s}' and '${e}' are the same file`);yield fr(e,s,r)}})}function or(e){return ir(this,void 0,void 0,function*(){if(Zn&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield Kn(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw Error(`File was unable to be removed ${e}`)}})}function sr(e){return ir(this,void 0,void 0,function*(){x(e,`a path argument must be provided`),yield Hn(e,{recursive:!0})})}function cr(e,t){return ir(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);if(t){let t=yield cr(e,!1);if(!t)throw Error(Zn?`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 lr(e);return n&&n.length>0?n[0]:``})}function lr(e){return ir(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'tool' is required`);let t=[];if(Zn&&process.env.PATHEXT)for(let e of process.env.PATHEXT.split(f.delimiter))e&&t.push(e);if(er(e)){let n=yield tr(e,t);return n?[n]:[]}if(e.includes(f.sep))return[];let n=[];if(process.env.PATH)for(let e of process.env.PATH.split(f.delimiter))e&&n.push(e);let r=[];for(let i of n){let n=yield tr(f.join(i,e),t);n&&r.push(n)}return r})}function ur(e){return{force:e.force==null?!0:e.force,recursive:!!e.recursive,copySourceDirectory:e.copySourceDirectory==null?!0:!!e.copySourceDirectory}}function dr(e,t,n,r){return ir(this,void 0,void 0,function*(){if(n>=255)return;n++,yield sr(t);let i=yield Wn(e);for(let a of i){let i=`${e}/${a}`,o=`${t}/${a}`;(yield Vn(i)).isDirectory()?yield dr(i,o,n,r):yield fr(i,o,r)}yield zn(t,(yield Jn(e)).mode)})}function fr(e,t,n){return ir(this,void 0,void 0,function*(){if((yield Vn(e)).isSymbolicLink()){try{yield Vn(t),yield Xn(t)}catch(e){e.code===`EPERM`&&(yield zn(t,`0666`),yield Xn(t))}yield Yn(yield Qn(e),t,Zn?`junction`:null)}else (!(yield $n(t))||n)&&(yield Bn(e,t))})}var pr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const mr=process.platform===`win32`;var hr=class extends v.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(mr)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,t,r){try{let i=t+e.toString(),a=i.indexOf(n.EOL);for(;a>-1;)r(i.substring(0,a)),i=i.substring(a+n.EOL.length),a=i.indexOf(n.EOL);return i}catch(e){return this._debug(`error processing line. Failed with error ${e}`),``}}_getSpawnFileName(){return mr&&this._isCmdFile()?process.env.COMSPEC||`cmd.exe`:this.toolPath}_getSpawnArgs(e){if(mr&&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 pr(this,void 0,void 0,function*(){return!er(this.toolPath)&&(this.toolPath.includes(`/`)||mr&&this.toolPath.includes(`\\`))&&(this.toolPath=f.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield cr(this.toolPath,!0),new Promise((e,t)=>pr(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)+n.EOL);let i=new _r(r,this.toolPath);if(i.on(`debug`,e=>{this._debug(e)}),this.options.cwd&&!(yield $n(this.options.cwd)))return t(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`,(n,r)=>{s.length>0&&this.emit(`stdline`,s),c.length>0&&this.emit(`errline`,c),o.removeAllListeners(),n?t(n):e(r)}),this.options.input){if(!o.stdin)throw Error(`child process missing stdin`);o.stdin.end(this.options.input)}}))})}};function gr(e){let t=[],n=!1,r=!1,i=``;function a(e){r&&e!==`"`&&(i+=`\\`),i+=e,r=!1}for(let o=0;o0&&(t.push(i),i=``);continue}a(s)}return i.length>0&&t.push(i.trim()),t}var _r=class e extends v.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(e.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()}}},vr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function yr(e,t,n){return vr(this,void 0,void 0,function*(){let r=gr(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 hr(i,t,n).exec()})}function br(e,t,n){return vr(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 yr(e,t,Object.assign(Object.assign({},n),{listeners:l}));return r+=a.end(),i+=o.end(),{exitCode:u,stdout:r,stderr:i}})}r.platform(),r.arch();var xr;(function(e){e[e.Success=0]=`Success`,e[e.Failure=1]=`Failure`})(xr||={});function Sr(e,t){let n=me(t);if(process.env[e]=n,process.env.GITHUB_ENV)return be(`ENV`,xe(e,t));ge(`set-env`,{name:e},n)}function Cr(e){ge(`add-mask`,{},e)}function wr(e){process.env.GITHUB_PATH?be(`PATH`,e):ge(`add-path`,{},e),process.env.PATH=`${e}${f.delimiter}${process.env.PATH}`}function Tr(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 Er(e,t){if(process.env.GITHUB_OUTPUT)return be(`OUTPUT`,xe(e,t));process.stdout.write(n.EOL),ge(`set-output`,{name:e},me(t))}function Dr(e){process.exitCode=xr.Failure,kr(e)}function Or(){return process.env.RUNNER_DEBUG===`1`}function G(e){ge(`debug`,{},e)}function kr(e,t={}){ge(`error`,he(t),e instanceof Error?e.toString():e)}function Ar(e,t={}){ge(`warning`,he(t),e instanceof Error?e.toString():e)}function jr(e){process.stdout.write(e+n.EOL)}function Mr(e,t){if(process.env.GITHUB_STATE)return be(`STATE`,xe(e,t));ge(`save-state`,{name:e},me(t))}function Nr(e){return process.env[`STATE_${e}`]||``}function Pr(e){return e instanceof Error?e.message:String(e)}const Fr=[`token`,`password`,`secret`,`key`,`auth`,`credential`,`bearer`,`apikey`,`api_key`,`access_token`,`refresh_token`,`private`];function Ir(e,t){let n=e.toLowerCase();return t.some(e=>n.includes(e.toLowerCase()))}function Lr(e,t=Fr){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Lr(e,t));let n={};for(let[r,i]of Object.entries(e))Ir(r,t)&&typeof i==`string`?n[r]=`[REDACTED]`:typeof i==`object`&&i?n[r]=Lr(i,t):n[r]=i;return n}function Rr(e,t,n,r){let i=Lr({...n,...r}),a={timestamp:new Date().toISOString(),level:e,message:t,...i};if(r!=null&&`error`in r&&r.error instanceof Error){let e=r.error;a.error={message:e.message,name:e.name,stack:e.stack}}return JSON.stringify(a)}function zr(e){return{debug:(t,n)=>{G(Rr(`debug`,t,e,n))},info:(t,n)=>{jr(Rr(`info`,t,e,n))},warning:(t,n)=>{Ar(Rr(`warning`,t,e,n))},error:(t,n)=>{kr(Rr(`error`,t,e,n))}}}const Br={SHOULD_SAVE_CACHE:`shouldSaveCache`,SESSION_ID:`sessionId`,CACHE_SAVED:`cacheSaved`,ARTIFACT_UPLOADED:`artifactUploaded`,OPENCODE_VERSION:`opencodeVersion`},Vr=`sisyphus`,Hr=18e5,Ur={providerID:`opencode`,modelID:`big-pickle`},Wr=`1.3.9`,Gr=`1.3.11`,Kr=`3.14.0`,qr=`2.1.0`,Jr=`opencode-storage`,Yr=`opencode-tools`,Xr=6e5,Zr=`fro-bot-dedup-v1`;function Qr(){let e=t.env.XDG_DATA_HOME;return e!=null&&e.trim().length>0?e:F.join(I.homedir(),`.local`,`share`)}function $r(){return F.join(Qr(),`opencode`,`storage`)}function ei(){return F.join(Qr(),`opencode`,`auth.json`)}function ti(){return F.join(Qr(),`opencode`,`log`)}function ni(){let e=t.env.OPENCODE_PROMPT_ARTIFACT;return e===`true`||e===`1`}function ri(){let e=t.env.RUNNER_OS;if(e!=null&&e.trim().length>0)return e;switch(I.platform()){case`darwin`:return`macOS`;case`win32`:return`Windows`;case`aix`:case`android`:case`freebsd`:case`haiku`:case`linux`:case`openbsd`:case`sunos`:case`cygwin`:case`netbsd`:return`Linux`}}function ii(){let e=t.env.GITHUB_REPOSITORY;return e!=null&&e.trim().length>0?e:`unknown/unknown`}function ai(){let e=t.env.GITHUB_REF_NAME;return e!=null&&e.trim().length>0?e:`main`}function oi(){let e=t.env.GITHUB_RUN_ID;return e!=null&&e.trim().length>0?Number(e):0}function si(){let e=t.env.GITHUB_RUN_ATTEMPT;if(e!=null&&e.trim().length>0){let t=Number(e);if(Number.isFinite(t)&&t>0)return t}return 1}function ci(){let e=t.env.GITHUB_WORKSPACE;return e!=null&&e.trim().length>0?e:t.cwd()}var li=class{constructor(){if(this.payload={},process.env.GITHUB_EVENT_PATH)if(c(process.env.GITHUB_EVENT_PATH))this.payload=JSON.parse(u(process.env.GITHUB_EVENT_PATH,{encoding:`utf8`}));else{let e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${i}`)}this.eventName=process.env.GITHUB_EVENT_NAME,this.sha=process.env.GITHUB_SHA,this.ref=process.env.GITHUB_REF,this.workflow=process.env.GITHUB_WORKFLOW,this.action=process.env.GITHUB_ACTION,this.actor=process.env.GITHUB_ACTOR,this.job=process.env.GITHUB_JOB,this.runAttempt=parseInt(process.env.GITHUB_RUN_ATTEMPT,10),this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10),this.runId=parseInt(process.env.GITHUB_RUN_ID,10),this.apiUrl=process.env.GITHUB_API_URL??`https://api.github.com`,this.serverUrl=process.env.GITHUB_SERVER_URL??`https://github.com`,this.graphqlUrl=process.env.GITHUB_GRAPHQL_URL??`https://api.github.com/graphql`}get issue(){let e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){let[e,t]=process.env.GITHUB_REPOSITORY.split(`/`);return{owner:e,repo:t}}if(this.payload.repository)return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name};throw Error(`context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'`)}},ui=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getProxyUrl=t,e.checkBypass=n;function t(e){let t=e.protocol===`https:`;if(n(e))return;let r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new i(r)}catch{if(!r.startsWith(`http://`)&&!r.startsWith(`https://`))return new i(`http://${r}`)}else return}function n(e){if(!e.hostname)return!1;let t=e.hostname;if(r(t))return!0;let n=process.env.no_proxy||process.env.NO_PROXY||``;if(!n)return!1;let i;e.port?i=Number(e.port):e.protocol===`http:`?i=80:e.protocol===`https:`&&(i=443);let a=[e.hostname.toUpperCase()];typeof i==`number`&&a.push(`${a[0]}:${i}`);for(let e of n.split(`,`).map(e=>e.trim().toUpperCase()).filter(e=>e))if(e===`*`||a.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(`.`)&&t.endsWith(`${e}`)))return!0;return!1}function r(e){let t=e.toLowerCase();return t===`localhost`||t.startsWith(`127.`)||t.startsWith(`[::1]`)||t.startsWith(`[0:0:0:0:0:0:0:1]`)}var i=class extends URL{constructor(e,t){super(e,t),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}})),di=pe(U((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(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;oi(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 i(this,void 0,void 0,function*(){return new Promise(e=>i(this,void 0,void 0,function*(){let t=[];this.message.on(`data`,e=>{t.push(e)}),this.message.on(`end`,()=>{e(Buffer.concat(t))})}))})}};e.HttpClientResponse=y;function b(e){return new URL(e).protocol===`https:`}e.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 i(this,void 0,void 0,function*(){return this.request(`OPTIONS`,e,null,t||{})})}get(e,t){return i(this,void 0,void 0,function*(){return this.request(`GET`,e,null,t||{})})}del(e,t){return i(this,void 0,void 0,function*(){return this.request(`DELETE`,e,null,t||{})})}post(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`POST`,e,t,n||{})})}patch(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PATCH`,e,t,n||{})})}put(e,t,n){return i(this,void 0,void 0,function*(){return this.request(`PUT`,e,t,n||{})})}head(e,t){return i(this,void 0,void 0,function*(){return this.request(`HEAD`,e,null,t||{})})}sendStream(e,t,n,r){return i(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e){return i(this,arguments,void 0,function*(e,t={}){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,f.ApplicationJson);let n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t){return i(this,arguments,void 0,function*(e,t,n={}){let r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,f.ApplicationJson),n[d.ContentType]=this._getExistingOrDefaultContentTypeHeader(n,f.ApplicationJson);let i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return i(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&&g.includes(e)?this._maxRetries+1:1,s=0,c;do{if(c=yield this.requestRaw(a,n),c&&c.message&&c.message.statusCode===u.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&&m.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||!h.includes(c.message.statusCode))return c;s+=1,s{function i(e,t){e?r(e):t?n(t):r(Error(`Unknown error`))}this.requestRawWithCallback(e,t,i)})})}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 i(e,t){r||(r=!0,n(e,t))}let a=e.httpModule.request(e.options,e=>{i(void 0,new y(e))}),o;a.on(`socket`,e=>{o=e}),a.setTimeout(this._socketTimeout||3*6e4,()=>{o&&o.end(),i(Error(`Request timeout: ${e.options.path}`))}),a.on(`error`,function(e){i(e)}),t&&typeof t==`string`&&a.write(t,`utf8`),t&&typeof t!=`string`?(t.on(`close`,function(){a.end()}),t.pipe(a)):a.end()}getAgent(e){let t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){let t=new URL(e),n=s.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?o:a;let s=i?443:80;if(r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s,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({},x(this.requestOptions.headers),x(e||{})):x(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){let e=x(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=x(this.requestOptions.headers)[d.ContentType];e&&(n=typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):e)}let r=e[d.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=s.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:`,l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||a.globalAgent.maxSockets),n&&n.hostname){let e={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},r,a=n.protocol===`https:`;r=i?a?c.httpsOverHttps:c.httpsOverHttp:a?c.httpOverHttps:c.httpOverHttp,t=r(e),this._proxyAgent=t}if(!t){let e={keepAlive:this._keepAlive,maxSockets:l};t=i?new o.Agent(e):new a.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 l.ProxyAgent(Object.assign({uri:t.href,pipelining:this._keepAlive?1:0},(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 i(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 i(this,void 0,void 0,function*(){return new Promise((n,r)=>i(this,void 0,void 0,function*(){let i=e.message.statusCode||0,a={statusCode:i,result:null,headers:{}};i===u.NotFound&&n(a);function o(e,t){if(typeof t==`string`){let e=new Date(t);if(!isNaN(e.valueOf()))return e}return t}let s,c;try{c=yield e.readBody(),c&&c.length>0&&(s=t&&t.deserializeDates?JSON.parse(c,o):JSON.parse(c),a.result=s),a.headers=e.message.headers}catch{}if(i>299){let e;e=s&&s.message?s.message:c&&c.length>0?c:`Failed request: (${i})`;let t=new v(e,i);t.result=a.result,r(t)}else n(a)}))})}};let x=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})}))(),1),fi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function pi(e,t){if(!e&&!t.auth)throw Error(`Parameter token or opts.auth is required`);if(e&&t.auth)throw Error(`Parameters token and opts.auth may not both be specified`);return typeof t.auth==`string`?t.auth:`token ${e}`}function mi(e){return new di.HttpClient().getAgent(e)}function hi(e){return new di.HttpClient().getAgentDispatcher(e)}function gi(e){let t=hi(e);return(e,n)=>fi(this,void 0,void 0,function*(){return(0,vn.fetch)(e,Object.assign(Object.assign({},n),{dispatcher:t}))})}function _i(){return process.env.GITHUB_API_URL||`https://api.github.com`}function vi(){return typeof navigator==`object`&&`userAgent`in navigator?navigator.userAgent:typeof process==`object`&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:``}function yi(e,t,n,r){if(typeof n!=`function`)throw Error(`method for before hook must be a function`);return r||={},Array.isArray(t)?t.reverse().reduce((t,n)=>yi.bind(null,e,n,t,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((e,t)=>t.hook.bind(null,e,r),n)():n(r))}function bi(e,t,n,r){let i=r;e.registry[n]||(e.registry[n]=[]),t===`before`&&(r=(e,t)=>Promise.resolve().then(i.bind(null,t)).then(e.bind(null,t))),t===`after`&&(r=(e,t)=>{let n;return Promise.resolve().then(e.bind(null,t)).then(e=>(n=e,i(n,t))).then(()=>n)}),t===`error`&&(r=(e,t)=>Promise.resolve().then(e.bind(null,t)).catch(e=>i(e,t))),e.registry[n].push({hook:r,orig:i})}function xi(e,t,n){if(!e.registry[t])return;let r=e.registry[t].map(e=>e.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Si=Function.bind,Ci=Si.bind(Si);function wi(e,t,n){let r=Ci(xi,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,[`before`,`error`,`after`,`wrap`].forEach(r=>{let i=n?[t,r,n]:[t,r];e[r]=e.api[r]=Ci(bi,null).apply(null,i)})}function Ti(){let e=Symbol(`Singular`),t={registry:{}},n=yi.bind(null,t,e);return wi(n,t,e),n}function Ei(){let e={registry:{}},t=yi.bind(null,e);return wi(t,e),t}var Di={Singular:Ti,Collection:Ei},Oi=`octokit-endpoint.js/0.0.0-development ${vi()}`,ki={method:`GET`,baseUrl:`https://api.github.com`,headers:{accept:`application/vnd.github.v3+json`,"user-agent":Oi},mediaType:{format:``}};function Ai(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function ji(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function Mi(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(r=>{ji(t[r])&&r in e?n[r]=Mi(e[r],t[r]):Object.assign(n,{[r]:t[r]})}),n}function Ni(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function Pi(e,t,n){if(typeof t==`string`){let[e,r]=t.split(` `);n=Object.assign(r?{method:e,url:r}:{url:e},n)}else n=Object.assign({},t);n.headers=Ai(n.headers),Ni(n),Ni(n.headers);let r=Mi(e||{},n);return n.url===`/graphql`&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(e=>e.replace(/-preview/,``))),r}function Fi(e,t){let n=/\?/.test(e)?`&`:`?`,r=Object.keys(t);return r.length===0?e:e+n+r.map(e=>e===`q`?`q=`+t.q.split(`+`).map(encodeURIComponent).join(`+`):`${e}=${encodeURIComponent(t[e])}`).join(`&`)}var Ii=/\{[^{}}]+\}/g;function Li(e){return e.replace(/(?:^\W+)|(?:(?e.concat(t),[]):[]}function zi(e,t){let n={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Bi(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`)),e}).join(``)}function Vi(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return`%`+e.charCodeAt(0).toString(16).toUpperCase()})}function Hi(e,t,n){return t=e===`+`||e===`#`?Bi(t):Vi(t),n?Vi(n)+`=`+t:t}function Ui(e){return e!=null}function Wi(e){return e===`;`||e===`&`||e===`?`}function Gi(e,t,n,r){var i=e[n],a=[];if(Ui(i)&&i!==``)if(typeof i==`string`||typeof i==`number`||typeof i==`bigint`||typeof i==`boolean`)i=i.toString(),r&&r!==`*`&&(i=i.substring(0,parseInt(r,10))),a.push(Hi(t,i,Wi(t)?n:``));else if(r===`*`)Array.isArray(i)?i.filter(Ui).forEach(function(e){a.push(Hi(t,e,Wi(t)?n:``))}):Object.keys(i).forEach(function(e){Ui(i[e])&&a.push(Hi(t,i[e],e))});else{let e=[];Array.isArray(i)?i.filter(Ui).forEach(function(n){e.push(Hi(t,n))}):Object.keys(i).forEach(function(n){Ui(i[n])&&(e.push(Vi(n)),e.push(Hi(t,i[n].toString())))}),Wi(t)?a.push(Vi(n)+`=`+e.join(`,`)):e.length!==0&&a.push(e.join(`,`))}else t===`;`?Ui(i)&&a.push(Vi(n)):i===``&&(t===`&`||t===`?`)?a.push(Vi(n)+`=`):i===``&&a.push(``);return a}function Ki(e){return{expand:qi.bind(null,e)}}function qi(e,t){var n=[`+`,`#`,`.`,`/`,`;`,`?`,`&`];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,r,i){if(r){let e=``,i=[];if(n.indexOf(r.charAt(0))!==-1&&(e=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(n){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(n);i.push(Gi(t,e,r[1],r[2]||r[3]))}),e&&e!==`+`){var a=`,`;return e===`?`?a=`&`:e!==`#`&&(a=e),(i.length===0?``:e)+i.join(a)}else return i.join(`,`)}else return Bi(i)}),e===`/`?e:e.replace(/\/$/,``)}function Ji(e){let t=e.method.toUpperCase(),n=(e.url||`/`).replace(/:([a-z]\w+)/g,`{$1}`),r=Object.assign({},e.headers),i,a=zi(e,[`method`,`baseUrl`,`url`,`headers`,`request`,`mediaType`]),o=Ri(n);n=Ki(n).expand(a),/^http/.test(n)||(n=e.baseUrl+n);let s=zi(a,Object.keys(e).filter(e=>o.includes(e)).concat(`baseUrl`));return/application\/octet-stream/i.test(r.accept)||(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(`,`)),n.endsWith(`/graphql`)&&e.mediaType.previews?.length&&(r.accept=(r.accept.match(/(?`application/vnd.github.${t}-preview${e.mediaType.format?`.${e.mediaType.format}`:`+json`}`).join(`,`))),[`GET`,`HEAD`].includes(t)?n=Fi(n,s):`data`in s?i=s.data:Object.keys(s).length&&(i=s),!r[`content-type`]&&i!==void 0&&(r[`content-type`]=`application/json; charset=utf-8`),[`PATCH`,`PUT`].includes(t)&&i===void 0&&(i=``),Object.assign({method:t,url:n,headers:r},i===void 0?null:{body:i},e.request?{request:e.request}:null)}function Yi(e,t,n){return Ji(Pi(e,t,n))}function Xi(e,t){let n=Pi(e,t),r=Yi.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Xi.bind(null,n),merge:Pi.bind(null,n),parse:Ji})}var Zi=Xi(null,ki),Qi=U(((e,t)=>{let n=function(){};n.prototype=Object.create(null);let r=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,i=/\\([\v\u0020-\u00ff])/gu,a=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,o={type:``,parameters:new n};Object.freeze(o.parameters),Object.freeze(o);function s(e){if(typeof e!=`string`)throw TypeError(`argument header is required and must be a string`);let t=e.indexOf(`;`),o=t===-1?e.trim():e.slice(0,t).trim();if(a.test(o)===!1)throw TypeError(`invalid media type`);let s={type:o.toLowerCase(),parameters:new n};if(t===-1)return s;let c,l,u;for(r.lastIndex=t;l=r.exec(e);){if(l.index!==t)throw TypeError(`invalid parameter format`);t+=l[0].length,c=l[1].toLowerCase(),u=l[2],u[0]===`"`&&(u=u.slice(1,u.length-1),i.test(u)&&(u=u.replace(i,`$1`))),s.parameters[c]=u}if(t!==e.length)throw TypeError(`invalid parameter format`);return s}function c(e){if(typeof e!=`string`)return o;let t=e.indexOf(`;`),s=t===-1?e.trim():e.slice(0,t).trim();if(a.test(s)===!1)return o;let c={type:s.toLowerCase(),parameters:new n};if(t===-1)return c;let l,u,d;for(r.lastIndex=t;u=r.exec(e);){if(u.index!==t)return o;t+=u[0].length,l=u[1].toLowerCase(),d=u[2],d[0]===`"`&&(d=d.slice(1,d.length-1),i.test(d)&&(d=d.replace(i,`$1`))),c.parameters[l]=d}return t===e.length?c:o}t.exports.default={parse:s,safeParse:c},t.exports.parse=s,t.exports.safeParse=c,t.exports.defaultContentType=o}));const $i=/^-?\d+$/,ea=/^-?\d+n+$/,ta=JSON.stringify,na=JSON.parse,ra=/^-?\d+n$/,ia=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,aa=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,oa=(e,t,n)=>`rawJSON`in JSON?ta(e,(e,n)=>typeof n==`bigint`?JSON.rawJSON(n.toString()):typeof t==`function`?t(e,n):(Array.isArray(t)&&t.includes(e),n),n):e?ta(e,(e,n)=>typeof n==`string`&&n.match(ea)||typeof n==`bigint`?n.toString()+`n`:typeof t==`function`?t(e,n):(Array.isArray(t)&&t.includes(e),n),n).replace(ia,`$1$2$3`).replace(aa,`$1$2$3`):ta(e,t,n),sa=()=>JSON.parse(`1`,(e,t,n)=>!!n&&n.source===`1`),ca=(e,t,n,r)=>typeof t==`string`&&t.match(ra)?BigInt(t.slice(0,-1)):typeof t==`string`&&t.match(ea)?t.slice(0,-1):typeof r==`function`?r(e,t,n):t,la=(e,t)=>JSON.parse(e,(e,n,r)=>{let i=typeof n==`number`&&(n>2**53-1||n<-(2**53-1)),a=r&&$i.test(r.source);return i&&a?BigInt(r.source):typeof t==`function`?t(e,n,r):n}),ua=(2**53-1).toString(),da=ua.length,fa=/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g,pa=/^"-?\d+n+"$/,ma=(e,t)=>e?sa()?la(e,t):na(e.replace(fa,(e,t,n,r)=>{let i=e[0]===`"`;if(i&&e.match(pa))return e.substring(0,e.length-1)+`n"`;let a=n||r,o=t&&(t.lengthca(e,n,r,t)):na(e,t);var ha=class extends Error{name;status;request;response;constructor(e,t,n){super(e,{cause:n.cause}),this.name=`HttpError`,this.status=Number.parseInt(t),Number.isNaN(this.status)&&(this.status=0),`response`in n&&(this.response=n.response);let r=Object.assign({},n.request);n.request.headers.authorization&&(r.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?``;async function xa(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw Error(`fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing`);let n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=ya(e.body)||Array.isArray(e.body)?oa(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,String(t)])),o;try{o=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:`half`}})}catch(t){let n=`Unknown Error`;if(t instanceof Error){if(t.name===`AbortError`)throw t.status=500,t;n=t.message,t.name===`TypeError`&&`cause`in t&&(t.cause instanceof Error?n=t.cause.message:typeof t.cause==`string`&&(n=t.cause))}let r=new ha(n,500,{request:e});throw r.cause=t,r}let s=o.status,c=o.url,l={};for(let[e,t]of o.headers)l[e]=t;let u={url:c,status:s,headers:l,data:``};if(`deprecation`in l){let t=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),r=t&&t.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${r?`. See ${r}`:``}`)}if(s===204||s===205)return u;if(e.method===`HEAD`){if(s<400)return u;throw new ha(o.statusText,s,{response:u,request:e})}if(s===304)throw u.data=await Sa(o),new ha(`Not modified`,s,{response:u,request:e});if(s>=400)throw u.data=await Sa(o),new ha(wa(u.data),s,{response:u,request:e});return u.data=r?await Sa(o):o.body,u}async function Sa(e){let t=e.headers.get(`content-type`);if(!t)return e.text().catch(ba);let n=(0,ga.safeParse)(t);if(Ca(n)){let t=``;try{return t=await e.text(),ma(t)}catch{return t}}else if(n.type.startsWith(`text/`)||n.parameters.charset?.toLowerCase()===`utf-8`)return e.text().catch(ba);else return e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Ca(e){return e.type===`application/json`||e.type===`application/scim+json`}function wa(e){if(typeof e==`string`)return e;if(e instanceof ArrayBuffer)return`Unknown error`;if(`message`in e){let t=`documentation_url`in e?` - ${e.documentation_url}`:``;return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(e=>JSON.stringify(e)).join(`, `)}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function Ta(e,t){let n=e.defaults(t);return Object.assign(function(e,t){let r=n.merge(e,t);if(!r.request||!r.request.hook)return xa(n.parse(r));let i=(e,t)=>xa(n.parse(n.merge(e,t)));return Object.assign(i,{endpoint:n,defaults:Ta.bind(null,n)}),r.request.hook(i,r)},{endpoint:n,defaults:Ta.bind(null,n)})}var Ea=Ta(Zi,va),Da=`0.0.0-development`;function Oa(e){return`Request failed due to following response errors: `+e.errors.map(e=>` - ${e.message}`).join(` -`)}var ka=class extends Error{constructor(e,t,n){super(Oa(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name=`GraphqlResponseError`;errors;data},Aa=[`method`,`baseUrl`,`url`,`headers`,`request`,`query`,`mediaType`,`operationName`],ja=[`query`,`method`,`url`],Ma=/\/api\/v3\/?$/;function Na(e,t,n){if(n){if(typeof t==`string`&&`query`in n)return Promise.reject(Error(`[@octokit/graphql] "query" cannot be used as variable name`));for(let e in n)if(ja.includes(e))return Promise.reject(Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}let r=typeof t==`string`?Object.assign({query:t},n):t,i=Object.keys(r).reduce((e,t)=>Aa.includes(t)?(e[t]=r[t],e):(e.variables||={},e.variables[t]=r[t],e),{}),a=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Ma.test(a)&&(i.url=a.replace(Ma,`/api/graphql`)),e(i).then(e=>{if(e.data.errors){let t={};for(let n of Object.keys(e.headers))t[n]=e.headers[n];throw new ka(i,t,e.data)}return e.data.data})}function Pa(e,t){let n=e.defaults(t);return Object.assign((e,t)=>Na(n,e,t),{defaults:Pa.bind(null,n),endpoint:n.endpoint})}Pa(Ea,{headers:{"user-agent":`octokit-graphql.js/${Da} ${vi()}`},method:`POST`,url:`/graphql`});function Fa(e){return Pa(e,{method:`POST`,url:`/graphql`})}var Ia=`(?:[a-zA-Z0-9_-]+)`,La=`\\.`,Ra=RegExp(`^${Ia}${La}${Ia}${La}${Ia}$`),za=Ra.test.bind(Ra);async function Ba(e){let t=za(e),n=e.startsWith(`v1.`)||e.startsWith(`ghs_`),r=e.startsWith(`ghu_`);return{type:`token`,token:e,tokenType:t?`app`:n?`installation`:r?`user-to-server`:`oauth`}}function Va(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Ha(e,t,n,r){let i=t.endpoint.merge(n,r);return i.headers.authorization=Va(e),t(i)}var Ua=function(e){if(!e)throw Error(`[@octokit/auth-token] No token passed to createTokenAuth`);if(typeof e!=`string`)throw Error(`[@octokit/auth-token] Token passed to createTokenAuth is not a string`);return e=e.replace(/^(token|bearer) +/i,``),Object.assign(Ba.bind(null,e),{hook:Ha.bind(null,e)})};const Wa=`7.0.6`,Ga=()=>{},Ka=console.warn.bind(console),qa=console.error.bind(console);function Ja(e={}){return typeof e.debug!=`function`&&(e.debug=Ga),typeof e.info!=`function`&&(e.info=Ga),typeof e.warn!=`function`&&(e.warn=Ka),typeof e.error!=`function`&&(e.error=qa),e}const Ya=`octokit-core.js/${Wa} ${vi()}`;var Xa=class{static VERSION=Wa;static defaults(e){return class extends this{constructor(...t){let n=t[0]||{};if(typeof e==`function`){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let t=this.plugins;return class extends this{static plugins=t.concat(e.filter(e=>!t.includes(e)))}}constructor(e={}){let t=new Di.Collection,n={baseUrl:Ea.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,`request`)}),mediaType:{previews:[],format:``}};if(n.headers[`user-agent`]=e.userAgent?`${e.userAgent} ${Ya}`:Ya,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers[`time-zone`]=e.timeZone),this.request=Ea.defaults(n),this.graphql=Fa(this.request).defaults(n),this.log=Ja(e.log),this.hook=t,e.authStrategy){let{authStrategy:n,...r}=e,i=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},e.auth));t.wrap(`request`,i.hook),this.auth=i}else if(!e.auth)this.auth=async()=>({type:`unauthenticated`});else{let n=Ua(e.auth);t.wrap(`request`,n.hook),this.auth=n}let r=this.constructor;for(let t=0;t({async next(){if(!s)return{done:!0};try{let e=oo(await i({method:a,url:s,headers:o}));if(s=((e.headers.link||``).match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!s&&`total_commits`in e.data){let t=new URL(e.url),n=t.searchParams,r=parseInt(n.get(`page`)||`1`,10);r*parseInt(n.get(`per_page`)||`250`,10){if(i.done)return t;let a=!1;function o(){a=!0}return t=t.concat(r?r(i.value,o):i.value.data),a?t:lo(e,t,n,r)})}Object.assign(co,{iterator:so});function uo(e){return{paginate:Object.assign(co.bind(null,e),{iterator:so.bind(null,e)})}}uo.VERSION=ao,new li;const fo=_i(),po={baseUrl:fo,request:{agent:mi(fo),fetch:gi(fo)}},mo=Xa.plugin(ro,uo).defaults(po);function ho(e,t){let n=Object.assign({},t||{}),r=pi(e,n);return r&&(n.auth=r),n}const go=new li;function _o(e,t,...n){return new(mo.plugin(...n))(ho(e,t))}var vo=U(((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}})),yo=U(((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):()=>{}})),bo=U(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=vo(),a=yo();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]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(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)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),xo=U(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),So=U(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),Co=U(((e,t)=>{let n=yo(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=vo(),{safeRe:a,t:o}=bo(),s=xo(),{compareIdentifiers:c}=So();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[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`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}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)?1:0;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];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):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}}})),wo=U(((e,t)=>{let n=Co();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}}})),To=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Eo=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Do=U(((e,t)=>{let n=Co();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}}})),Oo=U(((e,t)=>{let n=wo();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`}})),ko=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).major})),Ao=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).minor})),jo=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).patch})),Mo=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),No=U(((e,t)=>{let n=Co();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Po=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(t,e,r)})),Fo=U(((e,t)=>{let n=No();t.exports=(e,t)=>n(e,t,!0)})),Io=U(((e,t)=>{let n=Co();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Lo=U(((e,t)=>{let n=Io();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ro=U(((e,t)=>{let n=Io();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),zo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)>0})),Bo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)<0})),Vo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)===0})),Ho=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)!==0})),Uo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)>=0})),Wo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)<=0})),Go=U(((e,t)=>{let n=Vo(),r=Ho(),i=zo(),a=Uo(),o=Bo(),s=Wo();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}`)}}})),Ko=U(((e,t)=>{let n=Co(),r=wo(),{safeRe:i,t:a}=bo();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];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),qo=U(((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}}})),Jo=U(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.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=>!h(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&&g(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){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,k(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>y(e,this.options)).join(` `).split(/\s+/).map(e=>O(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let v=new Map,b=g.map(e=>new a(e,this.options));for(let e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>v(e,n)&&t.set.some(t=>v(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}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`,g=e=>e.value===``,v=(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},y=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=C(e,t),o(`caret`,e),e=x(e,t),o(`tildes`,e),e=T(e,t),o(`xrange`,e),e=D(e,t),o(`stars`,e),e),b=e=>!e||e.toLowerCase()===`x`||e===`*`,x=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(` `),S=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return b(n)?s=``:b(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:b(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.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 b(n)?c=``:b(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(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}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},T=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>E(e,t)).join(` `)),E=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=b(i),u=l||b(a),d=u||b(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})},D=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),O=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),k=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=b(r)?``:b(i)?`>=${r}.0.0${e?`-0`:``}`:b(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=b(l)?``:b(u)?`<${+l+1}.0.0-0`:b(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),A=(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}})),Yo=U(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=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=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=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(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=xo(),{safeRe:i,t:a}=bo(),o=Go(),s=yo(),c=Co(),l=Jo()})),Xo=U(((e,t)=>{let n=Jo();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Zo=U(((e,t)=>{let n=Jo();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Qo=U(((e,t)=>{let n=Co(),r=Jo();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}})),$o=U(((e,t)=>{let n=Co(),r=Jo();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}})),es=U(((e,t)=>{let n=Co(),r=Jo(),i=zo();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}})),ts=U(((e,t)=>{let n=Jo();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),ns=U(((e,t)=>{let n=Co(),r=Yo(),{ANY:i}=r,a=Jo(),o=Xo(),s=zo(),c=Bo(),l=Wo(),u=Uo();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,v;switch(d){case`>`:p=s,m=l,h=c,g=`>`,v=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,v=`<=`;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:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===v||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===v&&h(e,s.semver))return!1}return!0}})),rs=U(((e,t)=>{let n=ns();t.exports=(e,t,r)=>n(e,t,`>`,r)})),is=U(((e,t)=>{let n=ns();t.exports=(e,t,r)=>n(e,t,`<`,r)})),as=U(((e,t)=>{let n=Jo();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),os=U(((e,t)=>{let n=Xo(),r=No();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=Jo(),r=Yo(),{ANY:i}=r,a=Xo(),o=No(),s=(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=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(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?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),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 m,h,g,v,y=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,b=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;y&&y.prerelease.length===1&&u.operator===`<`&&y.prerelease[0]===0&&(y=!1);for(let e of t){if(v=v||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){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(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&v&&!s&&p!==0||b||y)},d=(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},f=(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=s})),cs=U(((e,t)=>{let n=bo(),r=vo(),i=Co(),a=So();t.exports={parse:wo(),valid:To(),clean:Eo(),inc:Do(),diff:Oo(),major:ko(),minor:Ao(),patch:jo(),prerelease:Mo(),compare:No(),rcompare:Po(),compareLoose:Fo(),compareBuild:Io(),sort:Lo(),rsort:Ro(),gt:zo(),lt:Bo(),eq:Vo(),neq:Ho(),gte:Uo(),lte:Wo(),cmp:Go(),coerce:Ko(),Comparator:Yo(),Range:Jo(),satisfies:Xo(),toComparators:Zo(),maxSatisfying:Qo(),minSatisfying:$o(),minVersion:es(),validRange:ts(),outside:ns(),gtr:rs(),ltr:is(),intersects:as(),simplifyRange:os(),subset:ss(),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}}));function ls(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,G(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,G(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,G(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,G(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,G(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const us=process.platform===`win32`;function ds(e){if(e=gs(e),us&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=f.dirname(e);return us&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=gs(t)),t}function fs(e,t){if(b(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),b(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),ps(t))return t;if(us){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return b(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)}`}else if(hs(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return b(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return b(ps(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||us&&e.endsWith(`\\`)||(e+=f.sep),e+t}function ps(e){return b(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=hs(e),us?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function ms(e){return b(e,`isRooted parameter 'itemPath' must not be empty`),e=hs(e),us?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function hs(e){return e||=``,us?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function gs(e){return e?(e=hs(e),!e.endsWith(f.sep)||e===f.sep||us&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var _s;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(_s||={});const vs=process.platform===`win32`;function ys(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=vs?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=vs?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=ds(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=ds(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function bs(e,t){let n=_s.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function xs(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var Ss=U(((e,t)=>{t.exports=function(e,t){for(var r=[],i=0;i{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(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}})),ws=U(((e,t)=>{var n=Ss(),r=Cs();t.exports=p;var i=`\0SLASH`+Math.random()+`\0`,a=`\0OPEN`+Math.random()+`\0`,o=`\0CLOSE`+Math.random()+`\0`,s=`\0COMMA`+Math.random()+`\0`,c=`\0PERIOD`+Math.random()+`\0`;function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(`\\\\`).join(i).split(`\\{`).join(a).split(`\\}`).join(o).split(`\\,`).join(s).split(`\\.`).join(c)}function d(e){return e.split(i).join(`\\`).split(a).join(`{`).split(o).join(`}`).split(s).join(`,`).split(c).join(`.`)}function f(e){if(!e)return[``];var t=[],n=r(`{`,`}`,e);if(!n)return e.split(`,`);var i=n.pre,a=n.body,o=n.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=f(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function p(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),y(u(e),!0).map(d)):[]}function m(e){return`{`+e+`}`}function h(e){return/^-?0\d/.test(e)}function g(e,t){return e<=t}function v(e,t){return e>=t}function y(e,t){var i=[],a=r(`{`,`}`,e);if(!a||/\$$/.test(a.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),u=s||c,d=a.body.indexOf(`,`)>=0;if(!u&&!d)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+o+a.post,y(e)):[e];var p;if(u)p=a.body.split(/\.\./);else if(p=f(a.body),p.length===1&&(p=y(p[0],!1).map(m),p.length===1)){var b=a.post.length?y(a.post,!1):[``];return b.map(function(e){return a.pre+p[0]+e})}var x=a.pre,b=a.post.length?y(a.post,!1):[``],S;if(u){var C=l(p[0]),w=l(p[1]),T=Math.max(p[0].length,p[1].length),E=p.length==3?Math.abs(l(p[2])):1,D=g;w0){var M=Array(j+1).join(`0`);A=k<0?`-`+M+A.slice(1):M+A}}S.push(A)}}else S=n(p,function(e){return y(e,!1)});for(var N=0;N{t.exports=h,h.Minimatch=g;var n=function(){try{return W(`path`)}catch{}}()||{sep:`/`};h.sep=n.sep;var r=h.GLOBSTAR=g.GLOBSTAR={},i=ws(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=d(`().*{}+?[]^$\\!`);function d(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var f=/\/+/;h.filter=p;function p(e,t){return t||={},function(n,r,i){return h(n,e,t)}}function m(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}h.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return h;var t=h,n=function(n,r,i){return t(n,r,m(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,m(e,r))},n.Minimatch.defaults=function(n){return t.defaults(m(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,m(e,r))},n.defaults=function(n){return t.defaults(m(e,n))},n.makeRe=function(n,r){return t.makeRe(n,m(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,m(e,r))},n.match=function(n,r,i){return t.match(n,r,m(e,i))},n},g.defaults=function(e){return h.defaults(e).Minimatch};function h(e,t,n){return S(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new g(t,n).match(e)}function g(e,t){if(!(this instanceof g))return new g(e,t);S(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()}g.prototype.debug=function(){},g.prototype.make=v;function v(){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(f)}),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}g.prototype.parseNegate=y;function y(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;ix)throw TypeError(`pattern is too long`)};g.prototype.parse=w;var C={};function w(e,t){S(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=[],p,m=!1,h=-1,g=-1,v=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,y=this;function b(){if(p){switch(p){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+p;break}y.debug(`clearStateChar %j %j`,p,i),p=!1}}for(var x=0,w=e.length,T;x-1;N--){var P=f[N],F=i.slice(0,P.reStart),I=i.slice(P.reStart,P.reEnd-8),L=i.slice(P.reEnd-8,P.reEnd),R=i.slice(P.reEnd);L+=R;var z=F.split(`(`).length-1,ee=R;for(x=0;x=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 m=e.length-d.length;if(this._matchOne(e,d,n,m,0))p=d.length;else{if(e[e.length-1]!==``||i+d.length===e.length||(m--,!this._matchOne(e,d,n,m,0)))return!1;p=d.length+1}}if(!u.length){var h=!!p;for(o=i;o0,`Parameter 'itemPath' must not be an empty array`);for(let t=0;te.getLiteral(t)).filter(e=>!o&&!(o=e===``));this.searchPath=new Ds(s).toString(),this.rootRegExp=new RegExp(e.regExpEscape(s[0]),ks?`i`:``),this.isImplicitPattern=n;let c={dot:!0,nobrace:!0,nocase:ks,nocomment:!0,noext:!0,nonegate:!0};a=ks?a.replace(/\\/g,`/`):a,this.minimatch=new Os(a,c)}match(e){return this.segments[this.segments.length-1]===`**`?(e=hs(e),!e.endsWith(f.sep)&&this.isImplicitPattern===!1&&(e=`${e}${f.sep}`)):e=gs(e),this.minimatch.match(e)?this.trailingSeparator?_s.Directory:_s.All:_s.None}partialMatch(e){return e=gs(e),ds(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(ks?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(ks?e:e.replace(/\\/g,`\\\\`)).replace(/(\[)(?=[^/]+\])/g,`[[]`).replace(/\?/g,`[?]`).replace(/\*/g,`[*]`)}static fixupPattern(t,r){b(t,`pattern cannot be empty`);let i=new Ds(t).segments.map(t=>e.getLiteral(t));if(b(i.every((e,t)=>(e!==`.`||t===0)&&e!==`..`),`Invalid pattern '${t}'. Relative pathing '.' and '..' is not allowed.`),b(!ms(t)||i[0],`Invalid pattern '${t}'. Root segment must not contain globs.`),t=hs(t),t===`.`||t.startsWith(`.${f.sep}`))t=e.globEscape(process.cwd())+t.substr(1);else if(t===`~`||t.startsWith(`~${f.sep}`))r||=n.homedir(),b(r,`Unable to determine HOME directory`),b(ps(r),`Expected HOME directory to be a rooted path. Actual '${r}'`),t=e.globEscape(r)+t.substr(1);else if(ks&&(t.match(/^[A-Z]:$/i)||t.match(/^[A-Z]:[^\\]/i))){let n=fs(`C:\\dummy-root`,t.substr(0,2));t.length>2&&!n.endsWith(`\\`)&&(n+=`\\`),t=e.globEscape(n)+t.substr(2)}else if(ks&&(t===`\\`||t.match(/^\\[^\\]/))){let n=fs(`C:\\dummy-root`,`\\`);n.endsWith(`\\`)||(n+=`\\`),t=e.globEscape(n)+t.substr(1)}else t=fs(e.globEscape(process.cwd()),t);return hs(t)}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,`\\$&`)}},js=class{constructor(e,t){this.path=e,this.level=t}},Ms=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ns=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={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Ps=function(e){return this instanceof Ps?(this.v=e,this):new Ps(e)},Fs=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),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Ps?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};const Is=process.platform===`win32`;var Ls=class e{constructor(e){this.patterns=[],this.searchPaths=[],this.options=ls(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){return Ms(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Ns(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 Fs(this,arguments,function*(){let t=ls(this.options),n=[];for(let e of this.patterns)n.push(e),t.implicitDescendants&&(e.trailingSeparator||e.segments[e.segments.length-1]!==`**`)&&n.push(new As(e.negate,!0,e.segments.concat(`**`)));let r=[];for(let e of ys(n)){G(`Search path '${e}'`);try{yield Ps(o.promises.lstat(e))}catch(e){if(e.code===`ENOENT`)continue;throw e}r.unshift(new js(e,1))}let i=[];for(;r.length;){let a=r.pop(),s=bs(n,a.path),c=!!s||xs(n,a.path);if(!s&&!c)continue;let l=yield Ps(e.stat(a,t,i));if(l&&!(t.excludeHiddenFiles&&f.basename(a.path).match(/^\./)))if(l.isDirectory()){if(s&_s.Directory&&t.matchDirectories)yield yield Ps(a.path);else if(!c)continue;let e=a.level+1,n=(yield Ps(o.promises.readdir(a.path))).map(t=>new js(f.join(a.path,t),e));r.push(...n.reverse())}else s&_s.File&&(yield yield Ps(a.path))}})}static create(t,n){return Ms(this,void 0,void 0,function*(){let r=new e(n);Is&&(t=t.replace(/\r\n/g,` +`)}var ka=class extends Error{constructor(e,t,n){super(Oa(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name=`GraphqlResponseError`;errors;data},Aa=[`method`,`baseUrl`,`url`,`headers`,`request`,`query`,`mediaType`,`operationName`],ja=[`query`,`method`,`url`],Ma=/\/api\/v3\/?$/;function Na(e,t,n){if(n){if(typeof t==`string`&&`query`in n)return Promise.reject(Error(`[@octokit/graphql] "query" cannot be used as variable name`));for(let e in n)if(ja.includes(e))return Promise.reject(Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}let r=typeof t==`string`?Object.assign({query:t},n):t,i=Object.keys(r).reduce((e,t)=>Aa.includes(t)?(e[t]=r[t],e):(e.variables||={},e.variables[t]=r[t],e),{}),a=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Ma.test(a)&&(i.url=a.replace(Ma,`/api/graphql`)),e(i).then(e=>{if(e.data.errors){let t={};for(let n of Object.keys(e.headers))t[n]=e.headers[n];throw new ka(i,t,e.data)}return e.data.data})}function Pa(e,t){let n=e.defaults(t);return Object.assign((e,t)=>Na(n,e,t),{defaults:Pa.bind(null,n),endpoint:n.endpoint})}Pa(Ea,{headers:{"user-agent":`octokit-graphql.js/${Da} ${vi()}`},method:`POST`,url:`/graphql`});function Fa(e){return Pa(e,{method:`POST`,url:`/graphql`})}var Ia=`(?:[a-zA-Z0-9_-]+)`,La=`\\.`,Ra=RegExp(`^${Ia}${La}${Ia}${La}${Ia}$`),za=Ra.test.bind(Ra);async function Ba(e){let t=za(e),n=e.startsWith(`v1.`)||e.startsWith(`ghs_`),r=e.startsWith(`ghu_`);return{type:`token`,token:e,tokenType:t?`app`:n?`installation`:r?`user-to-server`:`oauth`}}function Va(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Ha(e,t,n,r){let i=t.endpoint.merge(n,r);return i.headers.authorization=Va(e),t(i)}var Ua=function(e){if(!e)throw Error(`[@octokit/auth-token] No token passed to createTokenAuth`);if(typeof e!=`string`)throw Error(`[@octokit/auth-token] Token passed to createTokenAuth is not a string`);return e=e.replace(/^(token|bearer) +/i,``),Object.assign(Ba.bind(null,e),{hook:Ha.bind(null,e)})};const Wa=`7.0.6`,Ga=()=>{},Ka=console.warn.bind(console),qa=console.error.bind(console);function Ja(e={}){return typeof e.debug!=`function`&&(e.debug=Ga),typeof e.info!=`function`&&(e.info=Ga),typeof e.warn!=`function`&&(e.warn=Ka),typeof e.error!=`function`&&(e.error=qa),e}const Ya=`octokit-core.js/${Wa} ${vi()}`;var Xa=class{static VERSION=Wa;static defaults(e){return class extends this{constructor(...t){let n=t[0]||{};if(typeof e==`function`){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let t=this.plugins;return class extends this{static plugins=t.concat(e.filter(e=>!t.includes(e)))}}constructor(e={}){let t=new Di.Collection,n={baseUrl:Ea.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,`request`)}),mediaType:{previews:[],format:``}};if(n.headers[`user-agent`]=e.userAgent?`${e.userAgent} ${Ya}`:Ya,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers[`time-zone`]=e.timeZone),this.request=Ea.defaults(n),this.graphql=Fa(this.request).defaults(n),this.log=Ja(e.log),this.hook=t,e.authStrategy){let{authStrategy:n,...r}=e,i=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},e.auth));t.wrap(`request`,i.hook),this.auth=i}else if(!e.auth)this.auth=async()=>({type:`unauthenticated`});else{let n=Ua(e.auth);t.wrap(`request`,n.hook),this.auth=n}let r=this.constructor;for(let t=0;t({async next(){if(!s)return{done:!0};try{let e=oo(await i({method:a,url:s,headers:o}));if(s=((e.headers.link||``).match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!s&&`total_commits`in e.data){let t=new URL(e.url),n=t.searchParams,r=parseInt(n.get(`page`)||`1`,10);r*parseInt(n.get(`per_page`)||`250`,10){if(i.done)return t;let a=!1;function o(){a=!0}return t=t.concat(r?r(i.value,o):i.value.data),a?t:lo(e,t,n,r)})}Object.assign(co,{iterator:so});function uo(e){return{paginate:Object.assign(co.bind(null,e),{iterator:so.bind(null,e)})}}uo.VERSION=ao,new li;const fo=_i(),po={baseUrl:fo,request:{agent:mi(fo),fetch:gi(fo)}},mo=Xa.plugin(ro,uo).defaults(po);function ho(e,t){let n=Object.assign({},t||{}),r=pi(e,n);return r&&(n.auth=r),n}const go=new li;function _o(e,t,...n){return new(mo.plugin(...n))(ho(e,t))}var vo=U(((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}})),yo=U(((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):()=>{}})),bo=U(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=vo(),a=yo();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]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(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)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),xo=U(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),So=U(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),Co=U(((e,t)=>{let n=yo(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=vo(),{safeRe:a,t:o}=bo(),s=xo(),{compareIdentifiers:c}=So();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[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`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}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)?1:0;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];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):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}}})),wo=U(((e,t)=>{let n=Co();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}}})),To=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Eo=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Do=U(((e,t)=>{let n=Co();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}}})),Oo=U(((e,t)=>{let n=wo();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`}})),ko=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).major})),Ao=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).minor})),jo=U(((e,t)=>{let n=Co();t.exports=(e,t)=>new n(e,t).patch})),Mo=U(((e,t)=>{let n=wo();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),No=U(((e,t)=>{let n=Co();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Po=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(t,e,r)})),Fo=U(((e,t)=>{let n=No();t.exports=(e,t)=>n(e,t,!0)})),Io=U(((e,t)=>{let n=Co();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Lo=U(((e,t)=>{let n=Io();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ro=U(((e,t)=>{let n=Io();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),zo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)>0})),Bo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)<0})),Vo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)===0})),Ho=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)!==0})),Uo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)>=0})),Wo=U(((e,t)=>{let n=No();t.exports=(e,t,r)=>n(e,t,r)<=0})),Go=U(((e,t)=>{let n=Vo(),r=Ho(),i=zo(),a=Uo(),o=Bo(),s=Wo();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}`)}}})),Ko=U(((e,t)=>{let n=Co(),r=wo(),{safeRe:i,t:a}=bo();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];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),qo=U(((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}}})),Jo=U(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.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=>!h(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&&g(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){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,k(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>y(e,this.options)).join(` `).split(/\s+/).map(e=>O(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let v=new Map,b=g.map(e=>new a(e,this.options));for(let e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>v(e,n)&&t.set.some(t=>v(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}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`,g=e=>e.value===``,v=(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},y=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=C(e,t),o(`caret`,e),e=x(e,t),o(`tildes`,e),e=T(e,t),o(`xrange`,e),e=D(e,t),o(`stars`,e),e),b=e=>!e||e.toLowerCase()===`x`||e===`*`,x=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(` `),S=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return b(n)?s=``:b(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:b(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.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 b(n)?c=``:b(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(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}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},T=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>E(e,t)).join(` `)),E=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=b(i),u=l||b(a),d=u||b(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})},D=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),O=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),k=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=b(r)?``:b(i)?`>=${r}.0.0${e?`-0`:``}`:b(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=b(l)?``:b(u)?`<${+l+1}.0.0-0`:b(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),A=(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}})),Yo=U(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=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=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=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(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=xo(),{safeRe:i,t:a}=bo(),o=Go(),s=yo(),c=Co(),l=Jo()})),Xo=U(((e,t)=>{let n=Jo();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Zo=U(((e,t)=>{let n=Jo();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Qo=U(((e,t)=>{let n=Co(),r=Jo();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}})),$o=U(((e,t)=>{let n=Co(),r=Jo();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}})),es=U(((e,t)=>{let n=Co(),r=Jo(),i=zo();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}})),ts=U(((e,t)=>{let n=Jo();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),ns=U(((e,t)=>{let n=Co(),r=Yo(),{ANY:i}=r,a=Jo(),o=Xo(),s=zo(),c=Bo(),l=Wo(),u=Uo();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,v;switch(d){case`>`:p=s,m=l,h=c,g=`>`,v=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,v=`<=`;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:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===v||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===v&&h(e,s.semver))return!1}return!0}})),rs=U(((e,t)=>{let n=ns();t.exports=(e,t,r)=>n(e,t,`>`,r)})),is=U(((e,t)=>{let n=ns();t.exports=(e,t,r)=>n(e,t,`<`,r)})),as=U(((e,t)=>{let n=Jo();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),os=U(((e,t)=>{let n=Xo(),r=No();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=Jo(),r=Yo(),{ANY:i}=r,a=Xo(),o=No(),s=(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=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(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?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),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 m,h,g,v,y=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,b=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;y&&y.prerelease.length===1&&u.operator===`<`&&y.prerelease[0]===0&&(y=!1);for(let e of t){if(v=v||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){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(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&v&&!s&&p!==0||b||y)},d=(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},f=(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=s})),cs=U(((e,t)=>{let n=bo(),r=vo(),i=Co(),a=So();t.exports={parse:wo(),valid:To(),clean:Eo(),inc:Do(),diff:Oo(),major:ko(),minor:Ao(),patch:jo(),prerelease:Mo(),compare:No(),rcompare:Po(),compareLoose:Fo(),compareBuild:Io(),sort:Lo(),rsort:Ro(),gt:zo(),lt:Bo(),eq:Vo(),neq:Ho(),gte:Uo(),lte:Wo(),cmp:Go(),coerce:Ko(),Comparator:Yo(),Range:Jo(),satisfies:Xo(),toComparators:Zo(),maxSatisfying:Qo(),minSatisfying:$o(),minVersion:es(),validRange:ts(),outside:ns(),gtr:rs(),ltr:is(),intersects:as(),simplifyRange:os(),subset:ss(),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}}));function ls(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0,excludeHiddenFiles:!1};return e&&(typeof e.followSymbolicLinks==`boolean`&&(t.followSymbolicLinks=e.followSymbolicLinks,G(`followSymbolicLinks '${t.followSymbolicLinks}'`)),typeof e.implicitDescendants==`boolean`&&(t.implicitDescendants=e.implicitDescendants,G(`implicitDescendants '${t.implicitDescendants}'`)),typeof e.matchDirectories==`boolean`&&(t.matchDirectories=e.matchDirectories,G(`matchDirectories '${t.matchDirectories}'`)),typeof e.omitBrokenSymbolicLinks==`boolean`&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,G(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`)),typeof e.excludeHiddenFiles==`boolean`&&(t.excludeHiddenFiles=e.excludeHiddenFiles,G(`excludeHiddenFiles '${t.excludeHiddenFiles}'`))),t}const us=process.platform===`win32`;function ds(e){if(e=gs(e),us&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=f.dirname(e);return us&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=gs(t)),t}function fs(e,t){if(b(e,`ensureAbsoluteRoot parameter 'root' must not be empty`),b(t,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`),ps(t))return t;if(us){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return b(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)}`}else if(hs(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return b(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return b(ps(e),`ensureAbsoluteRoot parameter 'root' must have an absolute root`),e.endsWith(`/`)||us&&e.endsWith(`\\`)||(e+=f.sep),e+t}function ps(e){return b(e,`hasAbsoluteRoot parameter 'itemPath' must not be empty`),e=hs(e),us?e.startsWith(`\\\\`)||/^[A-Z]:\\/i.test(e):e.startsWith(`/`)}function ms(e){return b(e,`isRooted parameter 'itemPath' must not be empty`),e=hs(e),us?e.startsWith(`\\`)||/^[A-Z]:/i.test(e):e.startsWith(`/`)}function hs(e){return e||=``,us?(e=e.replace(/\//g,`\\`),(/^\\\\+[^\\]/.test(e)?`\\`:``)+e.replace(/\\\\+/g,`\\`)):e.replace(/\/\/+/g,`/`)}function gs(e){return e?(e=hs(e),!e.endsWith(f.sep)||e===f.sep||us&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1)):``}var _s;(function(e){e[e.None=0]=`None`,e[e.Directory=1]=`Directory`,e[e.File=2]=`File`,e[e.All=3]=`All`})(_s||={});const vs=process.platform===`win32`;function ys(e){e=e.filter(e=>!e.negate);let t={};for(let n of e){let e=vs?n.searchPath.toUpperCase():n.searchPath;t[e]=`candidate`}let n=[];for(let r of e){let e=vs?r.searchPath.toUpperCase():r.searchPath;if(t[e]===`included`)continue;let i=!1,a=e,o=ds(a);for(;o!==a;){if(t[o]){i=!0;break}a=o,o=ds(a)}i||(n.push(r.searchPath),t[e]=`included`)}return n}function bs(e,t){let n=_s.None;for(let r of e)r.negate?n&=~r.match(t):n|=r.match(t);return n}function xs(e,t){return e.some(e=>!e.negate&&e.partialMatch(t))}var Ss=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.range=e.balanced=void 0,e.balanced=(n,r,i)=>{let a=n instanceof RegExp?t(n,i):n,o=r instanceof RegExp?t(r,i):r,s=a!==null&&o!=null&&(0,e.range)(a,o,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+a.length,s[1]),post:i.slice(s[1]+o.length)}};let t=(e,t)=>{let n=t.match(e);return n?n[0]:null};e.range=(e,t,n)=>{let 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;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s}})),Cs=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EXPANSION_MAX=void 0,e.expand=S;let t=Ss(),n=`\0SLASH`+Math.random()+`\0`,r=`\0OPEN`+Math.random()+`\0`,i=`\0CLOSE`+Math.random()+`\0`,a=`\0COMMA`+Math.random()+`\0`,o=`\0PERIOD`+Math.random()+`\0`,s=new RegExp(n,`g`),c=new RegExp(r,`g`),l=new RegExp(i,`g`),u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=/\\\\/g,p=/\\{/g,m=/\\}/g,h=/\\,/g,g=/\\\./g;e.EXPANSION_MAX=1e5;function v(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function y(e){return e.replace(f,n).replace(p,r).replace(m,i).replace(h,a).replace(g,o)}function b(e){return e.replace(s,`\\`).replace(c,`{`).replace(l,`}`).replace(u,`,`).replace(d,`.`)}function x(e){if(!e)return[``];let n=[],r=(0,t.balanced)(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=x(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),n.push.apply(n,s),n}function S(t,n={}){if(!t)return[];let{max:r=e.EXPANSION_MAX}=n;return t.slice(0,2)===`{}`&&(t=`\\{\\}`+t.slice(2)),D(y(t),r,!0).map(b)}function C(e){return`{`+e+`}`}function w(e){return/^-?0\d/.test(e)}function T(e,t){return e<=t}function E(e,t){return e>=t}function D(e,n,r){let a=[],o=(0,t.balanced)(`{`,`}`,e);if(!o)return[e];let s=o.pre,c=o.post.length?D(o.post,n,!1):[``];if(/\$$/.test(o.pre))for(let e=0;e=0;if(!u&&!d)return o.post.match(/,(?!,).*\}/)?(e=o.pre+`{`+o.body+i+o.post,D(e,n,!0)):[e];let f;if(u)f=o.body.split(/\.\./);else if(f=x(o.body),f.length===1&&f[0]!==void 0&&(f=D(f[0],n,!1).map(C),f.length===1))return c.map(e=>o.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=v(f[0]),t=v(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.max(Math.abs(v(f[2])),1):1,i=T;t0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e{t.exports=h,h.Minimatch=g;var n=function(){try{return W(`path`)}catch{}}()||{sep:`/`};h.sep=n.sep;var r=h.GLOBSTAR=g.GLOBSTAR={},i=Cs(),a={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},o=`[^/]`,s=o+`*?`,c=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,l=`(?:(?!(?:\\/|^)\\.).)*?`,u=d(`().*{}+?[]^$\\!`);function d(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var f=/\/+/;h.filter=p;function p(e,t){return t||={},function(n,r,i){return h(n,e,t)}}function m(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}h.defaults=function(e){if(!e||typeof e!=`object`||!Object.keys(e).length)return h;var t=h,n=function(n,r,i){return t(n,r,m(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,m(e,r))},n.Minimatch.defaults=function(n){return t.defaults(m(e,n)).Minimatch},n.filter=function(n,r){return t.filter(n,m(e,r))},n.defaults=function(n){return t.defaults(m(e,n))},n.makeRe=function(n,r){return t.makeRe(n,m(e,r))},n.braceExpand=function(n,r){return t.braceExpand(n,m(e,r))},n.match=function(n,r,i){return t.match(n,r,m(e,i))},n},g.defaults=function(e){return h.defaults(e).Minimatch};function h(e,t,n){return S(t),n||={},!n.nocomment&&t.charAt(0)===`#`?!1:new g(t,n).match(e)}function g(e,t){if(!(this instanceof g))return new g(e,t);S(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()}g.prototype.debug=function(){},g.prototype.make=v;function v(){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(f)}),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}g.prototype.parseNegate=y;function y(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;ix)throw TypeError(`pattern is too long`)};g.prototype.parse=w;var C={};function w(e,t){S(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=[],p,m=!1,h=-1,g=-1,v=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,y=this;function b(){if(p){switch(p){case`*`:i+=s,c=!0;break;case`?`:i+=o,c=!0;break;default:i+=`\\`+p;break}y.debug(`clearStateChar %j %j`,p,i),p=!1}}for(var x=0,w=e.length,T;x-1;N--){var P=f[N],F=i.slice(0,P.reStart),I=i.slice(P.reStart,P.reEnd-8),L=i.slice(P.reEnd-8,P.reEnd),R=i.slice(P.reEnd);L+=R;var z=F.split(`(`).length-1,ee=R;for(x=0;x=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 m=e.length-d.length;if(this._matchOne(e,d,n,m,0))p=d.length;else{if(e[e.length-1]!==``||i+d.length===e.length||(m--,!this._matchOne(e,d,n,m,0)))return!1;p=d.length+1}}if(!u.length){var h=!!p;for(o=i;o0,`Parameter 'itemPath' must not be an empty array`);for(let t=0;te.getLiteral(t)).filter(e=>!o&&!(o=e===``));this.searchPath=new Es(s).toString(),this.rootRegExp=new RegExp(e.regExpEscape(s[0]),Os?`i`:``),this.isImplicitPattern=n;let c={dot:!0,nobrace:!0,nocase:Os,nocomment:!0,noext:!0,nonegate:!0};a=Os?a.replace(/\\/g,`/`):a,this.minimatch=new Ds(a,c)}match(e){return this.segments[this.segments.length-1]===`**`?(e=hs(e),!e.endsWith(f.sep)&&this.isImplicitPattern===!1&&(e=`${e}${f.sep}`)):e=gs(e),this.minimatch.match(e)?this.trailingSeparator?_s.Directory:_s.All:_s.None}partialMatch(e){return e=gs(e),ds(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(Os?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(Os?e:e.replace(/\\/g,`\\\\`)).replace(/(\[)(?=[^/]+\])/g,`[[]`).replace(/\?/g,`[?]`).replace(/\*/g,`[*]`)}static fixupPattern(t,r){b(t,`pattern cannot be empty`);let i=new Es(t).segments.map(t=>e.getLiteral(t));if(b(i.every((e,t)=>(e!==`.`||t===0)&&e!==`..`),`Invalid pattern '${t}'. Relative pathing '.' and '..' is not allowed.`),b(!ms(t)||i[0],`Invalid pattern '${t}'. Root segment must not contain globs.`),t=hs(t),t===`.`||t.startsWith(`.${f.sep}`))t=e.globEscape(process.cwd())+t.substr(1);else if(t===`~`||t.startsWith(`~${f.sep}`))r||=n.homedir(),b(r,`Unable to determine HOME directory`),b(ps(r),`Expected HOME directory to be a rooted path. Actual '${r}'`),t=e.globEscape(r)+t.substr(1);else if(Os&&(t.match(/^[A-Z]:$/i)||t.match(/^[A-Z]:[^\\]/i))){let n=fs(`C:\\dummy-root`,t.substr(0,2));t.length>2&&!n.endsWith(`\\`)&&(n+=`\\`),t=e.globEscape(n)+t.substr(2)}else if(Os&&(t===`\\`||t.match(/^\\[^\\]/))){let n=fs(`C:\\dummy-root`,`\\`);n.endsWith(`\\`)||(n+=`\\`),t=e.globEscape(n)+t.substr(1)}else t=fs(e.globEscape(process.cwd()),t);return hs(t)}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,`\\$&`)}},As=class{constructor(e,t){this.path=e,this.level=t}},js=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ms=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={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Ns=function(e){return this instanceof Ns?(this.v=e,this):new Ns(e)},Ps=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),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Ns?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};const Fs=process.platform===`win32`;var Is=class e{constructor(e){this.patterns=[],this.searchPaths=[],this.options=ls(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){return js(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Ms(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 Ps(this,arguments,function*(){let t=ls(this.options),n=[];for(let e of this.patterns)n.push(e),t.implicitDescendants&&(e.trailingSeparator||e.segments[e.segments.length-1]!==`**`)&&n.push(new ks(e.negate,!0,e.segments.concat(`**`)));let r=[];for(let e of ys(n)){G(`Search path '${e}'`);try{yield Ns(o.promises.lstat(e))}catch(e){if(e.code===`ENOENT`)continue;throw e}r.unshift(new As(e,1))}let i=[];for(;r.length;){let a=r.pop(),s=bs(n,a.path),c=!!s||xs(n,a.path);if(!s&&!c)continue;let l=yield Ns(e.stat(a,t,i));if(l&&!(t.excludeHiddenFiles&&f.basename(a.path).match(/^\./)))if(l.isDirectory()){if(s&_s.Directory&&t.matchDirectories)yield yield Ns(a.path);else if(!c)continue;let e=a.level+1,n=(yield Ns(o.promises.readdir(a.path))).map(t=>new As(f.join(a.path,t),e));r.push(...n.reverse())}else s&_s.File&&(yield yield Ns(a.path))}})}static create(t,n){return js(this,void 0,void 0,function*(){let r=new e(n);Fs&&(t=t.replace(/\r\n/g,` `),t=t.replace(/\r/g,` `));let i=t.split(` -`).map(e=>e.trim());for(let e of i)if(!e||e.startsWith(`#`))continue;else r.patterns.push(new As(e));return r.searchPaths.push(...ys(r.patterns)),r})}static stat(e,t,n){return Ms(this,void 0,void 0,function*(){let r;if(t.followSymbolicLinks)try{r=yield o.promises.stat(e.path)}catch(n){if(n.code===`ENOENT`){if(t.omitBrokenSymbolicLinks){G(`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 o.promises.lstat(e.path);if(r.isDirectory()&&t.followSymbolicLinks){let t=yield o.promises.realpath(e.path);for(;n.length>=e.level;)n.pop();if(n.some(e=>e===t)){G(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return}n.push(t)}return r})}},Rs=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function zs(e,t){return Rs(this,void 0,void 0,function*(){return yield Ls.create(e,t)})}var Bs;(function(e){e.Gzip=`cache.tgz`,e.Zstd=`cache.tzst`})(Bs||={});var Vs;(function(e){e.Gzip=`gzip`,e.ZstdWithoutLong=`zstd-without-long`,e.Zstd=`zstd`})(Vs||={});var Hs;(function(e){e.GNU=`gnu`,e.BSD=`bsd`})(Hs||={});const Us=5e3,Ws=5e3,Gs=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,Ks=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,qs=`cache.tar`,Js=`manifest.txt`;var Ys=pe(cs(),1),Xs=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Zs=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={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}};function Qs(){return Xs(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=f.join(n,`actions`,`temp`)}let n=f.join(t,a.randomUUID());return yield sr(n),n})}function $s(e){return o.statSync(e).size}function ec(e){return Xs(this,void 0,void 0,function*(){var t,n,r,i;let a=[],o=process.env.GITHUB_WORKSPACE??process.cwd(),s=yield zs(e.join(` -`),{implicitDescendants:!1});try{for(var c=!0,l=Zs(s.globGenerator()),u;u=yield l.next(),t=u.done,!t;c=!0){i=u.value,c=!1;let e=i,t=f.relative(o,e).replace(RegExp(`\\${f.sep}`,`g`),`/`);G(`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 tc(e){return Xs(this,void 0,void 0,function*(){return S.promisify(o.unlink)(e)})}function nc(e){return Xs(this,arguments,void 0,function*(e,t=[]){let n=``;t.push(`--version`),G(`Checking ${e} ${t.join(` `)}`);try{yield yr(`${e}`,t,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=e.toString(),stderr:e=>n+=e.toString()}})}catch(e){G(e.message)}return n=n.trim(),G(n),n})}function rc(){return Xs(this,void 0,void 0,function*(){let e=yield nc(`zstd`,[`--quiet`]);return G(`zstd version: ${Ys.clean(e)}`),e===``?Vs.Gzip:Vs.ZstdWithoutLong})}function ic(e){return e===Vs.Gzip?Bs.Gzip:Bs.Zstd}function ac(){return Xs(this,void 0,void 0,function*(){return o.existsSync(Gs)?Gs:(yield nc(`tar`)).toLowerCase().includes(`gnu tar`)?cr(`tar`):``})}function oc(e,t){if(t===void 0)throw Error(`Expected ${e} but value was undefiend`);return t}function sc(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`),a.createHash(`sha256`).update(r.join(`|`)).digest(`hex`)}function cc(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}var lc=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function uc(e,...n){t.stderr.write(`${D.format(e,...n)}${R}`)}const dc=typeof process<`u`&&process.env&&process.env.DEBUG||void 0;let fc,pc=[],mc=[];const hc=[];dc&&_c(dc);const gc=Object.assign(e=>xc(e),{enable:_c,enabled:vc,disable:bc,log:uc});function _c(e){fc=e,pc=[],mc=[];let t=e.split(`,`).map(e=>e.trim());for(let e of t)e.startsWith(`-`)?mc.push(e.substring(1)):pc.push(e);for(let e of hc)e.enabled=vc(e.namespace)}function vc(e){if(e.endsWith(`*`))return!0;for(let t of mc)if(yc(e,t))return!1;for(let t of pc)if(yc(e,t))return!0;return!1}function yc(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 bc(){let e=fc||``;return _c(``),e}function xc(e){let t=Object.assign(n,{enabled:vc(e),destroy:Sc,log:gc.log,namespace:e,extend:Cc});function n(...n){t.enabled&&(n.length>0&&(n[0]=`${e} ${n[0]}`),t.log(...n))}return hc.push(t),t}function Sc(){let e=hc.indexOf(this);return e>=0?(hc.splice(e,1),!0):!1}function Cc(e){let t=xc(`${this.namespace}:${e}`);return t.log=this.log,t}const wc=[`verbose`,`info`,`warning`,`error`],Tc={verbose:400,info:300,warning:200,error:100};function Ec(e,t){t.log=(...t)=>{e.log(...t)}}function Dc(e){return wc.includes(e)}function Oc(e){let t=new Set,n=typeof process<`u`&&process.env&&process.env[e.logLevelEnvVarName]||void 0,r,i=gc(e.namespace);i.log=(...e)=>{gc.log(...e)};function a(e){if(e&&!Dc(e))throw Error(`Unknown log level '${e}'. Acceptable values: ${wc.join(`,`)}`);r=e;let n=[];for(let e of t)o(e)&&n.push(e.namespace);gc.enable(n.join(`,`))}n&&(Dc(n)?a(n):console.error(`${e.logLevelEnvVarName} set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${wc.join(`, `)}.`));function o(e){return!!(r&&Tc[e.level]<=Tc[r])}function s(e,n){let r=Object.assign(e.extend(n),{level:n});if(Ec(e,r),o(r)){let e=gc.disable();gc.enable(e+`,`+r.namespace)}return t.add(r),r}function c(){return r}function l(e){let t=i.extend(e);return Ec(i,t),{error:s(t,`error`),warning:s(t,`warning`),info:s(t,`info`),verbose:s(t,`verbose`)}}return{setLogLevel:a,getLogLevel:c,createClientLogger:l,logger:i}}const kc=Oc({logLevelEnvVarName:`TYPESPEC_RUNTIME_LOG_LEVEL`,namespace:`typeSpecRuntime`});kc.logger;function Ac(e){return kc.createClientLogger(e)}function jc(e){return e.toLowerCase()}function*Mc(e){for(let t of e.values())yield[t.name,t.value]}var Nc=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(jc(e),{name:e,value:String(t).trim()})}get(e){return this._headersMap.get(jc(e))?.value}has(e){return this._headersMap.has(jc(e))}delete(e){this._headersMap.delete(jc(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 Mc(this._headersMap)}};function Pc(e){return new Nc(e)}function Fc(){return crypto.randomUUID()}var Ic=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??Pc(),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||Fc(),this.allowInsecureConnection=e.allowInsecureConnection??!1,this.enableBrowserStreams=e.enableBrowserStreams??!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function Lc(e){return new Ic(e)}const Rc=new Set([`Deserialize`,`Serialize`,`Retry`,`Sign`]);var zc=class e{_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&&!Rc.has(t.phase))throw Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!Rc.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 e(this._policies)}static create(){return new e}orderPolicies(){let e=[],t=new Map;function n(e){return{name:e,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}let r=n(`Serialize`),i=n(`None`),a=n(`Deserialize`),o=n(`Retry`),s=n(`Sign`),c=[r,i,a,o,s];function l(e){return e===`Retry`?o:e===`Serialize`?r:e===`Deserialize`?a:e===`Sign`?s:i}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=l(r.afterPhase),a.afterPhase.hasAfterPolicies=!0),t.set(i,a),l(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 u(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 d(){for(let e of c){if(u(e),e.policies.size>0&&e!==i){i.hasRun||u(i);return}e.hasAfterPolicies&&u(i)}}let f=0;for(;t.size>0;){f++;let t=e.length;if(d(),e.length<=t&&f>1)throw Error(`Cannot satisfy policy dependencies due to requirements cycle.`)}return e}};function Bc(){return zc.create()}function Vc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Hc(e){if(Vc(e)){let t=typeof e.name==`string`,n=typeof e.message==`string`;return t&&n}return!1}const Uc=O.custom,Wc=`REDACTED`,Gc=`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(`.`),Kc=[`api-version`];var qc=class{allowedHeaderNames;allowedQueryParameters;constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=Gc.concat(e),t=Kc.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`)return this.sanitizeHeaders(n);if(e===`url`)return this.sanitizeUrl(n);if(e===`query`)return this.sanitizeQuery(n);if(e!==`body`&&e!==`response`&&e!==`operationSpec`){if(Array.isArray(n)||Vc(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,Wc);return t.toString()}sanitizeHeaders(e){let t={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?t[n]=e[n]:t[n]=Wc;return t}sanitizeQuery(e){if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?t[n]=e[n]:t[n]=Wc;return t}};const Jc=new qc;var Yc=class e extends Error{static REQUEST_SEND_ERROR=`REQUEST_SEND_ERROR`;static PARSE_ERROR=`PARSE_ERROR`;code;statusCode;request;response;details;constructor(t,n={}){super(t),this.name=`RestError`,this.code=n.code,this.statusCode=n.statusCode,Object.defineProperty(this,`request`,{value:n.request,enumerable:!1}),Object.defineProperty(this,`response`,{value:n.response,enumerable:!1});let r=this.request?.agent?{maxFreeSockets:this.request.agent.maxFreeSockets,maxSockets:this.request.agent.maxSockets}:void 0;Object.defineProperty(this,Uc,{value:()=>`RestError: ${this.message} \n ${Jc.sanitize({...this,request:{...this.request,agent:r},response:this.response})}`,enumerable:!1}),Object.setPrototypeOf(this,e.prototype)}};function Xc(e){return e instanceof Yc?!0:Hc(e)&&e.name===`RestError`}function Zc(e,t){return Buffer.from(e,t)}const Qc=Ac(`ts-http-runtime`),$c={};function el(e){return e&&typeof e.pipe==`function`}function tl(e){return e.readable===!1?Promise.resolve():new Promise(t=>{let n=()=>{t(),e.removeListener(`close`,n),e.removeListener(`end`,n),e.removeListener(`error`,n)};e.on(`close`,n),e.on(`end`,n),e.on(`error`,n)})}function nl(e){return e&&typeof e.byteLength==`number`}var rl=class extends T{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}},il=class{cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let t=new AbortController,n;if(e.abortSignal){if(e.abortSignal.aborted)throw new lc(`The operation was aborted. Request has already been canceled.`);n=e=>{e.type===`abort`&&t.abort()},e.abortSignal.addEventListener(`abort`,n)}let r;e.timeout>0&&(r=setTimeout(()=>{let n=new qc;Qc.info(`request to '${n.sanitizeUrl(e.url)}' timed out. canceling...`),t.abort()},e.timeout));let i=e.headers.get(`Accept-Encoding`),a=i?.includes(`gzip`)||i?.includes(`deflate`),o=typeof e.body==`function`?e.body():e.body;if(o&&!e.headers.has(`Content-Length`)){let t=cl(o);t!==null&&e.headers.set(`Content-Length`,t)}let s;try{if(o&&e.onUploadProgress){let t=e.onUploadProgress,n=new rl(t);n.on(`error`,e=>{Qc.error(`Error in upload progress`,e)}),el(o)?o.pipe(n):n.end(o),o=n}let n=await this.makeRequest(e,t,o);r!==void 0&&clearTimeout(r);let i=al(n),c={status:n.statusCode??0,headers:i,request:e};if(e.method===`HEAD`)return n.resume(),c;s=a?ol(n,i):n;let l=e.onDownloadProgress;if(l){let e=new rl(l);e.on(`error`,e=>{Qc.error(`Error in download progress`,e)}),s.pipe(e),s=e}return e.streamResponseStatusCodes?.has(1/0)||e.streamResponseStatusCodes?.has(c.status)?c.readableStreamBody=s:c.bodyAsText=await sl(s),c}finally{if(e.abortSignal&&n){let t=Promise.resolve();el(o)&&(t=tl(o));let r=Promise.resolve();el(s)&&(r=tl(s)),Promise.all([t,r]).then(()=>{n&&e.abortSignal?.removeEventListener(`abort`,n)}).catch(e=>{Qc.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?C.request(a,r):te.request(a,r);s.once(`error`,t=>{o(new Yc(t.message,{code:t.code??Yc.REQUEST_SEND_ERROR,request:e}))}),t.signal.addEventListener(`abort`,()=>{let e=new lc(`The operation was aborted. Rejecting from abort signal callback while making request.`);s.destroy(e),o(e)}),n&&el(n)?n.pipe(s):n?typeof n==`string`||Buffer.isBuffer(n)?s.end(n):nl(n)?s.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Qc.error(`Unrecognized body type`,n),o(new Yc(`Unrecognized body type`))):s.end()})}getOrCreateAgent(e,t){let n=e.disableKeepAlive;if(t)return n?C.globalAgent:(this.cachedHttpAgent||=new C.Agent({keepAlive:!0}),this.cachedHttpAgent);{if(n&&!e.tlsSettings)return te.globalAgent;let t=e.tlsSettings??$c,r=this.cachedHttpsAgents.get(t);return r&&r.options.keepAlive===!n?r:(Qc.info(`No cached TLS Agent exist, creating a new Agent`),r=new te.Agent({keepAlive:!n,...t}),this.cachedHttpsAgents.set(t,r),r)}}};function al(e){let t=Pc();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 ol(e,t){let n=t.get(`Content-Encoding`);if(n===`gzip`){let t=k.createGunzip();return e.pipe(t),t}else if(n===`deflate`){let t=k.createInflate();return e.pipe(t),t}return e}function sl(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 Yc(`Error reading response as text: ${e.message}`,{code:Yc.PARSE_ERROR}))})})}function cl(e){return e?Buffer.isBuffer(e)?e.length:el(e)?null:nl(e)?e.byteLength:typeof e==`string`?Buffer.from(e).length:null:0}function ll(){return new il}function ul(){return ll()}function dl(e={}){let t=e.logger??Qc.info,n=new qc({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(i.headers)}`),i}}}const fl=[`GET`,`HEAD`];function pl(e={}){let{maxRetries:t=20,allowCrossOriginRedirects:n=!1}=e;return{name:`redirectPolicy`,async sendRequest(e,r){return ml(r,await r(e),t,n)}}}async function ml(e,t,n,r,i=0){let{request:a,status:o,headers:s}=t,c=s.get(`location`);if(c&&(o===300||o===301&&fl.includes(a.method)||o===302&&fl.includes(a.method)||o===303&&a.method===`POST`||o===307)&&i{let a,o,s=()=>i(new lc(n?.abortErrorMsg?n?.abortErrorMsg:`The operation was aborted.`)),c=()=>{n?.abortSignal&&o&&n.abortSignal.removeEventListener(`abort`,o)};if(o=()=>(a&&clearTimeout(a),c(),s()),n?.abortSignal&&n.abortSignal.aborted)return s();a=setTimeout(()=>{c(),r(t)},e),n?.abortSignal&&n.abortSignal.addEventListener(`abort`,o)})}function yl(e,t){let n=e.headers.get(t);if(!n)return;let r=Number(n);if(!Number.isNaN(r))return r}const bl=`Retry-After`,xl=[`retry-after-ms`,`x-ms-retry-after-ms`,bl];function Sl(e){if(e&&[429,503].includes(e.status))try{for(let t of xl){let n=yl(e,t);if(n===0||n)return n*(t===bl?1e3:1)}let t=e.headers.get(bl);if(!t)return;let n=Date.parse(t)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}function Cl(e){return Number.isFinite(Sl(e))}function wl(){return{name:`throttlingRetryStrategy`,retry({response:e}){let t=Sl(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}}}function Tl(e={}){let t=e.retryDelayInMs??1e3,n=e.maxRetryDelayInMs??64e3;return{name:`exponentialRetryStrategy`,retry({retryCount:r,response:i,responseError:a}){let o=Dl(a),s=o&&e.ignoreSystemErrors,c=El(i),l=c&&e.ignoreHttpStatusCodes;return i&&(Cl(i)||!c)||l||s?{skipStrategy:!0}:a&&!o&&!c?{errorToThrow:a}:_l(r,{retryDelayInMs:t,maxRetryDelayInMs:n})}}}function El(e){return!!(e&&e.status!==void 0&&(e.status>=500||e.status===408)&&e.status!==501&&e.status!==505)}function Dl(e){return e?e.code===`ETIMEDOUT`||e.code===`ESOCKETTIMEDOUT`||e.code===`ECONNREFUSED`||e.code===`ECONNRESET`||e.code===`ENOENT`||e.code===`ENOTFOUND`:!1}const Ol=Ac(`ts-http-runtime retryPolicy`);function kl(e,t={maxRetries:3}){let n=t.logger||Ol;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),o=e,!e||o.name!==`RestError`)throw e;a=o.response}if(r.abortSignal?.aborted)throw n.error(`Retry ${s}: Request aborted.`),new lc;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 vl(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 Al(e={}){return{name:`defaultRetryPolicy`,sendRequest:kl([wl(),Tl(e)],{maxRetries:e.maxRetries??3}).sendRequest}}typeof window<`u`&&window.document,typeof self==`object`&&typeof self?.importScripts==`function`&&(self.constructor?.name===`DedicatedWorkerGlobalScope`||self.constructor?.name===`ServiceWorkerGlobalScope`||self.constructor?.name),typeof Deno<`u`&&Deno.version!==void 0&&Deno.version.deno,typeof Bun<`u`&&Bun.version;const jl=globalThis.process!==void 0&&!!globalThis.process.version&&!!globalThis.process.versions?.node;typeof navigator<`u`&&navigator?.product;function Ml(e){let t={};for(let[n,r]of e.entries())t[n]??=[],t[n].push(r);return t}function Nl(){return{name:`formDataPolicy`,async sendRequest(e,t){if(jl&&typeof FormData<`u`&&e.body instanceof FormData&&(e.formData=Ml(e.body),e.body=void 0),e.formData){let t=e.headers.get(`Content-Type`);t&&t.indexOf(`application/x-www-form-urlencoded`)!==-1?e.body=Pl(e.formData):await Fl(e.formData,e),e.formData=void 0}return t(e)}}}function Pl(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 Fl(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:Pc({"Content-Disposition":`form-data; name="${t}"`}),body:Zc(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=Pc();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}}var Il=U(((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 c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(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 l(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 u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Ll=U(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Il(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){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 n.enable(n.load()),n}t.exports=n})),Rl=U(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),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 n(){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 r(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 i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){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 o(){try{return localStorage}catch{}}t.exports=Ll()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),zl=U(((e,t)=>{t.exports=(e,t)=>{t||=process.argv;let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1?!0:r{let n=W(`os`),r=zl(),i=process.env,a;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;let t=a?1:0;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(e=>e in i)||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in i){let e=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function c(e){return o(s(e))}t.exports={supportsColor:c,stdout:c(process.stdout),stderr:c(process.stderr)}})),Vl=U(((e,t)=>{let n=W(`tty`),r=W(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,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=Bl();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 i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(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 i)if(!e||e.startsWith(`#`))continue;else r.patterns.push(new ks(e));return r.searchPaths.push(...ys(r.patterns)),r})}static stat(e,t,n){return js(this,void 0,void 0,function*(){let r;if(t.followSymbolicLinks)try{r=yield o.promises.stat(e.path)}catch(n){if(n.code===`ENOENT`){if(t.omitBrokenSymbolicLinks){G(`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 o.promises.lstat(e.path);if(r.isDirectory()&&t.followSymbolicLinks){let t=yield o.promises.realpath(e.path);for(;n.length>=e.level;)n.pop();if(n.some(e=>e===t)){G(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return}n.push(t)}return r})}},Ls=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Rs(e,t){return Ls(this,void 0,void 0,function*(){return yield Is.create(e,t)})}var zs;(function(e){e.Gzip=`cache.tgz`,e.Zstd=`cache.tzst`})(zs||={});var Bs;(function(e){e.Gzip=`gzip`,e.ZstdWithoutLong=`zstd-without-long`,e.Zstd=`zstd`})(Bs||={});var Vs;(function(e){e.GNU=`gnu`,e.BSD=`bsd`})(Vs||={});const Hs=5e3,Us=5e3,Ws=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,Gs=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,Ks=`cache.tar`,qs=`manifest.txt`;var Js=pe(cs(),1),Ys=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Xs=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={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}};function Zs(){return Ys(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=f.join(n,`actions`,`temp`)}let n=f.join(t,a.randomUUID());return yield sr(n),n})}function Qs(e){return o.statSync(e).size}function $s(e){return Ys(this,void 0,void 0,function*(){var t,n,r,i;let a=[],o=process.env.GITHUB_WORKSPACE??process.cwd(),s=yield Rs(e.join(` +`),{implicitDescendants:!1});try{for(var c=!0,l=Xs(s.globGenerator()),u;u=yield l.next(),t=u.done,!t;c=!0){i=u.value,c=!1;let e=i,t=f.relative(o,e).replace(RegExp(`\\${f.sep}`,`g`),`/`);G(`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 ec(e){return Ys(this,void 0,void 0,function*(){return S.promisify(o.unlink)(e)})}function tc(e){return Ys(this,arguments,void 0,function*(e,t=[]){let n=``;t.push(`--version`),G(`Checking ${e} ${t.join(` `)}`);try{yield yr(`${e}`,t,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>n+=e.toString(),stderr:e=>n+=e.toString()}})}catch(e){G(e.message)}return n=n.trim(),G(n),n})}function nc(){return Ys(this,void 0,void 0,function*(){let e=yield tc(`zstd`,[`--quiet`]);return G(`zstd version: ${Js.clean(e)}`),e===``?Bs.Gzip:Bs.ZstdWithoutLong})}function rc(e){return e===Bs.Gzip?zs.Gzip:zs.Zstd}function ic(){return Ys(this,void 0,void 0,function*(){return o.existsSync(Ws)?Ws:(yield tc(`tar`)).toLowerCase().includes(`gnu tar`)?cr(`tar`):``})}function ac(e,t){if(t===void 0)throw Error(`Expected ${e} but value was undefiend`);return t}function oc(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`),a.createHash(`sha256`).update(r.join(`|`)).digest(`hex`)}function sc(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}var cc=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function lc(e,...n){t.stderr.write(`${D.format(e,...n)}${R}`)}const uc=typeof process<`u`&&process.env&&process.env.DEBUG||void 0;let dc,fc=[],pc=[];const mc=[];uc&&gc(uc);const hc=Object.assign(e=>bc(e),{enable:gc,enabled:_c,disable:yc,log:lc});function gc(e){dc=e,fc=[],pc=[];let t=e.split(`,`).map(e=>e.trim());for(let e of t)e.startsWith(`-`)?pc.push(e.substring(1)):fc.push(e);for(let e of mc)e.enabled=_c(e.namespace)}function _c(e){if(e.endsWith(`*`))return!0;for(let t of pc)if(vc(e,t))return!1;for(let t of fc)if(vc(e,t))return!0;return!1}function vc(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 yc(){let e=dc||``;return gc(``),e}function bc(e){let t=Object.assign(n,{enabled:_c(e),destroy:xc,log:hc.log,namespace:e,extend:Sc});function n(...n){t.enabled&&(n.length>0&&(n[0]=`${e} ${n[0]}`),t.log(...n))}return mc.push(t),t}function xc(){let e=mc.indexOf(this);return e>=0?(mc.splice(e,1),!0):!1}function Sc(e){let t=bc(`${this.namespace}:${e}`);return t.log=this.log,t}const Cc=[`verbose`,`info`,`warning`,`error`],wc={verbose:400,info:300,warning:200,error:100};function Tc(e,t){t.log=(...t)=>{e.log(...t)}}function Ec(e){return Cc.includes(e)}function Dc(e){let t=new Set,n=typeof process<`u`&&process.env&&process.env[e.logLevelEnvVarName]||void 0,r,i=hc(e.namespace);i.log=(...e)=>{hc.log(...e)};function a(e){if(e&&!Ec(e))throw Error(`Unknown log level '${e}'. Acceptable values: ${Cc.join(`,`)}`);r=e;let n=[];for(let e of t)o(e)&&n.push(e.namespace);hc.enable(n.join(`,`))}n&&(Ec(n)?a(n):console.error(`${e.logLevelEnvVarName} set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${Cc.join(`, `)}.`));function o(e){return!!(r&&wc[e.level]<=wc[r])}function s(e,n){let r=Object.assign(e.extend(n),{level:n});if(Tc(e,r),o(r)){let e=hc.disable();hc.enable(e+`,`+r.namespace)}return t.add(r),r}function c(){return r}function l(e){let t=i.extend(e);return Tc(i,t),{error:s(t,`error`),warning:s(t,`warning`),info:s(t,`info`),verbose:s(t,`verbose`)}}return{setLogLevel:a,getLogLevel:c,createClientLogger:l,logger:i}}const Oc=Dc({logLevelEnvVarName:`TYPESPEC_RUNTIME_LOG_LEVEL`,namespace:`typeSpecRuntime`});Oc.logger;function kc(e){return Oc.createClientLogger(e)}function Ac(e){return e.toLowerCase()}function*jc(e){for(let t of e.values())yield[t.name,t.value]}var Mc=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(Ac(e),{name:e,value:String(t).trim()})}get(e){return this._headersMap.get(Ac(e))?.value}has(e){return this._headersMap.has(Ac(e))}delete(e){this._headersMap.delete(Ac(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 jc(this._headersMap)}};function Nc(e){return new Mc(e)}function Pc(){return crypto.randomUUID()}var Fc=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??Nc(),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||Pc(),this.allowInsecureConnection=e.allowInsecureConnection??!1,this.enableBrowserStreams=e.enableBrowserStreams??!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function Ic(e){return new Fc(e)}const Lc=new Set([`Deserialize`,`Serialize`,`Retry`,`Sign`]);var Rc=class e{_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&&!Lc.has(t.phase))throw Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!Lc.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 e(this._policies)}static create(){return new e}orderPolicies(){let e=[],t=new Map;function n(e){return{name:e,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}let r=n(`Serialize`),i=n(`None`),a=n(`Deserialize`),o=n(`Retry`),s=n(`Sign`),c=[r,i,a,o,s];function l(e){return e===`Retry`?o:e===`Serialize`?r:e===`Deserialize`?a:e===`Sign`?s:i}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=l(r.afterPhase),a.afterPhase.hasAfterPolicies=!0),t.set(i,a),l(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 u(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 d(){for(let e of c){if(u(e),e.policies.size>0&&e!==i){i.hasRun||u(i);return}e.hasAfterPolicies&&u(i)}}let f=0;for(;t.size>0;){f++;let t=e.length;if(d(),e.length<=t&&f>1)throw Error(`Cannot satisfy policy dependencies due to requirements cycle.`)}return e}};function zc(){return Rc.create()}function Bc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Vc(e){if(Bc(e)){let t=typeof e.name==`string`,n=typeof e.message==`string`;return t&&n}return!1}const Hc=O.custom,Uc=`REDACTED`,Wc=`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(`.`),Gc=[`api-version`];var Kc=class{allowedHeaderNames;allowedQueryParameters;constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=Wc.concat(e),t=Gc.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`)return this.sanitizeHeaders(n);if(e===`url`)return this.sanitizeUrl(n);if(e===`query`)return this.sanitizeQuery(n);if(e!==`body`&&e!==`response`&&e!==`operationSpec`){if(Array.isArray(n)||Bc(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,Uc);return t.toString()}sanitizeHeaders(e){let t={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?t[n]=e[n]:t[n]=Uc;return t}sanitizeQuery(e){if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?t[n]=e[n]:t[n]=Uc;return t}};const qc=new Kc;var Jc=class e extends Error{static REQUEST_SEND_ERROR=`REQUEST_SEND_ERROR`;static PARSE_ERROR=`PARSE_ERROR`;code;statusCode;request;response;details;constructor(t,n={}){super(t),this.name=`RestError`,this.code=n.code,this.statusCode=n.statusCode,Object.defineProperty(this,`request`,{value:n.request,enumerable:!1}),Object.defineProperty(this,`response`,{value:n.response,enumerable:!1});let r=this.request?.agent?{maxFreeSockets:this.request.agent.maxFreeSockets,maxSockets:this.request.agent.maxSockets}:void 0;Object.defineProperty(this,Hc,{value:()=>`RestError: ${this.message} \n ${qc.sanitize({...this,request:{...this.request,agent:r},response:this.response})}`,enumerable:!1}),Object.setPrototypeOf(this,e.prototype)}};function Yc(e){return e instanceof Jc?!0:Vc(e)&&e.name===`RestError`}function Xc(e,t){return Buffer.from(e,t)}const Zc=kc(`ts-http-runtime`),Qc={};function $c(e){return e&&typeof e.pipe==`function`}function el(e){return e.readable===!1?Promise.resolve():new Promise(t=>{let n=()=>{t(),e.removeListener(`close`,n),e.removeListener(`end`,n),e.removeListener(`error`,n)};e.on(`close`,n),e.on(`end`,n),e.on(`error`,n)})}function tl(e){return e&&typeof e.byteLength==`number`}var nl=class extends T{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}},rl=class{cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let t=new AbortController,n;if(e.abortSignal){if(e.abortSignal.aborted)throw new cc(`The operation was aborted. Request has already been canceled.`);n=e=>{e.type===`abort`&&t.abort()},e.abortSignal.addEventListener(`abort`,n)}let r;e.timeout>0&&(r=setTimeout(()=>{let n=new Kc;Zc.info(`request to '${n.sanitizeUrl(e.url)}' timed out. canceling...`),t.abort()},e.timeout));let i=e.headers.get(`Accept-Encoding`),a=i?.includes(`gzip`)||i?.includes(`deflate`),o=typeof e.body==`function`?e.body():e.body;if(o&&!e.headers.has(`Content-Length`)){let t=sl(o);t!==null&&e.headers.set(`Content-Length`,t)}let s;try{if(o&&e.onUploadProgress){let t=e.onUploadProgress,n=new nl(t);n.on(`error`,e=>{Zc.error(`Error in upload progress`,e)}),$c(o)?o.pipe(n):n.end(o),o=n}let n=await this.makeRequest(e,t,o);r!==void 0&&clearTimeout(r);let i=il(n),c={status:n.statusCode??0,headers:i,request:e};if(e.method===`HEAD`)return n.resume(),c;s=a?al(n,i):n;let l=e.onDownloadProgress;if(l){let e=new nl(l);e.on(`error`,e=>{Zc.error(`Error in download progress`,e)}),s.pipe(e),s=e}return e.streamResponseStatusCodes?.has(1/0)||e.streamResponseStatusCodes?.has(c.status)?c.readableStreamBody=s:c.bodyAsText=await ol(s),c}finally{if(e.abortSignal&&n){let t=Promise.resolve();$c(o)&&(t=el(o));let r=Promise.resolve();$c(s)&&(r=el(s)),Promise.all([t,r]).then(()=>{n&&e.abortSignal?.removeEventListener(`abort`,n)}).catch(e=>{Zc.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?C.request(a,r):te.request(a,r);s.once(`error`,t=>{o(new Jc(t.message,{code:t.code??Jc.REQUEST_SEND_ERROR,request:e}))}),t.signal.addEventListener(`abort`,()=>{let e=new cc(`The operation was aborted. Rejecting from abort signal callback while making request.`);s.destroy(e),o(e)}),n&&$c(n)?n.pipe(s):n?typeof n==`string`||Buffer.isBuffer(n)?s.end(n):tl(n)?s.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Zc.error(`Unrecognized body type`,n),o(new Jc(`Unrecognized body type`))):s.end()})}getOrCreateAgent(e,t){let n=e.disableKeepAlive;if(t)return n?C.globalAgent:(this.cachedHttpAgent||=new C.Agent({keepAlive:!0}),this.cachedHttpAgent);{if(n&&!e.tlsSettings)return te.globalAgent;let t=e.tlsSettings??Qc,r=this.cachedHttpsAgents.get(t);return r&&r.options.keepAlive===!n?r:(Zc.info(`No cached TLS Agent exist, creating a new Agent`),r=new te.Agent({keepAlive:!n,...t}),this.cachedHttpsAgents.set(t,r),r)}}};function il(e){let t=Nc();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 al(e,t){let n=t.get(`Content-Encoding`);if(n===`gzip`){let t=k.createGunzip();return e.pipe(t),t}else if(n===`deflate`){let t=k.createInflate();return e.pipe(t),t}return e}function ol(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 Jc(`Error reading response as text: ${e.message}`,{code:Jc.PARSE_ERROR}))})})}function sl(e){return e?Buffer.isBuffer(e)?e.length:$c(e)?null:tl(e)?e.byteLength:typeof e==`string`?Buffer.from(e).length:null:0}function cl(){return new rl}function ll(){return cl()}function ul(e={}){let t=e.logger??Zc.info,n=new Kc({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(i.headers)}`),i}}}const dl=[`GET`,`HEAD`];function fl(e={}){let{maxRetries:t=20,allowCrossOriginRedirects:n=!1}=e;return{name:`redirectPolicy`,async sendRequest(e,r){return pl(r,await r(e),t,n)}}}async function pl(e,t,n,r,i=0){let{request:a,status:o,headers:s}=t,c=s.get(`location`);if(c&&(o===300||o===301&&dl.includes(a.method)||o===302&&dl.includes(a.method)||o===303&&a.method===`POST`||o===307)&&i{let a,o,s=()=>i(new cc(n?.abortErrorMsg?n?.abortErrorMsg:`The operation was aborted.`)),c=()=>{n?.abortSignal&&o&&n.abortSignal.removeEventListener(`abort`,o)};if(o=()=>(a&&clearTimeout(a),c(),s()),n?.abortSignal&&n.abortSignal.aborted)return s();a=setTimeout(()=>{c(),r(t)},e),n?.abortSignal&&n.abortSignal.addEventListener(`abort`,o)})}function vl(e,t){let n=e.headers.get(t);if(!n)return;let r=Number(n);if(!Number.isNaN(r))return r}const yl=`Retry-After`,bl=[`retry-after-ms`,`x-ms-retry-after-ms`,yl];function xl(e){if(e&&[429,503].includes(e.status))try{for(let t of bl){let n=vl(e,t);if(n===0||n)return n*(t===yl?1e3:1)}let t=e.headers.get(yl);if(!t)return;let n=Date.parse(t)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}function Sl(e){return Number.isFinite(xl(e))}function Cl(){return{name:`throttlingRetryStrategy`,retry({response:e}){let t=xl(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}}}function wl(e={}){let t=e.retryDelayInMs??1e3,n=e.maxRetryDelayInMs??64e3;return{name:`exponentialRetryStrategy`,retry({retryCount:r,response:i,responseError:a}){let o=El(a),s=o&&e.ignoreSystemErrors,c=Tl(i),l=c&&e.ignoreHttpStatusCodes;return i&&(Sl(i)||!c)||l||s?{skipStrategy:!0}:a&&!o&&!c?{errorToThrow:a}:gl(r,{retryDelayInMs:t,maxRetryDelayInMs:n})}}}function Tl(e){return!!(e&&e.status!==void 0&&(e.status>=500||e.status===408)&&e.status!==501&&e.status!==505)}function El(e){return e?e.code===`ETIMEDOUT`||e.code===`ESOCKETTIMEDOUT`||e.code===`ECONNREFUSED`||e.code===`ECONNRESET`||e.code===`ENOENT`||e.code===`ENOTFOUND`:!1}const Dl=kc(`ts-http-runtime retryPolicy`);function Ol(e,t={maxRetries:3}){let n=t.logger||Dl;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),o=e,!e||o.name!==`RestError`)throw e;a=o.response}if(r.abortSignal?.aborted)throw n.error(`Retry ${s}: Request aborted.`),new cc;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 _l(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 kl(e={}){return{name:`defaultRetryPolicy`,sendRequest:Ol([Cl(),wl(e)],{maxRetries:e.maxRetries??3}).sendRequest}}typeof window<`u`&&window.document,typeof self==`object`&&typeof self?.importScripts==`function`&&(self.constructor?.name===`DedicatedWorkerGlobalScope`||self.constructor?.name===`ServiceWorkerGlobalScope`||self.constructor?.name),typeof Deno<`u`&&Deno.version!==void 0&&Deno.version.deno,typeof Bun<`u`&&Bun.version;const Al=globalThis.process!==void 0&&!!globalThis.process.version&&!!globalThis.process.versions?.node;typeof navigator<`u`&&navigator?.product;function jl(e){let t={};for(let[n,r]of e.entries())t[n]??=[],t[n].push(r);return t}function Ml(){return{name:`formDataPolicy`,async sendRequest(e,t){if(Al&&typeof FormData<`u`&&e.body instanceof FormData&&(e.formData=jl(e.body),e.body=void 0),e.formData){let t=e.headers.get(`Content-Type`);t&&t.indexOf(`application/x-www-form-urlencoded`)!==-1?e.body=Nl(e.formData):await Pl(e.formData,e),e.formData=void 0}return t(e)}}}function Nl(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 Pl(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:Nc({"Content-Disposition":`form-data; name="${t}"`}),body:Xc(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=Nc();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}}var Fl=U(((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 c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(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 l(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 u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Il=U(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Fl(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){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 n.enable(n.load()),n}t.exports=n})),Ll=U(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),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 n(){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 r(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 i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){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 o(){try{return localStorage}catch{}}t.exports=Il()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Rl=U(((e,t)=>{t.exports=(e,t)=>{t||=process.argv;let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1?!0:r{let n=W(`os`),r=Rl(),i=process.env,a;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;let t=a?1:0;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(e=>e in i)||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in i){let e=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function c(e){return o(s(e))}t.exports={supportsColor:c,stdout:c(process.stdout),stderr:c(process.stderr)}})),Bl=U(((e,t)=>{let n=W(`tty`),r=W(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,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=zl();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 i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(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]=o()+n+` `+e[0]}function o(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function s(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+` -`)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;re.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),Hl=U(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=Rl():t.exports=Vl()})),Ul=U((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(W(`http`)),a=r(W(`https`));async function o(e){let t=0,n=[];for await(let r of e)t+=r.length,n.push(r);return Buffer.concat(n,t)}e.toBuffer=o;async function s(e){let t=(await o(e)).toString(`utf8`);try{return JSON.parse(t)}catch(e){let n=e;throw n.message+=` (input: ${t})`,n}}e.json=s;function c(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=c})),Wl=U((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(W(`net`)),o=r(W(`http`)),s=W(`https`);i(Ul(),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):!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)}}})),Gl=U((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(Hl()).default)(`https-proxy-agent:parse-proxy-response`);function r(e){return new Promise((t,r)=>{let i=0,a=[];function o(){let t=e.read();t?u(t):e.once(`readable`,o)}function s(){e.removeListener(`end`,c),e.removeListener(`error`,l),e.removeListener(`readable`,o)}function c(){s(),n(`onend`),r(Error(`Proxy connection ended before receiving CONNECT response`))}function l(e){s(),n(`onerror %o`,e),r(e)}function u(c){a.push(c),i+=c.length;let l=Buffer.concat(a,i),u=l.indexOf(`\r +`)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;re.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),Vl=U(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=Ll():t.exports=Bl()})),Hl=U((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(W(`http`)),a=r(W(`https`));async function o(e){let t=0,n=[];for await(let r of e)t+=r.length,n.push(r);return Buffer.concat(n,t)}e.toBuffer=o;async function s(e){let t=(await o(e)).toString(`utf8`);try{return JSON.parse(t)}catch(e){let n=e;throw n.message+=` (input: ${t})`,n}}e.json=s;function c(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=c})),Ul=U((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(W(`net`)),o=r(W(`http`)),s=W(`https`);i(Hl(),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):!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)}}})),Wl=U((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(Vl()).default)(`https-proxy-agent:parse-proxy-response`);function r(e){return new Promise((t,r)=>{let i=0,a=[];function o(){let t=e.read();t?u(t):e.once(`readable`,o)}function s(){e.removeListener(`end`,c),e.removeListener(`error`,l),e.removeListener(`readable`,o)}function c(){s(),n(`onend`),r(Error(`Proxy connection ended before receiving CONNECT response`))}function l(e){s(),n(`onerror %o`,e),r(e)}function u(c){a.push(c),i+=c.length;let l=Buffer.concat(a,i),u=l.indexOf(`\r \r `);if(u===-1){n(`have not received end of HTTP headers yet...`),o();return}let d=l.slice(0,u).toString(`ascii`).split(`\r -`),f=d.shift();if(!f)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let p=f.split(` `),m=+p[1],h=p.slice(2).join(` `),g={};for(let t of d){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=g[i];typeof o==`string`?g[i]=[o,a]:Array.isArray(o)?o.push(a):g[i]=a}n(`got proxy server response: %o %o`,f,g),s(),t({connect:{statusCode:m,statusText:h,headers:g},buffered:l})}e.on(`error`,l),e.on(`end`,c),o()})}e.parseProxyResponse=r})),Kl=U((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(W(`net`)),o=r(W(`tls`)),s=i(W(`assert`)),c=i(Hl()),l=Wl(),u=W(`url`),d=Gl(),f=(0,c.default)(`https-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e;var m=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?g(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(p(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:m,buffered:v}=await u;if(e.emit(`proxyConnect`,m),this.emit(`proxyConnect`,m,e),m.statusCode===200)return e.once(`socket`,h),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...g(p(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let y=new a.Socket({writable:!1});return y.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(v),e.push(null)}),y}};m.protocols=[`http`,`https`],e.HttpsProxyAgent=m;function h(e){e.resume()}function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),ql=U((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(W(`net`)),o=r(W(`tls`)),s=i(Hl()),c=W(`events`),l=Wl(),u=W(`url`),d=(0,s.default)(`http-proxy-agent`);var f=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?p(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 +`),f=d.shift();if(!f)return e.destroy(),r(Error(`No header received from proxy CONNECT response`));let p=f.split(` `),m=+p[1],h=p.slice(2).join(` `),g={};for(let t of d){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=g[i];typeof o==`string`?g[i]=[o,a]:Array.isArray(o)?o.push(a):g[i]=a}n(`got proxy server response: %o %o`,f,g),s(),t({connect:{statusCode:m,statusText:h,headers:g},buffered:l})}e.on(`error`,l),e.on(`end`,c),o()})}e.parseProxyResponse=r})),Gl=U((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(W(`net`)),o=r(W(`tls`)),s=i(W(`assert`)),c=i(Vl()),l=Ul(),u=W(`url`),d=Wl(),f=(0,c.default)(`https-proxy-agent`),p=e=>e.servername===void 0&&e.host&&!a.isIP(e.host)?{...e,servername:e.host}:e;var m=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?g(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(p(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:m,buffered:v}=await u;if(e.emit(`proxyConnect`,m),this.emit(`proxyConnect`,m,e),m.statusCode===200)return e.once(`socket`,h),t.secureEndpoint?(f(`Upgrading socket connection to TLS`),o.connect({...g(p(t),`host`,`path`,`port`),socket:r})):r;r.destroy();let y=new a.Socket({writable:!1});return y.readable=!0,e.once(`socket`,e=>{f(`Replaying proxy buffer for failed request`),(0,s.default)(e.listenerCount(`data`)>0),e.push(v),e.push(null)}),y}};m.protocols=[`http`,`https`],e.HttpsProxyAgent=m;function h(e){e.resume()}function g(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),Kl=U((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(W(`net`)),o=r(W(`tls`)),s=i(Vl()),c=W(`events`),l=Ul(),u=W(`url`),d=(0,s.default)(`http-proxy-agent`);var f=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?p(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}};f.protocols=[`http`,`https`],e.HttpProxyAgent=f;function p(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),Jl=Kl(),Yl=ql();const Xl=[];let Zl=!1;const Ql=new Map;function $l(e){if(process.env[e])return process.env[e];if(process.env[e.toLowerCase()])return process.env[e.toLowerCase()]}function eu(){if(!process)return;let e=$l(`HTTPS_PROXY`),t=$l(`ALL_PROXY`),n=$l(`HTTP_PROXY`);return e||t||n}function tu(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 nu(){let e=$l(`NO_PROXY`);return Zl=!0,e?e.split(`,`).map(e=>e.trim()).filter(e=>e.length):[]}function ru(e){if(!e&&(e=eu(),!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 iu(){let e=eu();return e?new URL(e):void 0}function au(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 ou(e,t,n){if(e.agent)return;let r=new URL(e.url).protocol!==`https:`;e.tlsSettings&&Qc.warning(`TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.`);let i=e.headers.toJSON();r?(t.httpProxyAgent||=new Yl.HttpProxyAgent(n,{headers:i}),e.agent=t.httpProxyAgent):(t.httpsProxyAgent||=new Jl.HttpsProxyAgent(n,{headers:i}),e.agent=t.httpsProxyAgent)}function su(e,t){Zl||Xl.push(...nu());let n=e?au(e):iu(),r={};return{name:`proxyPolicy`,async sendRequest(e,i){return!e.proxySettings&&n&&!tu(e.url,t?.customNoProxyList??Xl,t?.customNoProxyList?void 0:Ql)?ou(e,r,n):e.proxySettings&&ou(e,r,au(e.proxySettings)),i(e)}}}function cu(e){return{name:`agentPolicy`,sendRequest:async(t,n)=>(t.agent||=e,n(t))}}function lu(e){return{name:`tlsPolicy`,sendRequest:async(t,n)=>(t.tlsSettings||=e,n(t))}}function uu(e){return typeof e.stream==`function`}async function*du(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}function fu(e){e[Symbol.asyncIterator]||(e[Symbol.asyncIterator]=du.bind(e)),e.values||=du.bind(e)}function pu(e){return e instanceof ReadableStream?(fu(e),ee.fromWeb(e)):e}function mu(e){return e instanceof Uint8Array?ee.from(Buffer.from(e)):uu(e)?pu(e.stream()):pu(e)}async function hu(e){return function(){let t=e.map(e=>typeof e==`function`?e():e).map(mu);return ee.from((async function*(){for(let e of t)for await(let t of e)yield t})())}}function gu(){return`----AzSDKFormBoundary${Fc()}`}function _u(e){let t=``;for(let[n,r]of e)t+=`${n}: ${r}\r\n`;return t}function vu(e){if(e instanceof Uint8Array)return e.byteLength;if(uu(e))return e.size===-1?void 0:e.size}function yu(e){let t=0;for(let n of e){let e=vu(n);if(e===void 0)return;t+=e}return t}async function bu(e,t,n){let r=[Zc(`--${n}`,`utf-8`),...t.flatMap(e=>[Zc(`\r -`,`utf-8`),Zc(_u(e.headers),`utf-8`),Zc(`\r -`,`utf-8`),e.body,Zc(`\r\n--${n}`,`utf-8`)]),Zc(`--\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}};f.protocols=[`http`,`https`],e.HttpProxyAgent=f;function p(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}})),ql=Gl(),Jl=Kl();const Yl=[];let Xl=!1;const Zl=new Map;function Ql(e){if(process.env[e])return process.env[e];if(process.env[e.toLowerCase()])return process.env[e.toLowerCase()]}function $l(){if(!process)return;let e=Ql(`HTTPS_PROXY`),t=Ql(`ALL_PROXY`),n=Ql(`HTTP_PROXY`);return e||t||n}function eu(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 tu(){let e=Ql(`NO_PROXY`);return Xl=!0,e?e.split(`,`).map(e=>e.trim()).filter(e=>e.length):[]}function nu(e){if(!e&&(e=$l(),!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 ru(){let e=$l();return e?new URL(e):void 0}function iu(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 au(e,t,n){if(e.agent)return;let r=new URL(e.url).protocol!==`https:`;e.tlsSettings&&Zc.warning(`TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.`);let i=e.headers.toJSON();r?(t.httpProxyAgent||=new Jl.HttpProxyAgent(n,{headers:i}),e.agent=t.httpProxyAgent):(t.httpsProxyAgent||=new ql.HttpsProxyAgent(n,{headers:i}),e.agent=t.httpsProxyAgent)}function ou(e,t){Xl||Yl.push(...tu());let n=e?iu(e):ru(),r={};return{name:`proxyPolicy`,async sendRequest(e,i){return!e.proxySettings&&n&&!eu(e.url,t?.customNoProxyList??Yl,t?.customNoProxyList?void 0:Zl)?au(e,r,n):e.proxySettings&&au(e,r,iu(e.proxySettings)),i(e)}}}function su(e){return{name:`agentPolicy`,sendRequest:async(t,n)=>(t.agent||=e,n(t))}}function cu(e){return{name:`tlsPolicy`,sendRequest:async(t,n)=>(t.tlsSettings||=e,n(t))}}function lu(e){return typeof e.stream==`function`}async function*uu(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}function du(e){e[Symbol.asyncIterator]||(e[Symbol.asyncIterator]=uu.bind(e)),e.values||=uu.bind(e)}function fu(e){return e instanceof ReadableStream?(du(e),ee.fromWeb(e)):e}function pu(e){return e instanceof Uint8Array?ee.from(Buffer.from(e)):lu(e)?fu(e.stream()):fu(e)}async function mu(e){return function(){let t=e.map(e=>typeof e==`function`?e():e).map(pu);return ee.from((async function*(){for(let e of t)for await(let t of e)yield t})())}}function hu(){return`----AzSDKFormBoundary${Pc()}`}function gu(e){let t=``;for(let[n,r]of e)t+=`${n}: ${r}\r\n`;return t}function _u(e){if(e instanceof Uint8Array)return e.byteLength;if(lu(e))return e.size===-1?void 0:e.size}function vu(e){let t=0;for(let n of e){let e=_u(n);if(e===void 0)return;t+=e}return t}async function yu(e,t,n){let r=[Xc(`--${n}`,`utf-8`),...t.flatMap(e=>[Xc(`\r +`,`utf-8`),Xc(gu(e.headers),`utf-8`),Xc(`\r +`,`utf-8`),e.body,Xc(`\r\n--${n}`,`utf-8`)]),Xc(`--\r \r -`,`utf-8`)],i=yu(r);i&&e.headers.set(`Content-Length`,i),e.body=await hu(r)}const xu=`multipartPolicy`,Su=new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);function Cu(e){if(e.length>70)throw Error(`Multipart boundary "${e}" exceeds maximum length of 70 characters`);if(Array.from(e).some(e=>!Su.has(e)))throw Error(`Multipart boundary "${e}" contains invalid characters`)}function wu(){return{name:xu,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?Cu(n):n=gu(),e.headers.set(`Content-Type`,`${a}; boundary=${n}`),await bu(e,e.multipartBody.parts,n),e.multipartBody=void 0,t(e)}}}function Tu(){return Bc()}const Eu=Oc({logLevelEnvVarName:`AZURE_LOG_LEVEL`,namespace:`azure`});Eu.logger;function Du(e){return Eu.createClientLogger(e)}const Ou=Du(`core-rest-pipeline`);function ku(e={}){return dl({logger:Ou.info,...e})}function Au(e={}){return pl(e)}function ju(){return`User-Agent`}async function Mu(e){if(t&&t.versions){let n=`${L.type()} ${L.release()}; ${L.arch()}`,r=t.versions;r.bun?e.set(`Bun`,`${r.bun} (${n})`):r.deno?e.set(`Deno`,`${r.deno} (${n})`):r.node&&e.set(`Node`,`${r.node} (${n})`)}}const Nu=`1.22.3`;function Pu(e){let t=[];for(let[n,r]of e){let e=r?`${n}/${r}`:n;t.push(e)}return t.join(` `)}function Fu(){return ju()}async function Iu(e){let t=new Map;t.set(`core-rest-pipeline`,Nu),await Mu(t);let n=Pu(t);return e?`${e} ${n}`:n}const Lu=Fu();function Ru(e={}){let t=Iu(e.userAgentPrefix);return{name:`userAgentPolicy`,async sendRequest(e,n){return e.headers.has(Lu)||e.headers.set(Lu,await t),n(e)}}}var zu=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function Bu(e,t){let{cleanupBeforeAbort:n,abortSignal:r,abortErrorMsg:i}=t??{};return new Promise((t,a)=>{function o(){a(new zu(i??`The operation was aborted.`))}function s(){r?.removeEventListener(`abort`,c)}function c(){n?.(),s(),o()}if(r?.aborted)return o();try{e(e=>{s(),t(e)},e=>{s(),a(e)})}catch(e){a(e)}r?.addEventListener(`abort`,c)})}function Vu(e,t){let n,{abortSignal:r,abortErrorMsg:i}=t??{};return Bu(t=>{n=setTimeout(t,e)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:r,abortErrorMsg:i??`The delay was aborted.`})}function Hu(e){if(Hc(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 Uu(e){return Hc(e)}function Wu(){return Fc()}const Gu=jl,Ku=Symbol(`rawContent`);function qu(e){return typeof e[Ku]==`function`}function Ju(e){return qu(e)?e[Ku]():e}const Yu=xu;function Xu(){let e=wu();return{name:Yu,sendRequest:async(t,n)=>{if(t.multipartBody)for(let e of t.multipartBody.parts)qu(e.body)&&(e.body=Ju(e.body));return e.sendRequest(t,n)}}}function Zu(){return hl()}function Qu(e={}){return Al(e)}function $u(){return Nl()}function ed(e){return ru(e)}function td(e,t){return su(e,t)}function nd(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 rd(e){return cu(e)}function id(e){return lu(e)}const ad={span:Symbol.for(`@azure/core-tracing span`),namespace:Symbol.for(`@azure/core-tracing namespace`)};function od(e={}){let t=new sd(e.parentContext);return e.span&&(t=t.setValue(ad.span,e.span)),e.namespace&&(t=t.setValue(ad.namespace,e.namespace)),t}var sd=class e{_contextMap;constructor(t){this._contextMap=t instanceof e?new Map(t._contextMap):new Map}setValue(t,n){let r=new e(this);return r._contextMap.set(t,n),r}getValue(e){return this._contextMap.get(e)}deleteValue(t){let n=new e(this);return n._contextMap.delete(t),n}};const cd=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.state=void 0,e.state={instrumenterImplementation:void 0}}))().state;function ld(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function ud(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:ld(),tracingContext:od({parentContext:t.tracingContext})}),withContext(e,t,...n){return t(...n)}}}function dd(){return cd.instrumenterImplementation||=ud(),cd.instrumenterImplementation}function fd(e){let{namespace:t,packageName:n,packageVersion:r}=e;function i(e,i,a){let o=dd().startSpan(e,{...a,packageName:n,packageVersion:r,tracingContext:i?.tracingOptions?.tracingContext}),s=o.tracingContext,c=o.span;return s.getValue(ad.namespace)||(s=s.setValue(ad.namespace,t)),c.setAttribute(`az.namespace`,s.getValue(ad.namespace)),{span:c,updatedOptions:Object.assign({},i,{tracingOptions:{...i?.tracingOptions,tracingContext:s}})}}async function a(e,t,n,r){let{span:a,updatedOptions:s}=i(e,t,r);try{let e=await o(s.tracingOptions.tracingContext,()=>Promise.resolve(n(s,a)));return a.setStatus({status:`success`}),e}catch(e){throw a.setStatus({status:`error`,error:e}),e}finally{a.end()}}function o(e,t,...n){return dd().withContext(e,t,...n)}function s(e){return dd().parseTraceparentHeader(e)}function c(e){return dd().createRequestHeaders(e)}return{startSpan:i,withSpan:a,withContext:o,parseTraceparentHeader:s,createRequestHeaders:c}}const pd=Yc;function md(e){return Xc(e)}function hd(e={}){let t=Iu(e.userAgentPrefix),n=new qc({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),r=gd();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}=_d(r,e,o)??{};if(!s||!c)return i(e);try{let t=await r.withContext(c,i,e);return yd(s,t),t}catch(e){throw vd(s,e),e}}}}function gd(){try{return fd({namespace:``,packageName:`@azure/core-rest-pipeline`,packageVersion:Nu})}catch(e){Ou.warning(`Error when creating the TracingClient: ${Hu(e)}`);return}}function _d(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){Ou.warning(`Skipping creating a tracing span due to an error: ${Hu(e)}`);return}}function vd(e,t){try{e.setStatus({status:`error`,error:Uu(t)?t:void 0}),md(t)&&t.statusCode&&e.setAttribute(`http.status_code`,t.statusCode),e.end()}catch(e){Ou.warning(`Skipping tracing span processing due to an error: ${Hu(e)}`)}}function yd(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){Ou.warning(`Skipping tracing span processing due to an error: ${Hu(e)}`)}}function bd(e){if(e instanceof AbortSignal)return{abortSignal:e};if(e.aborted)return{abortSignal:AbortSignal.abort(e.reason)};let t=new AbortController,n=!0;function r(){n&&=(e.removeEventListener(`abort`,i),!1)}function i(){t.abort(e.reason),r()}return e.addEventListener(`abort`,i),{abortSignal:t.signal,cleanup:r}}function xd(){return{name:`wrapAbortSignalLikePolicy`,sendRequest:async(e,t)=>{if(!e.abortSignal)return t(e);let{abortSignal:n,cleanup:r}=bd(e.abortSignal);e.abortSignal=n;try{return await t(e)}finally{r?.()}}}}function Sd(e){let t=Tu();return Gu&&(e.agent&&t.addPolicy(rd(e.agent)),e.tlsOptions&&t.addPolicy(id(e.tlsOptions)),t.addPolicy(td(e.proxyOptions)),t.addPolicy(Zu())),t.addPolicy(xd()),t.addPolicy($u(),{beforePolicies:[Yu]}),t.addPolicy(Ru(e.userAgentOptions)),t.addPolicy(nd(e.telemetryOptions?.clientRequestIdHeaderName)),t.addPolicy(Xu(),{afterPhase:`Deserialize`}),t.addPolicy(Qu(e.retryOptions),{phase:`Retry`}),t.addPolicy(hd({...e.userAgentOptions,...e.loggingOptions}),{afterPhase:`Retry`}),Gu&&t.addPolicy(Au(e.redirectOptions),{afterPhase:`Retry`}),t.addPolicy(ku(e.loggingOptions),{afterPhase:`Sign`}),t}function Cd(){let e=ul();return{async sendRequest(t){let{abortSignal:n,cleanup:r}=t.abortSignal?bd(t.abortSignal):{};try{return t.abortSignal=n,await e.sendRequest(t)}finally{r?.()}}}}function wd(e){return Pc(e)}function Td(e){return Lc(e)}const Ed={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Dd(e,t,n){async function r(){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?s(e,t):(o.shouldRefresh&&s(e,t),r)}}async function kd(e,t){try{return[await t(e),void 0]}catch(e){if(md(e)&&e.response)return[e.response,e];throw e}}async function Ad(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 jd(e){return e.status===401&&e.headers.has(`WWW-Authenticate`)}async function Md(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 Nd(e){let{credential:t,scopes:n,challengeCallbacks:r}=e,i=e.logger||Ou,a={authorizeRequest:r?.authorizeRequest?.bind(r)??Ad,authorizeRequestOnChallenge:r?.authorizeRequestOnChallenge?.bind(r)},o=t?Od(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 kd(e,t),jd(r)){let l=Fd(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 Md({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await kd(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 kd(e,t)),jd(r)&&(l=Fd(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 Md({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await kd(e,t))}}if(s)throw s;return r}}}function Pd(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 Fd(e){if(e)return Pd(e).find(e=>e.scheme===`Bearer`&&e.params.claims&&e.params.error===`insufficient_claims`)?.params.claims}function Id(e){let t=e;return t&&typeof t.getToken==`function`&&(t.signRequest===void 0||t.getToken.length>0)}const Ld=`DisableKeepAlivePolicy`;function Rd(){return{name:Ld,async sendRequest(e,t){return e.disableKeepAlive=!0,t(e)}}}function zd(e){return e.getOrderedPolicies().some(e=>e.name===Ld)}function Bd(e){return(e instanceof Buffer?e:Buffer.from(e.buffer)).toString(`base64`)}function Vd(e){return Buffer.from(e,`base64`)}function Hd(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 Ud=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Wd(e){return Ud.test(e)}const Gd=/^[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 Kd(e){return Gd.test(e)}function qd(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 Jd(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 qd({body:e.parsedBody,headers:n,hasNullableType:i,shouldWrapBody:Hd(e.parsedBody,a)})}var Yd=class{modelMappers;isXML;constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,n){let r=(e,r)=>{throw Error(`"${n}" with value "${t}" should satisfy the constraint "${e}": ${r}.`)};if(e.constraints&&t!=null){let{ExclusiveMaximum:n,ExclusiveMinimum:i,InclusiveMaximum:a,InclusiveMinimum:o,MaxItems:s,MaxLength:c,MinItems:l,MinLength:u,MultipleOf:d,Pattern:f,UniqueItems:p}=e.constraints;if(n!==void 0&&t>=n&&r(`ExclusiveMaximum`,n),i!==void 0&&t<=i&&r(`ExclusiveMinimum`,i),a!==void 0&&t>a&&r(`InclusiveMaximum`,a),o!==void 0&&ts&&r(`MaxItems`,s),c!==void 0&&t.length>c&&r(`MaxLength`,c),l!==void 0&&t.lengthn.indexOf(e)!==t)&&r(`UniqueItems`,p)}}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=mf(this,e,t,n,!!this.isXML,i)):a=uf(this,e,t,n,!!this.isXML,i):a=lf(this,e,t,n,!!this.isXML,i):a=sf(n,t):a=of(n,t):a=cf(o,t,n):a=af(n,e.type.allowedValues,t):a=rf(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=_f(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=vf(this,e,t,n,i)):a=yf(this,e,t,n,i):a=$d(t):a=Vd(t):a=nf(t):a=new Date(t):a=t:a=t===`true`?!0:t===`false`?!1:t:(a=parseFloat(t),isNaN(a)&&(a=t))}return e.isConstant&&(a=e.defaultValue),a}};function Xd(e={},t=!1){return new Yd(e,t)}function Zd(e,t){let n=e.length;for(;n-1>=0&&e[n-1]===t;)--n;return e.substr(0,n)}function Qd(e){if(e){if(!(e instanceof Uint8Array))throw Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);return Zd(Bd(e),`=`).replace(/\+/g,`-`).replace(/\//g,`_`)}}function $d(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,`/`),Vd(e)}}function ef(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 tf(e){if(e)return typeof e.valueOf()==`string`&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}function nf(e){if(e)return new Date(e*1e3)}function rf(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`&&Kd(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 af(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 of(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=Bd(t)}return t}function sf(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=Qd(t)}return t}function cf(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=tf(t)}else if(e.match(/^TimeSpan$/i)!==null&&!Wd(t))throw Error(`${n} must be a string in ISO 8601 format. Instead was "${t}".`)}return t}function lf(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 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)&&(o[i]=e.serialize(c,n[i],r+`["`+i+`"]`,a))}return o}return n}function hf(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 gf(e,t){return[`$`,t.xml.xmlCharKey].includes(e)}function _f(e,t,n,r,i){let a=i.xml.xmlCharKey??`_`;Sf(e,t)&&(t=xf(e,t,n,`serializedName`));let o=pf(e,t,r),s={},c=[];for(let l of Object.keys(o)){let u=o[l],d=ef(o[l].serializedName);c.push(d[0]);let{serializedName:f,xmlName:p,xmlElementName:m}=u,h=r;f!==``&&f!==void 0&&(h=r+`.`+f);let g=u.headerCollectionPrefix;if(g){let t={};for(let r of Object.keys(n))r.startsWith(g)&&(t[r.substring(g.length)]=e.deserialize(u.type.value,n[r],h,i)),c.push(r);s[l]=t}else if(e.isXML)if(u.xmlIsAttribute&&n.$)s[l]=e.deserialize(u,n.$[p],h,i);else if(u.xmlIsMsText)n[a]===void 0?typeof n==`string`&&(s[l]=n):s[l]=n[a];else{let t=m||p||f;if(u.xmlIsWrapped){let t=n[p]?.[m]??[];s[l]=e.deserialize(u,t,h,i),c.push(p)}else{let r=n[t];s[l]=e.deserialize(u,r,h,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 in o)if(ef(o[t].serializedName)[0]===e)return!1;return!0};for(let a in n)t(a)&&(s[a]=e.deserialize(l,n[a],r+`["`+a+`"]`,i))}else if(n&&!i.ignoreUnknownProperties)for(let e of Object.keys(n))s[e]===void 0&&!c.includes(e)&&!gf(e,i)&&(s[e]=n[e]);return s}function vf(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 yf(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 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 Ef(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=Df(e,r);!t.propertyFound&&n&&(t=Df(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 in r){let o=i.type.modelProperties[t],s=r[t],c=Ef(e,{parameterPath:s,mapper:o},n);c!==void 0&&(a||={},a[t]=c)}}return a}function Df(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 Lf(e){let t=Object.keys(e.responses);return t.length===0||t.length===1&&t[0]===`default`}function Rf(e,t,n,r){let i=200<=e.status&&e.status<300;if(Lf(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=new pd(e.request.streamResponseStatusCodes?.has(e.status)?`Unexpected status code: ${e.status}`:e.bodyAsText,{statusCode:e.status,request:e.request,response:e});if(!a&&!(e.parsedBody?.error?.code&&e.parsedBody?.error?.message))throw o;let s=a?.bodyMapper,c=a?.headersMapper;try{if(e.parsedBody){let n=e.parsedBody,i;if(s){let e=n;if(t.isXML&&s.type.name===wf.Sequence){e=[];let t=s.xmlElementName;typeof n==`object`&&t&&(e=n[t])}i=t.serializer.deserialize(s,e,`error.response.parsedBody`,r)}let a=n.error||i||n;o.code=a.code,a.message&&(o.message=a.message),s&&(o.response.parsedBody=i)}e.headers&&c&&(o.response.parsedHeaders=t.serializer.deserialize(c,e.headers.toJSON(),`operationRes.parsedHeaders`))}catch(t){o.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:o,shouldReturnResponse:!1}}async function zf(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){throw new pd(`Error "${e}" occurred while parsing the response body - ${n.bodyAsText}.`,{code:e.code||pd.PARSE_ERROR,statusCode:n.status,request:n.request,response:n})}}return n}function Bf(e){let t=new Set;for(let n in e.responses){let r=e.responses[n];r.bodyMapper&&r.bodyMapper.type.name===wf.Stream&&t.add(Number(n))}return t}function Vf(e){let{parameterPath:t,mapper:n}=e,r;return r=typeof t==`string`?t:Array.isArray(t)?t.join(`.`):n.serializedName,r}function Hf(e={}){let t=e.stringifyXML;return{name:`serializationPolicy`,async sendRequest(e,n){let r=Af(e),i=r?.operationSpec,a=r?.operationArguments;return i&&a&&(Uf(e,a,i),Wf(e,a,i,t)),n(e)}}}function Uf(e,t,n){if(n.headerParameters)for(let r of n.headerParameters){let i=Ef(t,r);if(i!=null||r.mapper.required){i=n.serializer.serialize(r.mapper,i,Vf(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||Vf(r),i)}}let r=t.options?.requestOptions?.customHeaders;if(r)for(let t of Object.keys(r))e.headers.set(t,r[t])}function Wf(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=Ef(t,n.requestBody);let i=n.requestBody.mapper,{required:s,serializedName:c,xmlName:l,xmlElementName:u,xmlNamespace:d,xmlNamespacePrefix:f,nullable:p}=i,m=i.type.name;try{if(e.body!==void 0&&e.body!==null||p&&e.body===null||s){let t=Vf(n.requestBody);e.body=n.serializer.serialize(i,e.body,t,a);let s=m===wf.Stream;if(n.isXML){let t=f?`xmlns:${f}`:`xmlns`,n=Gf(d,t,m,e.body,a);m===wf.Sequence?e.body=r(Kf(n,u||l||c,t,d),{rootName:l||c,xmlCharKey:o}):s||(e.body=r(n,{rootName:l||c,xmlCharKey:o}))}else if(m===wf.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=Ef(t,r);if(i!=null){let t=r.mapper.serializedName||Vf(r);e.formData[t]=n.serializer.serialize(r.mapper,i,Vf(r),a)}}}}function Gf(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 Kf(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 qf(e={}){let t=Sd(e??{});return e.credentialOptions&&t.addPolicy(Nd({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(Hf(e.serializationOptions),{phase:`Serialize`}),t.addPolicy(Nf(e.deserializationOptions),{phase:`Deserialize`}),t}let Jf;function Yf(){return Jf||=Cd(),Jf}const Xf={CSV:`,`,SSV:` `,Multi:`Multi`,TSV:` `,Pipes:`|`};function Zf(e,t,n,r){let i=$f(t,n,r),a=!1,o=Qf(e,i);if(t.path){let e=Qf(t.path,i);t.path===`/{nextLink}`&&e.startsWith(`/`)&&(e=e.substring(1)),ep(e)?(o=e,a=!0):o=tp(o,e)}let{queryParams:s,sequenceParams:c}=np(t,n,r);return o=ip(o,s,c,a),o}function Qf(e,t){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}function $f(e,t,n){let r=new Map;if(e.urlParameters?.length)for(let i of e.urlParameters){let a=Ef(t,i,n),o=Vf(i);a=e.serializer.serialize(i.mapper,a,o),i.skipEncoding||(a=encodeURIComponent(a)),r.set(`{${i.mapper.serializedName||o}}`,a)}return r}function ep(e){return e.includes(`://`)}function tp(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 n.pathname=r,n.toString()}function np(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=Ef(t,a,n);if(o!=null||a.mapper.required){o=e.serializer.serialize(a.mapper,o,Vf(a));let t=a.collectionFormat?Xf[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||Vf(a),o)}}return{queryParams:r,sequenceParams:i}}function rp(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 ip(e,t,n,r=!1){if(t.size===0)return e;let i=new URL(e),a=rp(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 ap=Du(`core-client`);var op=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&ap.warning(`The baseUri option for SDK Clients has been deprecated, please use endpoint instead.`),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Yf(),this.pipeline=e.pipeline||sp(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})}}async 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=Td({url:Zf(n,t,e,this)});r.method=t.httpMethod;let i=Af(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=Bf(t));try{let e=await this.sendRequest(r),n=Jd(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=Jd(n,t.responses[e.statusCode]||t.responses.default);e.details=r,o?.onResponse&&o.onResponse(n,r,e)}throw e}}};function sp(e){let t=cp(e),n=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return qf({...e,credentialOptions:n})}function cp(e){if(e.credentialScopes)return e.credentialScopes;if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential&&!e.credentialScopes)throw Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`)}const lp={DefaultScope:`/.default`,HeaderConstants:{AUTHORIZATION:`authorization`}};function up(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 dp=async e=>{let t=gp(e.request),n=mp(e.response);if(n){let r=hp(n),i=pp(e,r),a=fp(r);if(!a)return!1;let o=await e.getAccessToken(i,{...t,tenantId:a});return o?(e.request.headers.set(lp.HeaderConstants.AUTHORIZATION,`${o.tokenType??`Bearer`} ${o.token}`),!0):!1}return!1};function fp(e){let t=new URL(e.authorization_uri).pathname.split(`/`)[1];if(t&&up(t))return t}function pp(e,t){if(!t.resource_id)return e.scopes;let n=new URL(t.resource_id);n.pathname=lp.DefaultScope;let r=n.toString();return r===`https://disk.azure.com/.default`&&(r=`https://disk.azure.com//.default`),[r]}function mp(e){let t=e.headers.get(`WWW-Authenticate`);if(e.status===401&&t)return t}function hp(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 gp(e){return{abortSignal:e.abortSignal,requestOptions:{timeout:e.timeout},tracingOptions:e.tracingOptions}}const _p=Symbol(`Original PipelineRequest`),vp=Symbol.for(`@azure/core-client original request`);function yp(e,t={}){let n=e[_p],r=wd(e.headers.toJson({preserveCase:!0}));if(n)return n.headers=r,n;{let n=Td({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[vp]=t.originalRequest),n}}function bp(e,t){let n=t?.originalRequest??e,r={url:e.url,method:e.method,headers:xp(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===_p?e:i===`clone`?()=>bp(yp(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`&&[`url`,`method`,`withCredentials`,`timeout`,`requestId`,`abortSignal`,`body`,`formData`,`onDownloadProgress`,`onUploadProgress`,`proxySettings`,`streamResponseStatusCodes`,`agent`,`requestOverrides`].includes(n)&&(e[n]=r),Reflect.set(t,n,r,i)}}):r}function xp(e){return new Cp(e.toJSON({preserveCase:!0}))}function Sp(e){return e.toLowerCase()}var Cp=class e{_headersMap;constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t])}set(e,t){this._headersMap[Sp(e)]={name:e,value:t.toString()}}get(e){let t=this._headersMap[Sp(e)];return t?t.value:void 0}contains(e){return!!this._headersMap[Sp(e)]}remove(e){let t=this.contains(e);return delete this._headersMap[Sp(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;nEp(await e.sendRequest(bp(t,{createProxy:!0})))}}const Mp=`: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`;Mp+``,``+Mp;const Np=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 Pp(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--),!Zp(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,Yp(`InvalidTag`,t,Qp(e,a))}let l=Wp(e,a);if(l===!1)return Yp(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,Qp(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=Kp(u,t);if(i===!0)r=!0;else return Yp(i.err.code,i.err.msg,Qp(e,n+i.err.line))}else if(s){if(!l.tagClosed)return Yp(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,Qp(e,a));if(u.trim().length>0)return Yp(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,Qp(e,o));if(n.length===0)return Yp(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,Qp(e,o));{let t=n.pop();if(c!==t.tagName){let n=Qp(e,t.tagStartPos);return Yp(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,Qp(e,o))}n.length==0&&(i=!0)}}else{let s=Kp(u,t);if(s!==!0)return Yp(s.err.code,s.err.msg,Qp(e,a-u.length+s.err.line));if(i===!0)return Yp(`InvalidXml`,`Multiple possible root nodes found.`,Qp(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a0?Yp(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:Yp(`InvalidXml`,`Start tag expected.`,1)}function Vp(e){return e===` `||e===` `||e===` -`||e===`\r`}function Hp(e,t){let n=t;for(;t5&&r===`xml`)return Yp(`InvalidXml`,`XML declaration allowed only at the start of the document.`,Qp(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function Up(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 Wp(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const Gp=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function Kp(e,t){let n=Pp(e,Gp),r={};for(let e=0;eLp.includes(e)?`__`+e:e,tm={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},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:em};function nm(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(Lp.some(e=>n===e.toLowerCase())||Rp.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function rm(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:rm(!0)}const im=function(e){let t=Object.assign({},tm,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&&nm(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=em),t.processEntities=rm(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t};let am;am=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var om=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][am]={startIndex:t})}static getMetaDataSymbol(){return am}},sm=class{constructor(e){this.suppressValidationErr=!e,this.options=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})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&lm(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&lm(e,`!ATTLIST`,t))t+=8;else if(a&&lm(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(lm(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=cm(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=cm(e,t);let n=t;for(;t{for(;t1||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}}else return e}}const hm=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function gm(e,t,n){if(!n.eNotation)return e;let r=t.match(hm);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):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function _m(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 vm(e,t){if(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 ym(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 bm(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 xm=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),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){let e=this.path[this.path.length-1];e.values=void 0}let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),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}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;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.path=[],this.siblingStacks=[]}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--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))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)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==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}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,n){if(Sm.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}};function wm(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function Tm(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var Em=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>Hm(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>Hm(t,16,`&#x`)}},this.addExternalEntities=Dm,this.parseXml=Mm,this.parseTextData=Om,this.resolveNameSpace=km,this.buildAttributesMap=jm,this.isItStopNode=Im,this.replaceEntitiesValue=Pm,this.readStopNodeData=Bm,this.saveTextToParentTag=Fm,this.addChild=Nm,this.ignoreAttributesFn=bm(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Cm,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?Vm(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function km(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const Am=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function jm(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let r=Pp(e,Am),i=r.length,a={},o={};for(let e=0;e0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(o);for(let e=0;e`,a,`Closing Tag is not closed.`),i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=i.indexOf(`:`);e!==-1&&(i=i.substr(e+1))}i=Um(this.options.transformTagName,i,``,this.options).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw Error(`Unpaired tag can not be used as closing tag: `);o&&this.options.unpairedTags.indexOf(o)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=zm(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,this.readonlyMatcher),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new om(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(n,e,this.readonlyMatcher,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=Rm(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=i.readDocType(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=Rm(e,`]]>`,a,`CDATA is not closed.`)-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(i,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=t+2}else{let i=zm(e,a,this.options.removeNSPrefix);if(!i){let t=e.substring(Math.max(0,a-50),Math.min(e.length,a+50));throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`)}let o=i.tagName,s=i.rawTagName,c=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;if({tagName:o,tagExp:c}=Um(this.options.transformTagName,o,c,this.options),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw Error(`Invalid tag name: ${o}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let d=n;d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;c.length>0&&c.lastIndexOf(`/`)===c.length-1&&(f=!0,o[o.length-1]===`/`?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),l=o!==c);let p=null,m;m=Tm(s),o!==t.tagname&&this.matcher.push(o,{},m),o!==c&&l&&(p=this.buildAttributesMap(c,this.matcher,o),p&&wm(p,this.options)),o!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let h=a;if(this.isCurrentNodeStopNode){let t=``;if(f)a=i.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)a=i.closeIndex;else{let n=this.readStopNodeData(e,s,u+1);if(!n)throw Error(`Unexpected end of ${s}`);a=n.i,t=n.tagContent}let r=new om(o);p&&(r[`:@`]=p),r.add(this.options.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,h)}else{if(f){({tagName:o,tagExp:c}=Um(this.options.transformTagName,o,c,this.options));let e=new om(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(o)!==-1){let e=new om(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=i.closeIndex;continue}else{let e=new om(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),n=e}r=``,a=u}}else r+=e[a];return t.child};function Nm(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Pm(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}for(let t of Object.keys(this.docTypeEntities)){let n=this.docTypeEntities[t],i=e.match(n.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let t=e.length;if(e=e.replace(n.regx,n.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>r.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}for(let t of Object.keys(this.lastEntities)){let n=this.lastEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}if(e.indexOf(`&`)===-1)return e;if(this.options.htmlEntities)for(let t of Object.keys(this.htmlEntities)){let n=this.htmlEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e}function Fm(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Im(e,t){if(!e||e.length===0)return!1;for(let n=0;n`){let r,i=``;for(let a=t;a`){let i=Lm(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function Bm(e,t,n){let r=n,i=1;for(;n`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=Rm(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=Rm(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=Rm(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=zm(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function Vm(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:mm(e,n)}else if(Ip(e))return e;else return``}function Hm(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}function Um(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Wm(t,r),{tagName:t,tagExp:n}}function Wm(e,t){if(Rp.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return Lp.includes(e)?t.onDangerousProperty(e):e}const Gm=om.getMetaDataSymbol();function Km(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function qm(e,t,n,r){return Jm(e,t,n,r)}function Jm(e,t,n,r){let i,a={};for(let o=0;o0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function Ym(e){let t=Object.keys(e);for(let e=0;e0&&(n=` -`);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;et.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=sh(n,t),n}return``}for(let s=0;s`,o=!1,r.pop();continue}else if(l===t.commentPropName){a+=n+``,o=!0,r.pop();continue}else if(l[0]===`?`){let e=ah(c[`:@`],t,d),i=l===`?xml`?``:n,s=c[l][0][t.textNodeName];s=s.length===0?``:` `+s,a+=i+`<${l}${s}${e}?>`,o=!0,r.pop();continue}let f=n;f!==``&&(f+=t.indentBy);let p=n+`<${l}${ah(c[`:@`],t,d)}`,m;m=d?nh(c[l],t):eh(c[l],t,f,r,i),t.unpairedTags.indexOf(l)===-1?(!m||m.length===0)&&t.suppressEmptyNode?a+=p+`/>`:m&&m.endsWith(`>`)?a+=p+`>${m}${n}`:(a+=p+`>`,m&&n!==``&&(m.includes(`/>`)||m.includes(``):t.suppressUnpairedNode?a+=p+`>`:a+=p+`/>`,o=!0,r.pop()}return a}function th(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=e[i],r=!0}return r?n:null}function nh(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r`:n+=`<${a}${e}>${r}`}}return n}function rh(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function ih(e){let t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}const lh={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function uh(e){if(this.options=Object.assign({},lh,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e +`,`utf-8`)],i=vu(r);i&&e.headers.set(`Content-Length`,i),e.body=await mu(r)}const bu=`multipartPolicy`,xu=new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?`);function Su(e){if(e.length>70)throw Error(`Multipart boundary "${e}" exceeds maximum length of 70 characters`);if(Array.from(e).some(e=>!xu.has(e)))throw Error(`Multipart boundary "${e}" contains invalid characters`)}function Cu(){return{name:bu,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?Su(n):n=hu(),e.headers.set(`Content-Type`,`${a}; boundary=${n}`),await yu(e,e.multipartBody.parts,n),e.multipartBody=void 0,t(e)}}}function wu(){return zc()}const Tu=Dc({logLevelEnvVarName:`AZURE_LOG_LEVEL`,namespace:`azure`});Tu.logger;function Eu(e){return Tu.createClientLogger(e)}const Du=Eu(`core-rest-pipeline`);function Ou(e={}){return ul({logger:Du.info,...e})}function ku(e={}){return fl(e)}function Au(){return`User-Agent`}async function ju(e){if(t&&t.versions){let n=`${L.type()} ${L.release()}; ${L.arch()}`,r=t.versions;r.bun?e.set(`Bun`,`${r.bun} (${n})`):r.deno?e.set(`Deno`,`${r.deno} (${n})`):r.node&&e.set(`Node`,`${r.node} (${n})`)}}const Mu=`1.22.3`;function Nu(e){let t=[];for(let[n,r]of e){let e=r?`${n}/${r}`:n;t.push(e)}return t.join(` `)}function Pu(){return Au()}async function Fu(e){let t=new Map;t.set(`core-rest-pipeline`,Mu),await ju(t);let n=Nu(t);return e?`${e} ${n}`:n}const Iu=Pu();function Lu(e={}){let t=Fu(e.userAgentPrefix);return{name:`userAgentPolicy`,async sendRequest(e,n){return e.headers.has(Iu)||e.headers.set(Iu,await t),n(e)}}}var Ru=class extends Error{constructor(e){super(e),this.name=`AbortError`}};function zu(e,t){let{cleanupBeforeAbort:n,abortSignal:r,abortErrorMsg:i}=t??{};return new Promise((t,a)=>{function o(){a(new Ru(i??`The operation was aborted.`))}function s(){r?.removeEventListener(`abort`,c)}function c(){n?.(),s(),o()}if(r?.aborted)return o();try{e(e=>{s(),t(e)},e=>{s(),a(e)})}catch(e){a(e)}r?.addEventListener(`abort`,c)})}function Bu(e,t){let n,{abortSignal:r,abortErrorMsg:i}=t??{};return zu(t=>{n=setTimeout(t,e)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:r,abortErrorMsg:i??`The delay was aborted.`})}function Vu(e){if(Vc(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 Hu(e){return Vc(e)}function Uu(){return Pc()}const Wu=Al,Gu=Symbol(`rawContent`);function Ku(e){return typeof e[Gu]==`function`}function qu(e){return Ku(e)?e[Gu]():e}const Ju=bu;function Yu(){let e=Cu();return{name:Ju,sendRequest:async(t,n)=>{if(t.multipartBody)for(let e of t.multipartBody.parts)Ku(e.body)&&(e.body=qu(e.body));return e.sendRequest(t,n)}}}function Xu(){return ml()}function Zu(e={}){return kl(e)}function Qu(){return Ml()}function $u(e){return nu(e)}function ed(e,t){return ou(e,t)}function td(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 nd(e){return su(e)}function rd(e){return cu(e)}const id={span:Symbol.for(`@azure/core-tracing span`),namespace:Symbol.for(`@azure/core-tracing namespace`)};function ad(e={}){let t=new od(e.parentContext);return e.span&&(t=t.setValue(id.span,e.span)),e.namespace&&(t=t.setValue(id.namespace,e.namespace)),t}var od=class e{_contextMap;constructor(t){this._contextMap=t instanceof e?new Map(t._contextMap):new Map}setValue(t,n){let r=new e(this);return r._contextMap.set(t,n),r}getValue(e){return this._contextMap.get(e)}deleteValue(t){let n=new e(this);return n._contextMap.delete(t),n}};const sd=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.state=void 0,e.state={instrumenterImplementation:void 0}}))().state;function cd(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function ld(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:cd(),tracingContext:ad({parentContext:t.tracingContext})}),withContext(e,t,...n){return t(...n)}}}function ud(){return sd.instrumenterImplementation||=ld(),sd.instrumenterImplementation}function dd(e){let{namespace:t,packageName:n,packageVersion:r}=e;function i(e,i,a){let o=ud().startSpan(e,{...a,packageName:n,packageVersion:r,tracingContext:i?.tracingOptions?.tracingContext}),s=o.tracingContext,c=o.span;return s.getValue(id.namespace)||(s=s.setValue(id.namespace,t)),c.setAttribute(`az.namespace`,s.getValue(id.namespace)),{span:c,updatedOptions:Object.assign({},i,{tracingOptions:{...i?.tracingOptions,tracingContext:s}})}}async function a(e,t,n,r){let{span:a,updatedOptions:s}=i(e,t,r);try{let e=await o(s.tracingOptions.tracingContext,()=>Promise.resolve(n(s,a)));return a.setStatus({status:`success`}),e}catch(e){throw a.setStatus({status:`error`,error:e}),e}finally{a.end()}}function o(e,t,...n){return ud().withContext(e,t,...n)}function s(e){return ud().parseTraceparentHeader(e)}function c(e){return ud().createRequestHeaders(e)}return{startSpan:i,withSpan:a,withContext:o,parseTraceparentHeader:s,createRequestHeaders:c}}const fd=Jc;function pd(e){return Yc(e)}function md(e={}){let t=Fu(e.userAgentPrefix),n=new Kc({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),r=hd();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}=gd(r,e,o)??{};if(!s||!c)return i(e);try{let t=await r.withContext(c,i,e);return vd(s,t),t}catch(e){throw _d(s,e),e}}}}function hd(){try{return dd({namespace:``,packageName:`@azure/core-rest-pipeline`,packageVersion:Mu})}catch(e){Du.warning(`Error when creating the TracingClient: ${Vu(e)}`);return}}function gd(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){Du.warning(`Skipping creating a tracing span due to an error: ${Vu(e)}`);return}}function _d(e,t){try{e.setStatus({status:`error`,error:Hu(t)?t:void 0}),pd(t)&&t.statusCode&&e.setAttribute(`http.status_code`,t.statusCode),e.end()}catch(e){Du.warning(`Skipping tracing span processing due to an error: ${Vu(e)}`)}}function vd(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){Du.warning(`Skipping tracing span processing due to an error: ${Vu(e)}`)}}function yd(e){if(e instanceof AbortSignal)return{abortSignal:e};if(e.aborted)return{abortSignal:AbortSignal.abort(e.reason)};let t=new AbortController,n=!0;function r(){n&&=(e.removeEventListener(`abort`,i),!1)}function i(){t.abort(e.reason),r()}return e.addEventListener(`abort`,i),{abortSignal:t.signal,cleanup:r}}function bd(){return{name:`wrapAbortSignalLikePolicy`,sendRequest:async(e,t)=>{if(!e.abortSignal)return t(e);let{abortSignal:n,cleanup:r}=yd(e.abortSignal);e.abortSignal=n;try{return await t(e)}finally{r?.()}}}}function xd(e){let t=wu();return Wu&&(e.agent&&t.addPolicy(nd(e.agent)),e.tlsOptions&&t.addPolicy(rd(e.tlsOptions)),t.addPolicy(ed(e.proxyOptions)),t.addPolicy(Xu())),t.addPolicy(bd()),t.addPolicy(Qu(),{beforePolicies:[Ju]}),t.addPolicy(Lu(e.userAgentOptions)),t.addPolicy(td(e.telemetryOptions?.clientRequestIdHeaderName)),t.addPolicy(Yu(),{afterPhase:`Deserialize`}),t.addPolicy(Zu(e.retryOptions),{phase:`Retry`}),t.addPolicy(md({...e.userAgentOptions,...e.loggingOptions}),{afterPhase:`Retry`}),Wu&&t.addPolicy(ku(e.redirectOptions),{afterPhase:`Retry`}),t.addPolicy(Ou(e.loggingOptions),{afterPhase:`Sign`}),t}function Sd(){let e=ll();return{async sendRequest(t){let{abortSignal:n,cleanup:r}=t.abortSignal?yd(t.abortSignal):{};try{return t.abortSignal=n,await e.sendRequest(t)}finally{r?.()}}}}function Cd(e){return Nc(e)}function wd(e){return Ic(e)}const Td={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Ed(e,t,n){async function r(){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?s(e,t):(o.shouldRefresh&&s(e,t),r)}}async function Od(e,t){try{return[await t(e),void 0]}catch(e){if(pd(e)&&e.response)return[e.response,e];throw e}}async function kd(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 Ad(e){return e.status===401&&e.headers.has(`WWW-Authenticate`)}async function jd(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 Md(e){let{credential:t,scopes:n,challengeCallbacks:r}=e,i=e.logger||Du,a={authorizeRequest:r?.authorizeRequest?.bind(r)??kd,authorizeRequestOnChallenge:r?.authorizeRequestOnChallenge?.bind(r)},o=t?Dd(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 Od(e,t),Ad(r)){let l=Pd(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 jd({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await Od(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 Od(e,t)),Ad(r)&&(l=Pd(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 jd({scopes:Array.isArray(n)?n:[n],response:r,request:e,getAccessToken:o,logger:i},a),c&&([r,s]=await Od(e,t))}}if(s)throw s;return r}}}function Nd(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 Pd(e){if(e)return Nd(e).find(e=>e.scheme===`Bearer`&&e.params.claims&&e.params.error===`insufficient_claims`)?.params.claims}function Fd(e){let t=e;return t&&typeof t.getToken==`function`&&(t.signRequest===void 0||t.getToken.length>0)}const Id=`DisableKeepAlivePolicy`;function Ld(){return{name:Id,async sendRequest(e,t){return e.disableKeepAlive=!0,t(e)}}}function Rd(e){return e.getOrderedPolicies().some(e=>e.name===Id)}function zd(e){return(e instanceof Buffer?e:Buffer.from(e.buffer)).toString(`base64`)}function Bd(e){return Buffer.from(e,`base64`)}function Vd(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 Hd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ud(e){return Hd.test(e)}const Wd=/^[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 Gd(e){return Wd.test(e)}function Kd(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 qd(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 Kd({body:e.parsedBody,headers:n,hasNullableType:i,shouldWrapBody:Vd(e.parsedBody,a)})}var Jd=class{modelMappers;isXML;constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,n){let r=(e,r)=>{throw Error(`"${n}" with value "${t}" should satisfy the constraint "${e}": ${r}.`)};if(e.constraints&&t!=null){let{ExclusiveMaximum:n,ExclusiveMinimum:i,InclusiveMaximum:a,InclusiveMinimum:o,MaxItems:s,MaxLength:c,MinItems:l,MinLength:u,MultipleOf:d,Pattern:f,UniqueItems:p}=e.constraints;if(n!==void 0&&t>=n&&r(`ExclusiveMaximum`,n),i!==void 0&&t<=i&&r(`ExclusiveMinimum`,i),a!==void 0&&t>a&&r(`InclusiveMaximum`,a),o!==void 0&&ts&&r(`MaxItems`,s),c!==void 0&&t.length>c&&r(`MaxLength`,c),l!==void 0&&t.lengthn.indexOf(e)!==t)&&r(`UniqueItems`,p)}}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=pf(this,e,t,n,!!this.isXML,i)):a=lf(this,e,t,n,!!this.isXML,i):a=cf(this,e,t,n,!!this.isXML,i):a=of(n,t):a=af(n,t):a=sf(o,t,n):a=rf(n,e.type.allowedValues,t):a=nf(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=gf(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=_f(this,e,t,n,i)):a=vf(this,e,t,n,i):a=Qd(t):a=Bd(t):a=tf(t):a=new Date(t):a=t:a=t===`true`?!0:t===`false`?!1:t:(a=parseFloat(t),isNaN(a)&&(a=t))}return e.isConstant&&(a=e.defaultValue),a}};function Yd(e={},t=!1){return new Jd(e,t)}function Xd(e,t){let n=e.length;for(;n-1>=0&&e[n-1]===t;)--n;return e.substr(0,n)}function Zd(e){if(e){if(!(e instanceof Uint8Array))throw Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);return Xd(zd(e),`=`).replace(/\+/g,`-`).replace(/\//g,`_`)}}function Qd(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,`/`),Bd(e)}}function $d(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 ef(e){if(e)return typeof e.valueOf()==`string`&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}function tf(e){if(e)return new Date(e*1e3)}function nf(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`&&Gd(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 rf(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 af(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=zd(t)}return t}function of(e,t){if(t!=null){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);t=Zd(t)}return t}function sf(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=ef(t)}else if(e.match(/^TimeSpan$/i)!==null&&!Ud(t))throw Error(`${n} must be a string in ISO 8601 format. Instead was "${t}".`)}return t}function cf(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 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)&&(o[i]=e.serialize(c,n[i],r+`["`+i+`"]`,a))}return o}return n}function mf(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 hf(e,t){return[`$`,t.xml.xmlCharKey].includes(e)}function gf(e,t,n,r,i){let a=i.xml.xmlCharKey??`_`;xf(e,t)&&(t=bf(e,t,n,`serializedName`));let o=ff(e,t,r),s={},c=[];for(let l of Object.keys(o)){let u=o[l],d=$d(o[l].serializedName);c.push(d[0]);let{serializedName:f,xmlName:p,xmlElementName:m}=u,h=r;f!==``&&f!==void 0&&(h=r+`.`+f);let g=u.headerCollectionPrefix;if(g){let t={};for(let r of Object.keys(n))r.startsWith(g)&&(t[r.substring(g.length)]=e.deserialize(u.type.value,n[r],h,i)),c.push(r);s[l]=t}else if(e.isXML)if(u.xmlIsAttribute&&n.$)s[l]=e.deserialize(u,n.$[p],h,i);else if(u.xmlIsMsText)n[a]===void 0?typeof n==`string`&&(s[l]=n):s[l]=n[a];else{let t=m||p||f;if(u.xmlIsWrapped){let t=n[p]?.[m]??[];s[l]=e.deserialize(u,t,h,i),c.push(p)}else{let r=n[t];s[l]=e.deserialize(u,r,h,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 in o)if($d(o[t].serializedName)[0]===e)return!1;return!0};for(let a in n)t(a)&&(s[a]=e.deserialize(l,n[a],r+`["`+a+`"]`,i))}else if(n&&!i.ignoreUnknownProperties)for(let e of Object.keys(n))s[e]===void 0&&!c.includes(e)&&!hf(e,i)&&(s[e]=n[e]);return s}function _f(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 vf(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 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 Tf(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=Ef(e,r);!t.propertyFound&&n&&(t=Ef(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 in r){let o=i.type.modelProperties[t],s=r[t],c=Tf(e,{parameterPath:s,mapper:o},n);c!==void 0&&(a||={},a[t]=c)}}return a}function Ef(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 If(e){let t=Object.keys(e.responses);return t.length===0||t.length===1&&t[0]===`default`}function Lf(e,t,n,r){let i=200<=e.status&&e.status<300;if(If(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=new fd(e.request.streamResponseStatusCodes?.has(e.status)?`Unexpected status code: ${e.status}`:e.bodyAsText,{statusCode:e.status,request:e.request,response:e});if(!a&&!(e.parsedBody?.error?.code&&e.parsedBody?.error?.message))throw o;let s=a?.bodyMapper,c=a?.headersMapper;try{if(e.parsedBody){let n=e.parsedBody,i;if(s){let e=n;if(t.isXML&&s.type.name===Cf.Sequence){e=[];let t=s.xmlElementName;typeof n==`object`&&t&&(e=n[t])}i=t.serializer.deserialize(s,e,`error.response.parsedBody`,r)}let a=n.error||i||n;o.code=a.code,a.message&&(o.message=a.message),s&&(o.response.parsedBody=i)}e.headers&&c&&(o.response.parsedHeaders=t.serializer.deserialize(c,e.headers.toJSON(),`operationRes.parsedHeaders`))}catch(t){o.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:o,shouldReturnResponse:!1}}async function Rf(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){throw new fd(`Error "${e}" occurred while parsing the response body - ${n.bodyAsText}.`,{code:e.code||fd.PARSE_ERROR,statusCode:n.status,request:n.request,response:n})}}return n}function zf(e){let t=new Set;for(let n in e.responses){let r=e.responses[n];r.bodyMapper&&r.bodyMapper.type.name===Cf.Stream&&t.add(Number(n))}return t}function Bf(e){let{parameterPath:t,mapper:n}=e,r;return r=typeof t==`string`?t:Array.isArray(t)?t.join(`.`):n.serializedName,r}function Vf(e={}){let t=e.stringifyXML;return{name:`serializationPolicy`,async sendRequest(e,n){let r=kf(e),i=r?.operationSpec,a=r?.operationArguments;return i&&a&&(Hf(e,a,i),Uf(e,a,i,t)),n(e)}}}function Hf(e,t,n){if(n.headerParameters)for(let r of n.headerParameters){let i=Tf(t,r);if(i!=null||r.mapper.required){i=n.serializer.serialize(r.mapper,i,Bf(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||Bf(r),i)}}let r=t.options?.requestOptions?.customHeaders;if(r)for(let t of Object.keys(r))e.headers.set(t,r[t])}function Uf(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=Tf(t,n.requestBody);let i=n.requestBody.mapper,{required:s,serializedName:c,xmlName:l,xmlElementName:u,xmlNamespace:d,xmlNamespacePrefix:f,nullable:p}=i,m=i.type.name;try{if(e.body!==void 0&&e.body!==null||p&&e.body===null||s){let t=Bf(n.requestBody);e.body=n.serializer.serialize(i,e.body,t,a);let s=m===Cf.Stream;if(n.isXML){let t=f?`xmlns:${f}`:`xmlns`,n=Wf(d,t,m,e.body,a);m===Cf.Sequence?e.body=r(Gf(n,u||l||c,t,d),{rootName:l||c,xmlCharKey:o}):s||(e.body=r(n,{rootName:l||c,xmlCharKey:o}))}else if(m===Cf.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=Tf(t,r);if(i!=null){let t=r.mapper.serializedName||Bf(r);e.formData[t]=n.serializer.serialize(r.mapper,i,Bf(r),a)}}}}function Wf(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 Gf(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 Kf(e={}){let t=xd(e??{});return e.credentialOptions&&t.addPolicy(Md({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(Vf(e.serializationOptions),{phase:`Serialize`}),t.addPolicy(Mf(e.deserializationOptions),{phase:`Deserialize`}),t}let qf;function Jf(){return qf||=Sd(),qf}const Yf={CSV:`,`,SSV:` `,Multi:`Multi`,TSV:` `,Pipes:`|`};function Xf(e,t,n,r){let i=Qf(t,n,r),a=!1,o=Zf(e,i);if(t.path){let e=Zf(t.path,i);t.path===`/{nextLink}`&&e.startsWith(`/`)&&(e=e.substring(1)),$f(e)?(o=e,a=!0):o=ep(o,e)}let{queryParams:s,sequenceParams:c}=tp(t,n,r);return o=rp(o,s,c,a),o}function Zf(e,t){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}function Qf(e,t,n){let r=new Map;if(e.urlParameters?.length)for(let i of e.urlParameters){let a=Tf(t,i,n),o=Bf(i);a=e.serializer.serialize(i.mapper,a,o),i.skipEncoding||(a=encodeURIComponent(a)),r.set(`{${i.mapper.serializedName||o}}`,a)}return r}function $f(e){return e.includes(`://`)}function ep(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 n.pathname=r,n.toString()}function tp(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=Tf(t,a,n);if(o!=null||a.mapper.required){o=e.serializer.serialize(a.mapper,o,Bf(a));let t=a.collectionFormat?Yf[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||Bf(a),o)}}return{queryParams:r,sequenceParams:i}}function np(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 rp(e,t,n,r=!1){if(t.size===0)return e;let i=new URL(e),a=np(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 ip=Eu(`core-client`);var ap=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&ip.warning(`The baseUri option for SDK Clients has been deprecated, please use endpoint instead.`),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Jf(),this.pipeline=e.pipeline||op(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})}}async 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=wd({url:Xf(n,t,e,this)});r.method=t.httpMethod;let i=kf(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=zf(t));try{let e=await this.sendRequest(r),n=qd(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=qd(n,t.responses[e.statusCode]||t.responses.default);e.details=r,o?.onResponse&&o.onResponse(n,r,e)}throw e}}};function op(e){let t=sp(e),n=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return Kf({...e,credentialOptions:n})}function sp(e){if(e.credentialScopes)return e.credentialScopes;if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential&&!e.credentialScopes)throw Error(`When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy`)}const cp={DefaultScope:`/.default`,HeaderConstants:{AUTHORIZATION:`authorization`}};function lp(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 up=async e=>{let t=hp(e.request),n=pp(e.response);if(n){let r=mp(n),i=fp(e,r),a=dp(r);if(!a)return!1;let o=await e.getAccessToken(i,{...t,tenantId:a});return o?(e.request.headers.set(cp.HeaderConstants.AUTHORIZATION,`${o.tokenType??`Bearer`} ${o.token}`),!0):!1}return!1};function dp(e){let t=new URL(e.authorization_uri).pathname.split(`/`)[1];if(t&&lp(t))return t}function fp(e,t){if(!t.resource_id)return e.scopes;let n=new URL(t.resource_id);n.pathname=cp.DefaultScope;let r=n.toString();return r===`https://disk.azure.com/.default`&&(r=`https://disk.azure.com//.default`),[r]}function pp(e){let t=e.headers.get(`WWW-Authenticate`);if(e.status===401&&t)return t}function mp(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 hp(e){return{abortSignal:e.abortSignal,requestOptions:{timeout:e.timeout},tracingOptions:e.tracingOptions}}const gp=Symbol(`Original PipelineRequest`),_p=Symbol.for(`@azure/core-client original request`);function vp(e,t={}){let n=e[gp],r=Cd(e.headers.toJson({preserveCase:!0}));if(n)return n.headers=r,n;{let n=wd({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[_p]=t.originalRequest),n}}function yp(e,t){let n=t?.originalRequest??e,r={url:e.url,method:e.method,headers:bp(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===gp?e:i===`clone`?()=>yp(vp(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`&&[`url`,`method`,`withCredentials`,`timeout`,`requestId`,`abortSignal`,`body`,`formData`,`onDownloadProgress`,`onUploadProgress`,`proxySettings`,`streamResponseStatusCodes`,`agent`,`requestOverrides`].includes(n)&&(e[n]=r),Reflect.set(t,n,r,i)}}):r}function bp(e){return new Sp(e.toJSON({preserveCase:!0}))}function xp(e){return e.toLowerCase()}var Sp=class e{_headersMap;constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t])}set(e,t){this._headersMap[xp(e)]={name:e,value:t.toString()}}get(e){let t=this._headersMap[xp(e)];return t?t.value:void 0}contains(e){return!!this._headersMap[xp(e)]}remove(e){let t=this.contains(e);return delete this._headersMap[xp(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;nTp(await e.sendRequest(yp(t,{createProxy:!0})))}}const jp=`: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`;jp+``,``+jp;const Mp=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 Np(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--),!Xp(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,Jp(`InvalidTag`,t,Zp(e,a))}let l=Up(e,a);if(l===!1)return Jp(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,Zp(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=Gp(u,t);if(i===!0)r=!0;else return Jp(i.err.code,i.err.msg,Zp(e,n+i.err.line))}else if(s){if(!l.tagClosed)return Jp(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,Zp(e,a));if(u.trim().length>0)return Jp(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,Zp(e,o));if(n.length===0)return Jp(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,Zp(e,o));{let t=n.pop();if(c!==t.tagName){let n=Zp(e,t.tagStartPos);return Jp(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,Zp(e,o))}n.length==0&&(i=!0)}}else{let s=Gp(u,t);if(s!==!0)return Jp(s.err.code,s.err.msg,Zp(e,a-u.length+s.err.line));if(i===!0)return Jp(`InvalidXml`,`Multiple possible root nodes found.`,Zp(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a0?Jp(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:Jp(`InvalidXml`,`Start tag expected.`,1)}function Bp(e){return e===` `||e===` `||e===` +`||e===`\r`}function Vp(e,t){let n=t;for(;t5&&r===`xml`)return Jp(`InvalidXml`,`XML declaration allowed only at the start of the document.`,Zp(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function Hp(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 Up(e,t){let n=``,r=``,i=!1;for(;t`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const Wp=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function Gp(e,t){let n=Np(e,Wp),r={};for(let e=0;eIp.includes(e)?`__`+e:e,em={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},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:$p};function tm(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(Ip.some(e=>n===e.toLowerCase())||Lp.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function nm(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:nm(!0)}const rm=function(e){let t=Object.assign({},em,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&&tm(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=$p),t.processEntities=nm(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t};let im;im=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var am=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][im]={startIndex:t})}static getMetaDataSymbol(){return im}},om=class{constructor(e){this.suppressValidationErr=!e,this.options=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})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&cm(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&cm(e,`!ATTLIST`,t))t+=8;else if(a&&cm(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(cm(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=sm(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=sm(e,t);let n=t;for(;t{for(;t1||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}}else return e}}const mm=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function hm(e,t,n){if(!n.eNotation)return e;let r=t.match(mm);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):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function gm(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 _m(e,t){if(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 vm(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 ym(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 bm=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),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){let e=this.path[this.path.length-1];e.values=void 0}let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),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}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;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.path=[],this.siblingStacks=[]}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--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))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)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==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}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,n){if(xm.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}};function Cm(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function wm(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var Tm=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>Vm(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>Vm(t,16,`&#x`)}},this.addExternalEntities=Em,this.parseXml=jm,this.parseTextData=Dm,this.resolveNameSpace=Om,this.buildAttributesMap=Am,this.isItStopNode=Fm,this.replaceEntitiesValue=Nm,this.readStopNodeData=zm,this.saveTextToParentTag=Pm,this.addChild=Mm,this.ignoreAttributesFn=ym(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Sm,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?Bm(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Om(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const km=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function Am(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let r=Np(e,km),i=r.length,a={},o={};for(let e=0;e0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(o);for(let e=0;e`,a,`Closing Tag is not closed.`),i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=i.indexOf(`:`);e!==-1&&(i=i.substr(e+1))}i=Hm(this.options.transformTagName,i,``,this.options).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw Error(`Unpaired tag can not be used as closing tag: `);o&&this.options.unpairedTags.indexOf(o)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=Rm(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,this.readonlyMatcher),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new am(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(n,e,this.readonlyMatcher,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=Lm(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=i.readDocType(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=Lm(e,`]]>`,a,`CDATA is not closed.`)-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(i,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=t+2}else{let i=Rm(e,a,this.options.removeNSPrefix);if(!i){let t=e.substring(Math.max(0,a-50),Math.min(e.length,a+50));throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`)}let o=i.tagName,s=i.rawTagName,c=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;if({tagName:o,tagExp:c}=Hm(this.options.transformTagName,o,c,this.options),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw Error(`Invalid tag name: ${o}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let d=n;d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;c.length>0&&c.lastIndexOf(`/`)===c.length-1&&(f=!0,o[o.length-1]===`/`?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),l=o!==c);let p=null,m;m=wm(s),o!==t.tagname&&this.matcher.push(o,{},m),o!==c&&l&&(p=this.buildAttributesMap(c,this.matcher,o),p&&Cm(p,this.options)),o!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let h=a;if(this.isCurrentNodeStopNode){let t=``;if(f)a=i.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)a=i.closeIndex;else{let n=this.readStopNodeData(e,s,u+1);if(!n)throw Error(`Unexpected end of ${s}`);a=n.i,t=n.tagContent}let r=new am(o);p&&(r[`:@`]=p),r.add(this.options.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,h)}else{if(f){({tagName:o,tagExp:c}=Hm(this.options.transformTagName,o,c,this.options));let e=new am(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(o)!==-1){let e=new am(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=i.closeIndex;continue}else{let e=new am(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),n=e}r=``,a=u}}else r+=e[a];return t.child};function Mm(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Nm(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}for(let t of Object.keys(this.docTypeEntities)){let n=this.docTypeEntities[t],i=e.match(n.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let t=e.length;if(e=e.replace(n.regx,n.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>r.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}for(let t of Object.keys(this.lastEntities)){let n=this.lastEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}if(e.indexOf(`&`)===-1)return e;if(this.options.htmlEntities)for(let t of Object.keys(this.htmlEntities)){let n=this.htmlEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e}function Pm(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Fm(e,t){if(!e||e.length===0)return!1;for(let n=0;n`){let r,i=``;for(let a=t;a`){let i=Im(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function zm(e,t,n){let r=n,i=1;for(;n`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=Lm(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=Lm(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=Lm(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=Rm(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function Bm(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:pm(e,n)}else if(Fp(e))return e;else return``}function Vm(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}function Hm(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Um(t,r),{tagName:t,tagExp:n}}function Um(e,t){if(Lp.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ip.includes(e)?t.onDangerousProperty(e):e}const Wm=am.getMetaDataSymbol();function Gm(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function Km(e,t,n,r){return qm(e,t,n,r)}function qm(e,t,n,r){let i,a={};for(let o=0;o0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function Jm(e){let t=Object.keys(e);for(let e=0;e0&&(n=` +`);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;et.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=oh(n,t),n}return``}for(let s=0;s`,o=!1,r.pop();continue}else if(l===t.commentPropName){a+=n+``,o=!0,r.pop();continue}else if(l[0]===`?`){let e=ih(c[`:@`],t,d),i=l===`?xml`?``:n,s=c[l][0][t.textNodeName];s=s.length===0?``:` `+s,a+=i+`<${l}${s}${e}?>`,o=!0,r.pop();continue}let f=n;f!==``&&(f+=t.indentBy);let p=n+`<${l}${ih(c[`:@`],t,d)}`,m;m=d?th(c[l],t):$m(c[l],t,f,r,i),t.unpairedTags.indexOf(l)===-1?(!m||m.length===0)&&t.suppressEmptyNode?a+=p+`/>`:m&&m.endsWith(`>`)?a+=p+`>${m}${n}`:(a+=p+`>`,m&&n!==``&&(m.includes(`/>`)||m.includes(``):t.suppressUnpairedNode?a+=p+`>`:a+=p+`/>`,o=!0,r.pop()}return a}function eh(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=e[i],r=!0}return r?n:null}function th(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r`:n+=`<${a}${e}>${r}`}}return n}function nh(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function rh(e){let t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}const ch={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function lh(e){if(this.options=Object.assign({},ch,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e `,this.newLine=` -`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}uh.prototype.build=function(e){if(this.options.preserveOrder)return $m(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new Cm;return this.j2x(e,0,t).val}},uh.prototype.j2x=function(e,t,n){let r=``,i=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let a=this.options.jPath?n.toString():n,o=this.checkStopNode(n);for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+=``);else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+=``:s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,``,t,n);else if(typeof e[s]!=`object`){let c=this.isAttribute(s);if(c&&!this.ignoreAttributesFn(c,a))r+=this.buildAttrPairStr(c,``+e[s],o);else if(!c)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,``+e[s]);i+=this.replaceEntitiesValue(t)}else{n.push(s);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[s];n===``?i+=this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:i+=this.indentate(t)+`<`+s+`>`+n+``+e+`${e}`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);r===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${r}`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);e===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${e}`}else t+=`<${n}>${r}`}return t},uh.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}return t},uh.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=``+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},uh.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`0&&this.options.processEntities)for(let t=0;t${r.build(i)}`.replace(/\n/g,``)}async function bh(e,t={}){if(!e)throw Error(`Document is empty`);let n=hh.validate(e);if(n!==!0)throw n;let r=new Qm(vh(t)).parse(e);if(r[`?xml`]&&delete r[`?xml`],!t.includeRoot)for(let e of Object.keys(r)){let t=r[e];return typeof t==`object`?Object.assign({},t):t}return r}const xh=Du(`storage-blob`);var Sh=class extends w{buffers;byteLength;byteOffsetInCurrentBuffer;bufferIndex;pushedBytesLength;constructor(e,t,n){super(n),this.buffers=e,this.byteLength=t,this.byteOffsetInCurrentBuffer=0,this.bufferIndex=0,this.pushedBytesLength=0;let r=0;for(let e of this.buffers)r+=e.byteLength;if(r=this.byteLength&&this.push(null),e||=this.readableHighWaterMark;let t=[],n=0;for(;ne-n){let r=this.byteOffsetInCurrentBuffer+e-n;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,r)),this.pushedBytesLength+=e-n,this.byteOffsetInCurrentBuffer=r,n=e;break}else{let e=this.byteOffsetInCurrentBuffer+a;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,e)),a===i?(this.byteOffsetInCurrentBuffer=0,this.bufferIndex++):this.byteOffsetInCurrentBuffer=e,this.pushedBytesLength+=a,n+=a}}t.length>1?this.push(Buffer.concat(t)):t.length===1&&this.push(t[0])}};const Ch=E.constants.MAX_LENGTH;var wh=class{buffers=[];capacity;_size;get size(){return this._size}constructor(e,t,n){this.capacity=e,this._size=0;let r=Math.ceil(e/Ch);for(let t=0;t0&&(e[0]=e[0].slice(a))}getReadableStream(){return new Sh(this.buffers,this.size)}},Th=class{bufferSize;maxBuffers;readable;outgoingHandler;emitter=new y;concurrency;offset=0;isStreamEnd=!1;isError=!1;executingOutgoingHandlers=0;encoding;numBuffers=0;unresolvedDataArray=[];unresolvedLength=0;incoming=[];outgoing=[];constructor(e,t,n,r,i,a){if(t<=0)throw RangeError(`bufferSize must be larger than 0, current is ${t}`);if(n<=0)throw RangeError(`maxBuffers must be larger than 0, current is ${n}`);if(i<=0)throw RangeError(`concurrency must be larger than 0, current is ${i}`);this.bufferSize=t,this.maxBuffers=n,this.readable=e,this.outgoingHandler=r,this.concurrency=i,this.encoding=a}async do(){return new Promise((e,t)=>{this.readable.on(`data`,e=>{e=typeof e==`string`?Buffer.from(e,this.encoding):e,this.appendUnresolvedData(e),this.resolveData()||this.readable.pause()}),this.readable.on(`error`,e=>{this.emitter.emit(`error`,e)}),this.readable.on(`end`,()=>{this.isStreamEnd=!0,this.emitter.emit(`checkEnd`)}),this.emitter.on(`error`,e=>{this.isError=!0,this.readable.pause(),t(e)}),this.emitter.on(`checkEnd`,()=>{if(this.outgoing.length>0){this.triggerOutgoingHandlers();return}if(this.isStreamEnd&&this.executingOutgoingHandlers===0)if(this.unresolvedLength>0&&this.unresolvedLengthn.getReadableStream(),n.size,this.offset).then(e).catch(t)}else if(this.unresolvedLength>=this.bufferSize)return;else e()})})}appendUnresolvedData(e){this.unresolvedDataArray.push(e),this.unresolvedLength+=e.length}shiftBufferFromUnresolvedDataArray(e){return e?e.fill(this.unresolvedDataArray,this.unresolvedLength):e=new wh(this.bufferSize,this.unresolvedDataArray,this.unresolvedLength),this.unresolvedLength-=e.size,e}resolveData(){for(;this.unresolvedLength>=this.bufferSize;){let e;if(this.incoming.length>0)e=this.incoming.shift(),this.shiftBufferFromUnresolvedDataArray(e);else if(this.numBuffers=this.concurrency)return;e=this.outgoing.shift(),e&&this.triggerOutgoingHandler(e)}while(e)}async triggerOutgoingHandler(e){let t=e.size;this.executingOutgoingHandlers++,this.offset+=t;try{await this.outgoingHandler(()=>e.getReadableStream(),t,this.offset-t)}catch(e){this.emitter.emit(`error`,e);return}this.executingOutgoingHandlers--,this.reuseBuffer(e),this.emitter.emit(`checkEnd`)}reuseBuffer(e){this.incoming.push(e),!this.isError&&this.resolveData()&&!this.isStreamEnd&&this.readable.resume()}};let Eh;function Dh(){return Eh||=Cd(),Eh}var Oh=class{_nextPolicy;_options;constructor(e,t){this._nextPolicy=e,this._options=t}shouldLog(e){return this._options.shouldLog(e)}log(e,t){this._options.log(e,t)}};const kh={Parameters:{FORCE_BROWSER_NO_CACHE:`_`,SIGNATURE:`sig`,SNAPSHOT:`snapshot`,VERSIONID:`versionid`,TIMEOUT:`timeout`}},Ah={AUTHORIZATION:`Authorization`,AUTHORIZATION_SCHEME:`Bearer`,CONTENT_ENCODING:`Content-Encoding`,CONTENT_ID:`Content-ID`,CONTENT_LANGUAGE:`Content-Language`,CONTENT_LENGTH:`Content-Length`,CONTENT_MD5:`Content-Md5`,CONTENT_TRANSFER_ENCODING:`Content-Transfer-Encoding`,CONTENT_TYPE:`Content-Type`,COOKIE:`Cookie`,DATE:`date`,IF_MATCH:`if-match`,IF_MODIFIED_SINCE:`if-modified-since`,IF_NONE_MATCH:`if-none-match`,IF_UNMODIFIED_SINCE:`if-unmodified-since`,PREFIX_FOR_STORAGE:`x-ms-`,RANGE:`Range`,USER_AGENT:`User-Agent`,X_MS_CLIENT_REQUEST_ID:`x-ms-client-request-id`,X_MS_COPY_SOURCE:`x-ms-copy-source`,X_MS_DATE:`x-ms-date`,X_MS_ERROR_CODE:`x-ms-error-code`,X_MS_VERSION:`x-ms-version`,X_MS_CopySourceErrorCode:`x-ms-copy-source-error-code`};function jh(e,t,n){let r=new URL(e),i=encodeURIComponent(t),a=n?encodeURIComponent(n):void 0,o=r.search===``?`?`:r.search,s=[];for(let e of o.slice(1).split(`&`))if(e){let[t]=e.split(`=`,2);t!==i&&s.push(e)}return a&&s.push(`${i}=${a}`),r.search=s.length?`?${s.join(`&`)}`:``,r.toString()}function Mh(e,t){let n=new URL(e);return n.hostname=t,n.toString()}function Nh(e){try{return new URL(e).pathname}catch{return}}function Ph(e){let t=new URL(e).search;if(!t)return{};t=t.trim(),t=t.startsWith(`?`)?t.substring(1):t;let n=t.split(`&`);n=n.filter(e=>{let t=e.indexOf(`=`),n=e.lastIndexOf(`=`);return t>0&&t===n&&n{let a,o=()=>{a!==void 0&&clearTimeout(a),i(n)};a=setTimeout(()=>{t!==void 0&&t.removeEventListener(`abort`,o),r()},e),t!==void 0&&t.addEventListener(`abort`,o)})}var Ih=class extends Oh{constructor(e,t){super(e,t)}async sendRequest(e){return Gu?this._nextPolicy.sendRequest(e):((e.method.toUpperCase()===`GET`||e.method.toUpperCase()===`HEAD`)&&(e.url=jh(e.url,kh.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),e.headers.remove(Ah.COOKIE),e.headers.remove(Ah.CONTENT_LENGTH),this._nextPolicy.sendRequest(e))}},Lh=class{create(e,t){return new Ih(e,t)}},Rh=class extends Oh{sendRequest(e){return this._nextPolicy.sendRequest(this.signRequest(e))}signRequest(e){return e}},zh=class extends Rh{constructor(e,t){super(e,t)}},Bh=class{create(e,t){throw Error(`Method should be implemented in children classes.`)}},Vh=class extends Bh{create(e,t){return new zh(e,t)}};const Hh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1820,0,1823,1825,1827,1829,0,0,0,1837,2051,0,0,1843,0,3331,3354,3356,3358,3360,3362,3364,3366,3368,3370,0,0,0,0,0,0,0,3586,3593,3594,3610,3617,3619,3621,3628,3634,3637,3638,3656,3665,3696,3708,3710,3721,3722,3729,3737,3743,3746,3748,3750,3751,3753,0,0,0,1859,1860,1864,3586,3593,3594,3610,3617,3619,3621,3628,3634,3637,3638,3656,3665,3696,3708,3710,3721,3722,3729,3737,3743,3746,3748,3750,3751,3753,0,1868,0,1872,0]),Uh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Wh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32786,0,0,0,0,0,33298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Gh(e,t){return Kh(e,t)?-1:1}function Kh(e,t){let n=[Hh,Uh,Wh],r=0,i=0,a=0;for(;ra;let o=i0&&e.headers.set(Ah.CONTENT_LENGTH,Buffer.byteLength(e.body));let t=[e.method.toUpperCase(),this.getHeaderValueToSign(e,Ah.CONTENT_LANGUAGE),this.getHeaderValueToSign(e,Ah.CONTENT_ENCODING),this.getHeaderValueToSign(e,Ah.CONTENT_LENGTH),this.getHeaderValueToSign(e,Ah.CONTENT_MD5),this.getHeaderValueToSign(e,Ah.CONTENT_TYPE),this.getHeaderValueToSign(e,Ah.DATE),this.getHeaderValueToSign(e,Ah.IF_MODIFIED_SINCE),this.getHeaderValueToSign(e,Ah.IF_MATCH),this.getHeaderValueToSign(e,Ah.IF_NONE_MATCH),this.getHeaderValueToSign(e,Ah.IF_UNMODIFIED_SINCE),this.getHeaderValueToSign(e,Ah.RANGE)].join(` +`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}lh.prototype.build=function(e){if(this.options.preserveOrder)return Qm(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new Sm;return this.j2x(e,0,t).val}},lh.prototype.j2x=function(e,t,n){let r=``,i=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let a=this.options.jPath?n.toString():n,o=this.checkStopNode(n);for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+=``);else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+=``:s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,``,t,n);else if(typeof e[s]!=`object`){let c=this.isAttribute(s);if(c&&!this.ignoreAttributesFn(c,a))r+=this.buildAttrPairStr(c,``+e[s],o);else if(!c)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,``+e[s]);i+=this.replaceEntitiesValue(t)}else{n.push(s);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[s];n===``?i+=this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:i+=this.indentate(t)+`<`+s+`>`+n+``+e+`${e}`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);r===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${r}`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);e===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${e}`}else t+=`<${n}>${r}`}return t},lh.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}return t},lh.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=``+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},lh.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`0&&this.options.processEntities)for(let t=0;t${r.build(i)}`.replace(/\n/g,``)}async function yh(e,t={}){if(!e)throw Error(`Document is empty`);let n=mh.validate(e);if(n!==!0)throw n;let r=new Zm(_h(t)).parse(e);if(r[`?xml`]&&delete r[`?xml`],!t.includeRoot)for(let e of Object.keys(r)){let t=r[e];return typeof t==`object`?Object.assign({},t):t}return r}const bh=Eu(`storage-blob`);var xh=class extends w{buffers;byteLength;byteOffsetInCurrentBuffer;bufferIndex;pushedBytesLength;constructor(e,t,n){super(n),this.buffers=e,this.byteLength=t,this.byteOffsetInCurrentBuffer=0,this.bufferIndex=0,this.pushedBytesLength=0;let r=0;for(let e of this.buffers)r+=e.byteLength;if(r=this.byteLength&&this.push(null),e||=this.readableHighWaterMark;let t=[],n=0;for(;ne-n){let r=this.byteOffsetInCurrentBuffer+e-n;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,r)),this.pushedBytesLength+=e-n,this.byteOffsetInCurrentBuffer=r,n=e;break}else{let e=this.byteOffsetInCurrentBuffer+a;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,e)),a===i?(this.byteOffsetInCurrentBuffer=0,this.bufferIndex++):this.byteOffsetInCurrentBuffer=e,this.pushedBytesLength+=a,n+=a}}t.length>1?this.push(Buffer.concat(t)):t.length===1&&this.push(t[0])}};const Sh=E.constants.MAX_LENGTH;var Ch=class{buffers=[];capacity;_size;get size(){return this._size}constructor(e,t,n){this.capacity=e,this._size=0;let r=Math.ceil(e/Sh);for(let t=0;t0&&(e[0]=e[0].slice(a))}getReadableStream(){return new xh(this.buffers,this.size)}},wh=class{bufferSize;maxBuffers;readable;outgoingHandler;emitter=new y;concurrency;offset=0;isStreamEnd=!1;isError=!1;executingOutgoingHandlers=0;encoding;numBuffers=0;unresolvedDataArray=[];unresolvedLength=0;incoming=[];outgoing=[];constructor(e,t,n,r,i,a){if(t<=0)throw RangeError(`bufferSize must be larger than 0, current is ${t}`);if(n<=0)throw RangeError(`maxBuffers must be larger than 0, current is ${n}`);if(i<=0)throw RangeError(`concurrency must be larger than 0, current is ${i}`);this.bufferSize=t,this.maxBuffers=n,this.readable=e,this.outgoingHandler=r,this.concurrency=i,this.encoding=a}async do(){return new Promise((e,t)=>{this.readable.on(`data`,e=>{e=typeof e==`string`?Buffer.from(e,this.encoding):e,this.appendUnresolvedData(e),this.resolveData()||this.readable.pause()}),this.readable.on(`error`,e=>{this.emitter.emit(`error`,e)}),this.readable.on(`end`,()=>{this.isStreamEnd=!0,this.emitter.emit(`checkEnd`)}),this.emitter.on(`error`,e=>{this.isError=!0,this.readable.pause(),t(e)}),this.emitter.on(`checkEnd`,()=>{if(this.outgoing.length>0){this.triggerOutgoingHandlers();return}if(this.isStreamEnd&&this.executingOutgoingHandlers===0)if(this.unresolvedLength>0&&this.unresolvedLengthn.getReadableStream(),n.size,this.offset).then(e).catch(t)}else if(this.unresolvedLength>=this.bufferSize)return;else e()})})}appendUnresolvedData(e){this.unresolvedDataArray.push(e),this.unresolvedLength+=e.length}shiftBufferFromUnresolvedDataArray(e){return e?e.fill(this.unresolvedDataArray,this.unresolvedLength):e=new Ch(this.bufferSize,this.unresolvedDataArray,this.unresolvedLength),this.unresolvedLength-=e.size,e}resolveData(){for(;this.unresolvedLength>=this.bufferSize;){let e;if(this.incoming.length>0)e=this.incoming.shift(),this.shiftBufferFromUnresolvedDataArray(e);else if(this.numBuffers=this.concurrency)return;e=this.outgoing.shift(),e&&this.triggerOutgoingHandler(e)}while(e)}async triggerOutgoingHandler(e){let t=e.size;this.executingOutgoingHandlers++,this.offset+=t;try{await this.outgoingHandler(()=>e.getReadableStream(),t,this.offset-t)}catch(e){this.emitter.emit(`error`,e);return}this.executingOutgoingHandlers--,this.reuseBuffer(e),this.emitter.emit(`checkEnd`)}reuseBuffer(e){this.incoming.push(e),!this.isError&&this.resolveData()&&!this.isStreamEnd&&this.readable.resume()}};let Th;function Eh(){return Th||=Sd(),Th}var Dh=class{_nextPolicy;_options;constructor(e,t){this._nextPolicy=e,this._options=t}shouldLog(e){return this._options.shouldLog(e)}log(e,t){this._options.log(e,t)}};const Oh={Parameters:{FORCE_BROWSER_NO_CACHE:`_`,SIGNATURE:`sig`,SNAPSHOT:`snapshot`,VERSIONID:`versionid`,TIMEOUT:`timeout`}},kh={AUTHORIZATION:`Authorization`,AUTHORIZATION_SCHEME:`Bearer`,CONTENT_ENCODING:`Content-Encoding`,CONTENT_ID:`Content-ID`,CONTENT_LANGUAGE:`Content-Language`,CONTENT_LENGTH:`Content-Length`,CONTENT_MD5:`Content-Md5`,CONTENT_TRANSFER_ENCODING:`Content-Transfer-Encoding`,CONTENT_TYPE:`Content-Type`,COOKIE:`Cookie`,DATE:`date`,IF_MATCH:`if-match`,IF_MODIFIED_SINCE:`if-modified-since`,IF_NONE_MATCH:`if-none-match`,IF_UNMODIFIED_SINCE:`if-unmodified-since`,PREFIX_FOR_STORAGE:`x-ms-`,RANGE:`Range`,USER_AGENT:`User-Agent`,X_MS_CLIENT_REQUEST_ID:`x-ms-client-request-id`,X_MS_COPY_SOURCE:`x-ms-copy-source`,X_MS_DATE:`x-ms-date`,X_MS_ERROR_CODE:`x-ms-error-code`,X_MS_VERSION:`x-ms-version`,X_MS_CopySourceErrorCode:`x-ms-copy-source-error-code`};function Ah(e,t,n){let r=new URL(e),i=encodeURIComponent(t),a=n?encodeURIComponent(n):void 0,o=r.search===``?`?`:r.search,s=[];for(let e of o.slice(1).split(`&`))if(e){let[t]=e.split(`=`,2);t!==i&&s.push(e)}return a&&s.push(`${i}=${a}`),r.search=s.length?`?${s.join(`&`)}`:``,r.toString()}function jh(e,t){let n=new URL(e);return n.hostname=t,n.toString()}function Mh(e){try{return new URL(e).pathname}catch{return}}function Nh(e){let t=new URL(e).search;if(!t)return{};t=t.trim(),t=t.startsWith(`?`)?t.substring(1):t;let n=t.split(`&`);n=n.filter(e=>{let t=e.indexOf(`=`),n=e.lastIndexOf(`=`);return t>0&&t===n&&n{let a,o=()=>{a!==void 0&&clearTimeout(a),i(n)};a=setTimeout(()=>{t!==void 0&&t.removeEventListener(`abort`,o),r()},e),t!==void 0&&t.addEventListener(`abort`,o)})}var Fh=class extends Dh{constructor(e,t){super(e,t)}async sendRequest(e){return Wu?this._nextPolicy.sendRequest(e):((e.method.toUpperCase()===`GET`||e.method.toUpperCase()===`HEAD`)&&(e.url=Ah(e.url,Oh.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),e.headers.remove(kh.COOKIE),e.headers.remove(kh.CONTENT_LENGTH),this._nextPolicy.sendRequest(e))}},Ih=class{create(e,t){return new Fh(e,t)}},Lh=class extends Dh{sendRequest(e){return this._nextPolicy.sendRequest(this.signRequest(e))}signRequest(e){return e}},Rh=class extends Lh{constructor(e,t){super(e,t)}},zh=class{create(e,t){throw Error(`Method should be implemented in children classes.`)}},Bh=class extends zh{create(e,t){return new Rh(e,t)}};const Vh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1820,0,1823,1825,1827,1829,0,0,0,1837,2051,0,0,1843,0,3331,3354,3356,3358,3360,3362,3364,3366,3368,3370,0,0,0,0,0,0,0,3586,3593,3594,3610,3617,3619,3621,3628,3634,3637,3638,3656,3665,3696,3708,3710,3721,3722,3729,3737,3743,3746,3748,3750,3751,3753,0,0,0,1859,1860,1864,3586,3593,3594,3610,3617,3619,3621,3628,3634,3637,3638,3656,3665,3696,3708,3710,3721,3722,3729,3737,3743,3746,3748,3750,3751,3753,0,1868,0,1872,0]),Hh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Uh=new Uint32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32786,0,0,0,0,0,33298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Wh(e,t){return Gh(e,t)?-1:1}function Gh(e,t){let n=[Vh,Hh,Uh],r=0,i=0,a=0;for(;ra;let o=i0&&e.headers.set(kh.CONTENT_LENGTH,Buffer.byteLength(e.body));let t=[e.method.toUpperCase(),this.getHeaderValueToSign(e,kh.CONTENT_LANGUAGE),this.getHeaderValueToSign(e,kh.CONTENT_ENCODING),this.getHeaderValueToSign(e,kh.CONTENT_LENGTH),this.getHeaderValueToSign(e,kh.CONTENT_MD5),this.getHeaderValueToSign(e,kh.CONTENT_TYPE),this.getHeaderValueToSign(e,kh.DATE),this.getHeaderValueToSign(e,kh.IF_MODIFIED_SINCE),this.getHeaderValueToSign(e,kh.IF_MATCH),this.getHeaderValueToSign(e,kh.IF_NONE_MATCH),this.getHeaderValueToSign(e,kh.IF_UNMODIFIED_SINCE),this.getHeaderValueToSign(e,kh.RANGE)].join(` `)+` -`+this.getCanonicalizedHeadersString(e)+this.getCanonicalizedResourceString(e),n=this.factory.computeHMACSHA256(t);return e.headers.set(Ah.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${n}`),e}getHeaderValueToSign(e,t){let n=e.headers.get(t);return!n||t===Ah.CONTENT_LENGTH&&n===`0`?``:n}getCanonicalizedHeadersString(e){let t=e.headers.headersArray().filter(e=>e.name.toLowerCase().startsWith(Ah.PREFIX_FOR_STORAGE));t.sort((e,t)=>Gh(e.name.toLowerCase(),t.name.toLowerCase())),t=t.filter((e,t,n)=>!(t>0&&e.name.toLowerCase()===n[t-1].name.toLowerCase()));let n=``;return t.forEach(e=>{n+=`${e.name.toLowerCase().trimRight()}:${e.value.trimLeft()}\n`}),n}getCanonicalizedResourceString(e){let t=Nh(e.url)||`/`,n=``;n+=`/${this.factory.accountName}${t}`;let r=Ph(e.url),i={};if(r){let e=[];for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let n=t.toLowerCase();i[n]=r[t],e.push(n)}e.sort();for(let t of e)n+=`\n${t}:${decodeURIComponent(i[t])}`}return n}},Jh=class extends Bh{accountName;accountKey;constructor(e,t){super(),this.accountName=e,this.accountKey=Buffer.from(t,`base64`)}create(e,t){return new qh(e,t,this)}computeHMACSHA256(e){return A(`sha256`,this.accountKey).update(e,`utf8`).digest(`base64`)}};const Yh=Du(`storage-common`);var Xh;(function(e){e[e.EXPONENTIAL=0]=`EXPONENTIAL`,e[e.FIXED=1]=`FIXED`})(Xh||={});const Zh={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Xh.EXPONENTIAL,secondaryHost:``,tryTimeoutInMs:void 0},Qh=new zu(`The operation was aborted.`);var $h=class extends Oh{retryOptions;constructor(e,t,n=Zh){super(e,t),this.retryOptions={retryPolicyType:n.retryPolicyType?n.retryPolicyType:Zh.retryPolicyType,maxTries:n.maxTries&&n.maxTries>=1?Math.floor(n.maxTries):Zh.maxTries,tryTimeoutInMs:n.tryTimeoutInMs&&n.tryTimeoutInMs>=0?n.tryTimeoutInMs:Zh.tryTimeoutInMs,retryDelayInMs:n.retryDelayInMs&&n.retryDelayInMs>=0?Math.min(n.retryDelayInMs,n.maxRetryDelayInMs?n.maxRetryDelayInMs:Zh.maxRetryDelayInMs):Zh.retryDelayInMs,maxRetryDelayInMs:n.maxRetryDelayInMs&&n.maxRetryDelayInMs>=0?n.maxRetryDelayInMs:Zh.maxRetryDelayInMs,secondaryHost:n.secondaryHost?n.secondaryHost:Zh.secondaryHost}}async sendRequest(e){return this.attemptSendRequest(e,!1,1)}async attemptSendRequest(e,t,n){let r=e.clone(),i=t||!this.retryOptions.secondaryHost||!(e.method===`GET`||e.method===`HEAD`||e.method===`OPTIONS`)||n%2==1;i||(r.url=Mh(r.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(r.url=jh(r.url,kh.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString()));let a;try{if(Yh.info(`RetryPolicy: =====> Try=${n} ${i?`Primary`:`Secondary`}`),a=await this._nextPolicy.sendRequest(r),!this.shouldRetry(i,n,a))return a;t||=!i&&a.status===404}catch(e){if(Yh.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`),!this.shouldRetry(i,n,a,e))throw e}return await this.delay(i,n,e.abortSignal),this.attemptSendRequest(e,t,++n)}shouldRetry(e,t,n,r){if(t>=this.retryOptions.maxTries)return Yh.info(`RetryPolicy: Attempt(s) ${t} >= maxTries ${this.retryOptions.maxTries}, no further try.`),!1;let i=[`ETIMEDOUT`,`ESOCKETTIMEDOUT`,`ECONNREFUSED`,`ECONNRESET`,`ENOENT`,`ENOTFOUND`,`TIMEOUT`,`EPIPE`,`REQUEST_SEND_ERROR`];if(r){for(let e of i)if(r.name.toUpperCase().includes(e)||r.message.toUpperCase().includes(e)||r.code&&r.code.toString().toUpperCase()===e)return Yh.info(`RetryPolicy: Network error ${e} found, will retry.`),!0}if(n||r){let t=n?n.status:r?r.statusCode:0;if(!e&&t===404)return Yh.info(`RetryPolicy: Secondary access with 404, will retry.`),!0;if(t===503||t===500)return Yh.info(`RetryPolicy: Will retry for status code ${t}.`),!0}if(n&&n?.status>=400){let e=n.headers.get(Ah.X_MS_CopySourceErrorCode);if(e!==void 0)switch(e){case`InternalError`:case`OperationTimedOut`:case`ServerBusy`:return!0}}return r?.code===`PARSE_ERROR`&&r?.message.startsWith(`Error "Error: Unclosed root tag`)?(Yh.info(`RetryPolicy: Incomplete XML response likely due to service timeout, will retry.`),!0):!1}async delay(e,t,n){let r=0;if(e)switch(this.retryOptions.retryPolicyType){case Xh.EXPONENTIAL:r=Math.min((2**(t-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case Xh.FIXED:r=this.retryOptions.retryDelayInMs;break}else r=Math.random()*1e3;return Yh.info(`RetryPolicy: Delay for ${r}ms`),Fh(r,n,Qh)}},eg=class{retryOptions;constructor(e){this.retryOptions=e}create(e,t){return new $h(e,t,this.retryOptions)}};function tg(){return{name:`storageBrowserPolicy`,async sendRequest(e,t){return Gu?t(e):((e.method===`GET`||e.method===`HEAD`)&&(e.url=jh(e.url,kh.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),e.headers.delete(Ah.COOKIE),e.headers.delete(Ah.CONTENT_LENGTH),t(e))}}}function ng(){function e(e){e.body&&(typeof e.body==`string`||Buffer.isBuffer(e.body))&&e.body.length>0&&e.headers.set(Ah.CONTENT_LENGTH,Buffer.byteLength(e.body))}return{name:`StorageCorrectContentLengthPolicy`,async sendRequest(t,n){return e(t),n(t)}}}const rg={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Xh.EXPONENTIAL,secondaryHost:``,tryTimeoutInMs:void 0},ig=[`ETIMEDOUT`,`ESOCKETTIMEDOUT`,`ECONNREFUSED`,`ECONNRESET`,`ENOENT`,`ENOTFOUND`,`TIMEOUT`,`EPIPE`,`REQUEST_SEND_ERROR`],ag=new zu(`The operation was aborted.`);function og(e={}){let t=e.retryPolicyType??rg.retryPolicyType,n=e.maxTries??rg.maxTries,r=e.retryDelayInMs??rg.retryDelayInMs,i=e.maxRetryDelayInMs??rg.maxRetryDelayInMs,a=e.secondaryHost??rg.secondaryHost,o=e.tryTimeoutInMs??rg.tryTimeoutInMs;function s({isPrimaryRetry:e,attempt:t,response:r,error:i}){if(t>=n)return Yh.info(`RetryPolicy: Attempt(s) ${t} >= maxTries ${n}, no further try.`),!1;if(i){for(let e of ig)if(i.name.toUpperCase().includes(e)||i.message.toUpperCase().includes(e)||i.code&&i.code.toString().toUpperCase()===e)return Yh.info(`RetryPolicy: Network error ${e} found, will retry.`),!0;if(i?.code===`PARSE_ERROR`&&i?.message.startsWith(`Error "Error: Unclosed root tag`))return Yh.info(`RetryPolicy: Incomplete XML response likely due to service timeout, will retry.`),!0}if(r||i){let t=r?.status??i?.statusCode??0;if(!e&&t===404)return Yh.info(`RetryPolicy: Secondary access with 404, will retry.`),!0;if(t===503||t===500)return Yh.info(`RetryPolicy: Will retry for status code ${t}.`),!0}if(r&&r?.status>=400){let e=r.headers.get(Ah.X_MS_CopySourceErrorCode);if(e!==void 0)switch(e){case`InternalError`:case`OperationTimedOut`:case`ServerBusy`:return!0}}return!1}function c(e,n){let a=0;if(e)switch(t){case Xh.EXPONENTIAL:a=Math.min((2**(n-1)-1)*r,i);break;case Xh.FIXED:a=r;break}else a=Math.random()*1e3;return Yh.info(`RetryPolicy: Delay for ${a}ms`),a}return{name:`storageRetryPolicy`,async sendRequest(e,t){o&&(e.url=jh(e.url,kh.Parameters.TIMEOUT,String(Math.floor(o/1e3))));let n=e.url,r=a?Mh(e.url,a):void 0,i=!1,l=1,u=!0,d,f;for(;u;){let a=i||!r||![`GET`,`HEAD`,`OPTIONS`].includes(e.method)||l%2==1;e.url=a?n:r,d=void 0,f=void 0;try{Yh.info(`RetryPolicy: =====> Try=${l} ${a?`Primary`:`Secondary`}`),d=await t(e),i||=!a&&d.status===404}catch(e){if(md(e))Yh.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`),f=e;else throw Yh.error(`RetryPolicy: Caught error, message: ${Hu(e)}`),e}u=s({isPrimaryRetry:a,attempt:l,response:d,error:f}),u&&await Fh(c(a,l),e.abortSignal,ag),l++}if(d)return d;throw f??new pd(`RetryPolicy failed without known error.`)}}}function sg(e){function t(t){t.headers.set(Ah.X_MS_DATE,new Date().toUTCString()),t.body&&(typeof t.body==`string`||Buffer.isBuffer(t.body))&&t.body.length>0&&t.headers.set(Ah.CONTENT_LENGTH,Buffer.byteLength(t.body));let a=[t.method.toUpperCase(),n(t,Ah.CONTENT_LANGUAGE),n(t,Ah.CONTENT_ENCODING),n(t,Ah.CONTENT_LENGTH),n(t,Ah.CONTENT_MD5),n(t,Ah.CONTENT_TYPE),n(t,Ah.DATE),n(t,Ah.IF_MODIFIED_SINCE),n(t,Ah.IF_MATCH),n(t,Ah.IF_NONE_MATCH),n(t,Ah.IF_UNMODIFIED_SINCE),n(t,Ah.RANGE)].join(` +`+this.getCanonicalizedHeadersString(e)+this.getCanonicalizedResourceString(e),n=this.factory.computeHMACSHA256(t);return e.headers.set(kh.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${n}`),e}getHeaderValueToSign(e,t){let n=e.headers.get(t);return!n||t===kh.CONTENT_LENGTH&&n===`0`?``:n}getCanonicalizedHeadersString(e){let t=e.headers.headersArray().filter(e=>e.name.toLowerCase().startsWith(kh.PREFIX_FOR_STORAGE));t.sort((e,t)=>Wh(e.name.toLowerCase(),t.name.toLowerCase())),t=t.filter((e,t,n)=>!(t>0&&e.name.toLowerCase()===n[t-1].name.toLowerCase()));let n=``;return t.forEach(e=>{n+=`${e.name.toLowerCase().trimRight()}:${e.value.trimLeft()}\n`}),n}getCanonicalizedResourceString(e){let t=Mh(e.url)||`/`,n=``;n+=`/${this.factory.accountName}${t}`;let r=Nh(e.url),i={};if(r){let e=[];for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let n=t.toLowerCase();i[n]=r[t],e.push(n)}e.sort();for(let t of e)n+=`\n${t}:${decodeURIComponent(i[t])}`}return n}},qh=class extends zh{accountName;accountKey;constructor(e,t){super(),this.accountName=e,this.accountKey=Buffer.from(t,`base64`)}create(e,t){return new Kh(e,t,this)}computeHMACSHA256(e){return A(`sha256`,this.accountKey).update(e,`utf8`).digest(`base64`)}};const Jh=Eu(`storage-common`);var Yh;(function(e){e[e.EXPONENTIAL=0]=`EXPONENTIAL`,e[e.FIXED=1]=`FIXED`})(Yh||={});const Xh={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Yh.EXPONENTIAL,secondaryHost:``,tryTimeoutInMs:void 0},Zh=new Ru(`The operation was aborted.`);var Qh=class extends Dh{retryOptions;constructor(e,t,n=Xh){super(e,t),this.retryOptions={retryPolicyType:n.retryPolicyType?n.retryPolicyType:Xh.retryPolicyType,maxTries:n.maxTries&&n.maxTries>=1?Math.floor(n.maxTries):Xh.maxTries,tryTimeoutInMs:n.tryTimeoutInMs&&n.tryTimeoutInMs>=0?n.tryTimeoutInMs:Xh.tryTimeoutInMs,retryDelayInMs:n.retryDelayInMs&&n.retryDelayInMs>=0?Math.min(n.retryDelayInMs,n.maxRetryDelayInMs?n.maxRetryDelayInMs:Xh.maxRetryDelayInMs):Xh.retryDelayInMs,maxRetryDelayInMs:n.maxRetryDelayInMs&&n.maxRetryDelayInMs>=0?n.maxRetryDelayInMs:Xh.maxRetryDelayInMs,secondaryHost:n.secondaryHost?n.secondaryHost:Xh.secondaryHost}}async sendRequest(e){return this.attemptSendRequest(e,!1,1)}async attemptSendRequest(e,t,n){let r=e.clone(),i=t||!this.retryOptions.secondaryHost||!(e.method===`GET`||e.method===`HEAD`||e.method===`OPTIONS`)||n%2==1;i||(r.url=jh(r.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(r.url=Ah(r.url,Oh.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString()));let a;try{if(Jh.info(`RetryPolicy: =====> Try=${n} ${i?`Primary`:`Secondary`}`),a=await this._nextPolicy.sendRequest(r),!this.shouldRetry(i,n,a))return a;t||=!i&&a.status===404}catch(e){if(Jh.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`),!this.shouldRetry(i,n,a,e))throw e}return await this.delay(i,n,e.abortSignal),this.attemptSendRequest(e,t,++n)}shouldRetry(e,t,n,r){if(t>=this.retryOptions.maxTries)return Jh.info(`RetryPolicy: Attempt(s) ${t} >= maxTries ${this.retryOptions.maxTries}, no further try.`),!1;let i=[`ETIMEDOUT`,`ESOCKETTIMEDOUT`,`ECONNREFUSED`,`ECONNRESET`,`ENOENT`,`ENOTFOUND`,`TIMEOUT`,`EPIPE`,`REQUEST_SEND_ERROR`];if(r){for(let e of i)if(r.name.toUpperCase().includes(e)||r.message.toUpperCase().includes(e)||r.code&&r.code.toString().toUpperCase()===e)return Jh.info(`RetryPolicy: Network error ${e} found, will retry.`),!0}if(n||r){let t=n?n.status:r?r.statusCode:0;if(!e&&t===404)return Jh.info(`RetryPolicy: Secondary access with 404, will retry.`),!0;if(t===503||t===500)return Jh.info(`RetryPolicy: Will retry for status code ${t}.`),!0}if(n&&n?.status>=400){let e=n.headers.get(kh.X_MS_CopySourceErrorCode);if(e!==void 0)switch(e){case`InternalError`:case`OperationTimedOut`:case`ServerBusy`:return!0}}return r?.code===`PARSE_ERROR`&&r?.message.startsWith(`Error "Error: Unclosed root tag`)?(Jh.info(`RetryPolicy: Incomplete XML response likely due to service timeout, will retry.`),!0):!1}async delay(e,t,n){let r=0;if(e)switch(this.retryOptions.retryPolicyType){case Yh.EXPONENTIAL:r=Math.min((2**(t-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case Yh.FIXED:r=this.retryOptions.retryDelayInMs;break}else r=Math.random()*1e3;return Jh.info(`RetryPolicy: Delay for ${r}ms`),Ph(r,n,Zh)}},$h=class{retryOptions;constructor(e){this.retryOptions=e}create(e,t){return new Qh(e,t,this.retryOptions)}};function eg(){return{name:`storageBrowserPolicy`,async sendRequest(e,t){return Wu?t(e):((e.method===`GET`||e.method===`HEAD`)&&(e.url=Ah(e.url,Oh.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),e.headers.delete(kh.COOKIE),e.headers.delete(kh.CONTENT_LENGTH),t(e))}}}function tg(){function e(e){e.body&&(typeof e.body==`string`||Buffer.isBuffer(e.body))&&e.body.length>0&&e.headers.set(kh.CONTENT_LENGTH,Buffer.byteLength(e.body))}return{name:`StorageCorrectContentLengthPolicy`,async sendRequest(t,n){return e(t),n(t)}}}const ng={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Yh.EXPONENTIAL,secondaryHost:``,tryTimeoutInMs:void 0},rg=[`ETIMEDOUT`,`ESOCKETTIMEDOUT`,`ECONNREFUSED`,`ECONNRESET`,`ENOENT`,`ENOTFOUND`,`TIMEOUT`,`EPIPE`,`REQUEST_SEND_ERROR`],ig=new Ru(`The operation was aborted.`);function ag(e={}){let t=e.retryPolicyType??ng.retryPolicyType,n=e.maxTries??ng.maxTries,r=e.retryDelayInMs??ng.retryDelayInMs,i=e.maxRetryDelayInMs??ng.maxRetryDelayInMs,a=e.secondaryHost??ng.secondaryHost,o=e.tryTimeoutInMs??ng.tryTimeoutInMs;function s({isPrimaryRetry:e,attempt:t,response:r,error:i}){if(t>=n)return Jh.info(`RetryPolicy: Attempt(s) ${t} >= maxTries ${n}, no further try.`),!1;if(i){for(let e of rg)if(i.name.toUpperCase().includes(e)||i.message.toUpperCase().includes(e)||i.code&&i.code.toString().toUpperCase()===e)return Jh.info(`RetryPolicy: Network error ${e} found, will retry.`),!0;if(i?.code===`PARSE_ERROR`&&i?.message.startsWith(`Error "Error: Unclosed root tag`))return Jh.info(`RetryPolicy: Incomplete XML response likely due to service timeout, will retry.`),!0}if(r||i){let t=r?.status??i?.statusCode??0;if(!e&&t===404)return Jh.info(`RetryPolicy: Secondary access with 404, will retry.`),!0;if(t===503||t===500)return Jh.info(`RetryPolicy: Will retry for status code ${t}.`),!0}if(r&&r?.status>=400){let e=r.headers.get(kh.X_MS_CopySourceErrorCode);if(e!==void 0)switch(e){case`InternalError`:case`OperationTimedOut`:case`ServerBusy`:return!0}}return!1}function c(e,n){let a=0;if(e)switch(t){case Yh.EXPONENTIAL:a=Math.min((2**(n-1)-1)*r,i);break;case Yh.FIXED:a=r;break}else a=Math.random()*1e3;return Jh.info(`RetryPolicy: Delay for ${a}ms`),a}return{name:`storageRetryPolicy`,async sendRequest(e,t){o&&(e.url=Ah(e.url,Oh.Parameters.TIMEOUT,String(Math.floor(o/1e3))));let n=e.url,r=a?jh(e.url,a):void 0,i=!1,l=1,u=!0,d,f;for(;u;){let a=i||!r||![`GET`,`HEAD`,`OPTIONS`].includes(e.method)||l%2==1;e.url=a?n:r,d=void 0,f=void 0;try{Jh.info(`RetryPolicy: =====> Try=${l} ${a?`Primary`:`Secondary`}`),d=await t(e),i||=!a&&d.status===404}catch(e){if(pd(e))Jh.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`),f=e;else throw Jh.error(`RetryPolicy: Caught error, message: ${Vu(e)}`),e}u=s({isPrimaryRetry:a,attempt:l,response:d,error:f}),u&&await Ph(c(a,l),e.abortSignal,ig),l++}if(d)return d;throw f??new fd(`RetryPolicy failed without known error.`)}}}function og(e){function t(t){t.headers.set(kh.X_MS_DATE,new Date().toUTCString()),t.body&&(typeof t.body==`string`||Buffer.isBuffer(t.body))&&t.body.length>0&&t.headers.set(kh.CONTENT_LENGTH,Buffer.byteLength(t.body));let a=[t.method.toUpperCase(),n(t,kh.CONTENT_LANGUAGE),n(t,kh.CONTENT_ENCODING),n(t,kh.CONTENT_LENGTH),n(t,kh.CONTENT_MD5),n(t,kh.CONTENT_TYPE),n(t,kh.DATE),n(t,kh.IF_MODIFIED_SINCE),n(t,kh.IF_MATCH),n(t,kh.IF_NONE_MATCH),n(t,kh.IF_UNMODIFIED_SINCE),n(t,kh.RANGE)].join(` `)+` -`+r(t)+i(t),o=A(`sha256`,e.accountKey).update(a,`utf8`).digest(`base64`);t.headers.set(Ah.AUTHORIZATION,`SharedKey ${e.accountName}:${o}`)}function n(e,t){let n=e.headers.get(t);return!n||t===Ah.CONTENT_LENGTH&&n===`0`?``:n}function r(e){let t=[];for(let[n,r]of e.headers)n.toLowerCase().startsWith(Ah.PREFIX_FOR_STORAGE)&&t.push({name:n,value:r});t.sort((e,t)=>Gh(e.name.toLowerCase(),t.name.toLowerCase())),t=t.filter((e,t,n)=>!(t>0&&e.name.toLowerCase()===n[t-1].name.toLowerCase()));let n=``;return t.forEach(e=>{n+=`${e.name.toLowerCase().trimRight()}:${e.value.trimLeft()}\n`}),n}function i(t){let n=Nh(t.url)||`/`,r=``;r+=`/${e.accountName}${n}`;let i=Ph(t.url),a={};if(i){let e=[];for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let n=t.toLowerCase();a[n]=i[t],e.push(n)}e.sort();for(let t of e)r+=`\n${t}:${decodeURIComponent(a[t])}`}return r}return{name:`storageSharedKeyCredentialPolicy`,async sendRequest(e,n){return t(e),n(e)}}}function cg(){return{name:`storageRequestFailureDetailsParserPolicy`,async sendRequest(e,t){try{return await t(e)}catch(e){throw typeof e==`object`&&e&&e.response&&e.response.parsedBody&&e.response.parsedBody.code===`InvalidHeaderValue`&&e.response.parsedBody.HeaderName===`x-ms-version`&&(e.message=`The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information. -`),e}}}}var lg=class{accountName;userDelegationKey;key;constructor(e,t){this.accountName=e,this.userDelegationKey=t,this.key=Buffer.from(t.value,`base64`)}computeHMACSHA256(e){return A(`sha256`,this.key).update(e,`utf8`).digest(`base64`)}};const ug=`12.31.0`,dg=`2026-02-06`,fg=5e4,pg=4*1024*1024,mg={Parameters:{FORCE_BROWSER_NO_CACHE:`_`,SIGNATURE:`sig`,SNAPSHOT:`snapshot`,VERSIONID:`versionid`,TIMEOUT:`timeout`}},hg=`Access-Control-Allow-Origin.Cache-Control.Content-Length.Content-Type.Date.Request-Id.traceparent.Transfer-Encoding.User-Agent.x-ms-client-request-id.x-ms-date.x-ms-error-code.x-ms-request-id.x-ms-return-client-request-id.x-ms-version.Accept-Ranges.Content-Disposition.Content-Encoding.Content-Language.Content-MD5.Content-Range.ETag.Last-Modified.Server.Vary.x-ms-content-crc64.x-ms-copy-action.x-ms-copy-completion-time.x-ms-copy-id.x-ms-copy-progress.x-ms-copy-status.x-ms-has-immutability-policy.x-ms-has-legal-hold.x-ms-lease-state.x-ms-lease-status.x-ms-range.x-ms-request-server-encrypted.x-ms-server-encrypted.x-ms-snapshot.x-ms-source-range.If-Match.If-Modified-Since.If-None-Match.If-Unmodified-Since.x-ms-access-tier.x-ms-access-tier-change-time.x-ms-access-tier-inferred.x-ms-account-kind.x-ms-archive-status.x-ms-blob-append-offset.x-ms-blob-cache-control.x-ms-blob-committed-block-count.x-ms-blob-condition-appendpos.x-ms-blob-condition-maxsize.x-ms-blob-content-disposition.x-ms-blob-content-encoding.x-ms-blob-content-language.x-ms-blob-content-length.x-ms-blob-content-md5.x-ms-blob-content-type.x-ms-blob-public-access.x-ms-blob-sequence-number.x-ms-blob-type.x-ms-copy-destination-snapshot.x-ms-creation-time.x-ms-default-encryption-scope.x-ms-delete-snapshots.x-ms-delete-type-permanent.x-ms-deny-encryption-scope-override.x-ms-encryption-algorithm.x-ms-if-sequence-number-eq.x-ms-if-sequence-number-le.x-ms-if-sequence-number-lt.x-ms-incremental-copy.x-ms-lease-action.x-ms-lease-break-period.x-ms-lease-duration.x-ms-lease-id.x-ms-lease-time.x-ms-page-write.x-ms-proposed-lease-id.x-ms-range-get-content-md5.x-ms-rehydrate-priority.x-ms-sequence-number-action.x-ms-sku-name.x-ms-source-content-md5.x-ms-source-if-match.x-ms-source-if-modified-since.x-ms-source-if-none-match.x-ms-source-if-unmodified-since.x-ms-tag-count.x-ms-encryption-key-sha256.x-ms-copy-source-error-code.x-ms-copy-source-status-code.x-ms-if-tags.x-ms-source-if-tags`.split(`.`),gg=`comp.maxresults.rscc.rscd.rsce.rscl.rsct.se.si.sip.sp.spr.sr.srt.ss.st.sv.include.marker.prefix.copyid.restype.blockid.blocklisttype.delimiter.prevsnapshot.ske.skoid.sks.skt.sktid.skv.snapshot`.split(`.`),_g=[`10000`,`10001`,`10002`,`10003`,`10004`,`10100`,`10101`,`10102`,`10103`,`10104`,`11000`,`11001`,`11002`,`11003`,`11004`,`11100`,`11101`,`11102`,`11103`,`11104`];function vg(e){if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.factories)&&typeof t.options==`object`&&typeof t.toServiceClientOptions==`function`}var yg=class{factories;options;constructor(e,t={}){this.factories=e,this.options=t}toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}}};function bg(e,t={}){e||=new Vh;let n=new yg([],t);return n._credential=e,n}function xg(e){let t=[Tg,wg,Eg,Dg,Og,kg,jg];if(e.factories.length){let n=e.factories.filter(e=>!t.some(t=>t(e)));if(n.length){let e=n.some(e=>Ag(e));return{wrappedPolicies:Ap(n),afterRetry:e}}}}function Sg(e){let{httpClient:t,...n}=e.options,r=e._coreHttpClient;r||(r=t?jp(t):Dh(),e._coreHttpClient=r);let i=e._corePipeline;if(!i){let t=`azsdk-js-azure-storage-blob/${ug}`,r=n.userAgentOptions&&n.userAgentOptions.userAgentPrefix?`${n.userAgentOptions.userAgentPrefix} ${t}`:`${t}`;i=qf({...n,loggingOptions:{additionalAllowedHeaderNames:hg,additionalAllowedQueryParameters:gg,logger:xh.info},userAgentOptions:{userAgentPrefix:r},serializationOptions:{stringifyXML:yh,serializerOptions:{xml:{xmlCharKey:`#`}}},deserializationOptions:{parseXML:bh,serializerOptions:{xml:{xmlCharKey:`#`}}}}),i.removePolicy({phase:`Retry`}),i.removePolicy({name:`decompressResponsePolicy`}),i.addPolicy(ng()),i.addPolicy(og(n.retryOptions),{phase:`Retry`}),i.addPolicy(cg()),i.addPolicy(tg());let a=xg(e);a&&i.addPolicy(a.wrappedPolicies,a.afterRetry?{afterPhase:`Retry`}:void 0);let o=Cg(e);Id(o)?i.addPolicy(Nd({credential:o,scopes:n.audience??`https://storage.azure.com/.default`,challengeCallbacks:{authorizeRequestOnChallenge:dp}}),{phase:`Sign`}):o instanceof Jh&&i.addPolicy(sg({accountName:o.accountName,accountKey:o.accountKey}),{phase:`Sign`}),e._corePipeline=i}return{...n,allowInsecureConnection:!0,httpClient:r,pipeline:i}}function Cg(e){if(e._credential)return e._credential;let t=new Vh;for(let n of e.factories)if(Id(n.credential))t=n.credential;else if(wg(n))return n;return t}function wg(e){return e instanceof Jh?!0:e.constructor.name===`StorageSharedKeyCredential`}function Tg(e){return e instanceof Vh?!0:e.constructor.name===`AnonymousCredential`}function Eg(e){return Id(e.credential)}function Dg(e){return e instanceof Lh?!0:e.constructor.name===`StorageBrowserPolicyFactory`}function Og(e){return e instanceof eg?!0:e.constructor.name===`StorageRetryPolicyFactory`}function kg(e){return e.constructor.name===`TelemetryPolicyFactory`}function Ag(e){return e.constructor.name===`InjectorPolicyFactory`}function jg(e){let t=[`GenerateClientRequestIdPolicy`,`TracingPolicy`,`LogPolicy`,`ProxyPolicy`,`DisableResponseDecompressionPolicy`,`KeepAlivePolicy`,`DeserializationPolicy`],n=e.create({sendRequest:async e=>({request:e,headers:e.headers.clone(),status:500})},{log(e,t){},shouldLog(e){return!1}}).constructor.name;return t.some(e=>n.startsWith(e))}var Mg=de({AccessPolicy:()=>Zg,AppendBlobAppendBlockExceptionHeaders:()=>My,AppendBlobAppendBlockFromUrlExceptionHeaders:()=>Py,AppendBlobAppendBlockFromUrlHeaders:()=>Ny,AppendBlobAppendBlockHeaders:()=>jy,AppendBlobCreateExceptionHeaders:()=>Ay,AppendBlobCreateHeaders:()=>ky,AppendBlobSealExceptionHeaders:()=>Iy,AppendBlobSealHeaders:()=>Fy,ArrowConfiguration:()=>__,ArrowField:()=>v_,BlobAbortCopyFromURLExceptionHeaders:()=>ey,BlobAbortCopyFromURLHeaders:()=>$v,BlobAcquireLeaseExceptionHeaders:()=>Rv,BlobAcquireLeaseHeaders:()=>Lv,BlobBreakLeaseExceptionHeaders:()=>Kv,BlobBreakLeaseHeaders:()=>Gv,BlobChangeLeaseExceptionHeaders:()=>Wv,BlobChangeLeaseHeaders:()=>Uv,BlobCopyFromURLExceptionHeaders:()=>Qv,BlobCopyFromURLHeaders:()=>Zv,BlobCreateSnapshotExceptionHeaders:()=>Jv,BlobCreateSnapshotHeaders:()=>qv,BlobDeleteExceptionHeaders:()=>Sv,BlobDeleteHeaders:()=>xv,BlobDeleteImmutabilityPolicyExceptionHeaders:()=>Mv,BlobDeleteImmutabilityPolicyHeaders:()=>jv,BlobDownloadExceptionHeaders:()=>vv,BlobDownloadHeaders:()=>_v,BlobFlatListSegment:()=>$g,BlobGetAccountInfoExceptionHeaders:()=>iy,BlobGetAccountInfoHeaders:()=>ry,BlobGetPropertiesExceptionHeaders:()=>bv,BlobGetPropertiesHeaders:()=>yv,BlobGetTagsExceptionHeaders:()=>cy,BlobGetTagsHeaders:()=>sy,BlobHierarchyListSegment:()=>i_,BlobItemInternal:()=>e_,BlobName:()=>t_,BlobPrefix:()=>a_,BlobPropertiesInternal:()=>n_,BlobQueryExceptionHeaders:()=>oy,BlobQueryHeaders:()=>ay,BlobReleaseLeaseExceptionHeaders:()=>Bv,BlobReleaseLeaseHeaders:()=>zv,BlobRenewLeaseExceptionHeaders:()=>Hv,BlobRenewLeaseHeaders:()=>Vv,BlobServiceProperties:()=>Ng,BlobServiceStatistics:()=>zg,BlobSetExpiryExceptionHeaders:()=>Ev,BlobSetExpiryHeaders:()=>Tv,BlobSetHttpHeadersExceptionHeaders:()=>Ov,BlobSetHttpHeadersHeaders:()=>Dv,BlobSetImmutabilityPolicyExceptionHeaders:()=>Av,BlobSetImmutabilityPolicyHeaders:()=>kv,BlobSetLegalHoldExceptionHeaders:()=>Pv,BlobSetLegalHoldHeaders:()=>Nv,BlobSetMetadataExceptionHeaders:()=>Iv,BlobSetMetadataHeaders:()=>Fv,BlobSetTagsExceptionHeaders:()=>uy,BlobSetTagsHeaders:()=>ly,BlobSetTierExceptionHeaders:()=>ny,BlobSetTierHeaders:()=>ty,BlobStartCopyFromURLExceptionHeaders:()=>Xv,BlobStartCopyFromURLHeaders:()=>Yv,BlobTag:()=>Yg,BlobTags:()=>Jg,BlobUndeleteExceptionHeaders:()=>wv,BlobUndeleteHeaders:()=>Cv,Block:()=>c_,BlockBlobCommitBlockListExceptionHeaders:()=>Ky,BlockBlobCommitBlockListHeaders:()=>Gy,BlockBlobGetBlockListExceptionHeaders:()=>Jy,BlockBlobGetBlockListHeaders:()=>qy,BlockBlobPutBlobFromUrlExceptionHeaders:()=>By,BlockBlobPutBlobFromUrlHeaders:()=>zy,BlockBlobStageBlockExceptionHeaders:()=>Hy,BlockBlobStageBlockFromURLExceptionHeaders:()=>Wy,BlockBlobStageBlockFromURLHeaders:()=>Uy,BlockBlobStageBlockHeaders:()=>Vy,BlockBlobUploadExceptionHeaders:()=>Ry,BlockBlobUploadHeaders:()=>Ly,BlockList:()=>s_,BlockLookupList:()=>o_,ClearRange:()=>d_,ContainerAcquireLeaseExceptionHeaders:()=>nv,ContainerAcquireLeaseHeaders:()=>tv,ContainerBreakLeaseExceptionHeaders:()=>cv,ContainerBreakLeaseHeaders:()=>sv,ContainerChangeLeaseExceptionHeaders:()=>uv,ContainerChangeLeaseHeaders:()=>lv,ContainerCreateExceptionHeaders:()=>I_,ContainerCreateHeaders:()=>F_,ContainerDeleteExceptionHeaders:()=>B_,ContainerDeleteHeaders:()=>z_,ContainerFilterBlobsExceptionHeaders:()=>ev,ContainerFilterBlobsHeaders:()=>$_,ContainerGetAccessPolicyExceptionHeaders:()=>W_,ContainerGetAccessPolicyHeaders:()=>U_,ContainerGetAccountInfoExceptionHeaders:()=>gv,ContainerGetAccountInfoHeaders:()=>hv,ContainerGetPropertiesExceptionHeaders:()=>R_,ContainerGetPropertiesHeaders:()=>L_,ContainerItem:()=>Hg,ContainerListBlobFlatSegmentExceptionHeaders:()=>fv,ContainerListBlobFlatSegmentHeaders:()=>dv,ContainerListBlobHierarchySegmentExceptionHeaders:()=>mv,ContainerListBlobHierarchySegmentHeaders:()=>pv,ContainerProperties:()=>Ug,ContainerReleaseLeaseExceptionHeaders:()=>iv,ContainerReleaseLeaseHeaders:()=>rv,ContainerRenameExceptionHeaders:()=>X_,ContainerRenameHeaders:()=>Y_,ContainerRenewLeaseExceptionHeaders:()=>ov,ContainerRenewLeaseHeaders:()=>av,ContainerRestoreExceptionHeaders:()=>J_,ContainerRestoreHeaders:()=>q_,ContainerSetAccessPolicyExceptionHeaders:()=>K_,ContainerSetAccessPolicyHeaders:()=>G_,ContainerSetMetadataExceptionHeaders:()=>H_,ContainerSetMetadataHeaders:()=>V_,ContainerSubmitBatchExceptionHeaders:()=>Q_,ContainerSubmitBatchHeaders:()=>Z_,CorsRule:()=>Lg,DelimitedTextConfiguration:()=>h_,FilterBlobItem:()=>qg,FilterBlobSegment:()=>Kg,GeoReplication:()=>Bg,JsonTextConfiguration:()=>g_,KeyInfo:()=>Wg,ListBlobsFlatSegmentResponse:()=>Qg,ListBlobsHierarchySegmentResponse:()=>r_,ListContainersSegmentResponse:()=>Vg,Logging:()=>Pg,Metrics:()=>Ig,PageBlobClearPagesExceptionHeaders:()=>gy,PageBlobClearPagesHeaders:()=>hy,PageBlobCopyIncrementalExceptionHeaders:()=>Oy,PageBlobCopyIncrementalHeaders:()=>Dy,PageBlobCreateExceptionHeaders:()=>fy,PageBlobCreateHeaders:()=>dy,PageBlobGetPageRangesDiffExceptionHeaders:()=>Sy,PageBlobGetPageRangesDiffHeaders:()=>xy,PageBlobGetPageRangesExceptionHeaders:()=>by,PageBlobGetPageRangesHeaders:()=>yy,PageBlobResizeExceptionHeaders:()=>wy,PageBlobResizeHeaders:()=>Cy,PageBlobUpdateSequenceNumberExceptionHeaders:()=>Ey,PageBlobUpdateSequenceNumberHeaders:()=>Ty,PageBlobUploadPagesExceptionHeaders:()=>my,PageBlobUploadPagesFromURLExceptionHeaders:()=>vy,PageBlobUploadPagesFromURLHeaders:()=>_y,PageBlobUploadPagesHeaders:()=>py,PageList:()=>l_,PageRange:()=>u_,QueryFormat:()=>m_,QueryRequest:()=>f_,QuerySerialization:()=>p_,RetentionPolicy:()=>Fg,ServiceFilterBlobsExceptionHeaders:()=>P_,ServiceFilterBlobsHeaders:()=>N_,ServiceGetAccountInfoExceptionHeaders:()=>A_,ServiceGetAccountInfoHeaders:()=>k_,ServiceGetPropertiesExceptionHeaders:()=>S_,ServiceGetPropertiesHeaders:()=>x_,ServiceGetStatisticsExceptionHeaders:()=>w_,ServiceGetStatisticsHeaders:()=>C_,ServiceGetUserDelegationKeyExceptionHeaders:()=>O_,ServiceGetUserDelegationKeyHeaders:()=>D_,ServiceListContainersSegmentExceptionHeaders:()=>E_,ServiceListContainersSegmentHeaders:()=>T_,ServiceSetPropertiesExceptionHeaders:()=>b_,ServiceSetPropertiesHeaders:()=>y_,ServiceSubmitBatchExceptionHeaders:()=>M_,ServiceSubmitBatchHeaders:()=>j_,SignedIdentifier:()=>Xg,StaticWebsite:()=>Rg,StorageError:()=>K,UserDelegationKey:()=>Gg});const Ng={serializedName:`BlobServiceProperties`,xmlName:`StorageServiceProperties`,type:{name:`Composite`,className:`BlobServiceProperties`,modelProperties:{blobAnalyticsLogging:{serializedName:`Logging`,xmlName:`Logging`,type:{name:`Composite`,className:`Logging`}},hourMetrics:{serializedName:`HourMetrics`,xmlName:`HourMetrics`,type:{name:`Composite`,className:`Metrics`}},minuteMetrics:{serializedName:`MinuteMetrics`,xmlName:`MinuteMetrics`,type:{name:`Composite`,className:`Metrics`}},cors:{serializedName:`Cors`,xmlName:`Cors`,xmlIsWrapped:!0,xmlElementName:`CorsRule`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`CorsRule`}}}},defaultServiceVersion:{serializedName:`DefaultServiceVersion`,xmlName:`DefaultServiceVersion`,type:{name:`String`}},deleteRetentionPolicy:{serializedName:`DeleteRetentionPolicy`,xmlName:`DeleteRetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}},staticWebsite:{serializedName:`StaticWebsite`,xmlName:`StaticWebsite`,type:{name:`Composite`,className:`StaticWebsite`}}}}},Pg={serializedName:`Logging`,type:{name:`Composite`,className:`Logging`,modelProperties:{version:{serializedName:`Version`,required:!0,xmlName:`Version`,type:{name:`String`}},deleteProperty:{serializedName:`Delete`,required:!0,xmlName:`Delete`,type:{name:`Boolean`}},read:{serializedName:`Read`,required:!0,xmlName:`Read`,type:{name:`Boolean`}},write:{serializedName:`Write`,required:!0,xmlName:`Write`,type:{name:`Boolean`}},retentionPolicy:{serializedName:`RetentionPolicy`,xmlName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}}}}},Fg={serializedName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`,modelProperties:{enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},days:{constraints:{InclusiveMinimum:1},serializedName:`Days`,xmlName:`Days`,type:{name:`Number`}}}}},Ig={serializedName:`Metrics`,type:{name:`Composite`,className:`Metrics`,modelProperties:{version:{serializedName:`Version`,xmlName:`Version`,type:{name:`String`}},enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},includeAPIs:{serializedName:`IncludeAPIs`,xmlName:`IncludeAPIs`,type:{name:`Boolean`}},retentionPolicy:{serializedName:`RetentionPolicy`,xmlName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}}}}},Lg={serializedName:`CorsRule`,type:{name:`Composite`,className:`CorsRule`,modelProperties:{allowedOrigins:{serializedName:`AllowedOrigins`,required:!0,xmlName:`AllowedOrigins`,type:{name:`String`}},allowedMethods:{serializedName:`AllowedMethods`,required:!0,xmlName:`AllowedMethods`,type:{name:`String`}},allowedHeaders:{serializedName:`AllowedHeaders`,required:!0,xmlName:`AllowedHeaders`,type:{name:`String`}},exposedHeaders:{serializedName:`ExposedHeaders`,required:!0,xmlName:`ExposedHeaders`,type:{name:`String`}},maxAgeInSeconds:{constraints:{InclusiveMinimum:0},serializedName:`MaxAgeInSeconds`,required:!0,xmlName:`MaxAgeInSeconds`,type:{name:`Number`}}}}},Rg={serializedName:`StaticWebsite`,type:{name:`Composite`,className:`StaticWebsite`,modelProperties:{enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},indexDocument:{serializedName:`IndexDocument`,xmlName:`IndexDocument`,type:{name:`String`}},errorDocument404Path:{serializedName:`ErrorDocument404Path`,xmlName:`ErrorDocument404Path`,type:{name:`String`}},defaultIndexDocumentPath:{serializedName:`DefaultIndexDocumentPath`,xmlName:`DefaultIndexDocumentPath`,type:{name:`String`}}}}},K={serializedName:`StorageError`,type:{name:`Composite`,className:`StorageError`,modelProperties:{message:{serializedName:`Message`,xmlName:`Message`,type:{name:`String`}},copySourceStatusCode:{serializedName:`CopySourceStatusCode`,xmlName:`CopySourceStatusCode`,type:{name:`Number`}},copySourceErrorCode:{serializedName:`CopySourceErrorCode`,xmlName:`CopySourceErrorCode`,type:{name:`String`}},copySourceErrorMessage:{serializedName:`CopySourceErrorMessage`,xmlName:`CopySourceErrorMessage`,type:{name:`String`}},code:{serializedName:`Code`,xmlName:`Code`,type:{name:`String`}},authenticationErrorDetail:{serializedName:`AuthenticationErrorDetail`,xmlName:`AuthenticationErrorDetail`,type:{name:`String`}}}}},zg={serializedName:`BlobServiceStatistics`,xmlName:`StorageServiceStats`,type:{name:`Composite`,className:`BlobServiceStatistics`,modelProperties:{geoReplication:{serializedName:`GeoReplication`,xmlName:`GeoReplication`,type:{name:`Composite`,className:`GeoReplication`}}}}},Bg={serializedName:`GeoReplication`,type:{name:`Composite`,className:`GeoReplication`,modelProperties:{status:{serializedName:`Status`,required:!0,xmlName:`Status`,type:{name:`Enum`,allowedValues:[`live`,`bootstrap`,`unavailable`]}},lastSyncOn:{serializedName:`LastSyncTime`,required:!0,xmlName:`LastSyncTime`,type:{name:`DateTimeRfc1123`}}}}},Vg={serializedName:`ListContainersSegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListContainersSegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},containerItems:{serializedName:`ContainerItems`,required:!0,xmlName:`Containers`,xmlIsWrapped:!0,xmlElementName:`Container`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ContainerItem`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},Hg={serializedName:`ContainerItem`,xmlName:`Container`,type:{name:`Composite`,className:`ContainerItem`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},deleted:{serializedName:`Deleted`,xmlName:`Deleted`,type:{name:`Boolean`}},version:{serializedName:`Version`,xmlName:`Version`,type:{name:`String`}},properties:{serializedName:`Properties`,xmlName:`Properties`,type:{name:`Composite`,className:`ContainerProperties`}},metadata:{serializedName:`Metadata`,xmlName:`Metadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}}}}},Ug={serializedName:`ContainerProperties`,type:{name:`Composite`,className:`ContainerProperties`,modelProperties:{lastModified:{serializedName:`Last-Modified`,required:!0,xmlName:`Last-Modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`Etag`,required:!0,xmlName:`Etag`,type:{name:`String`}},leaseStatus:{serializedName:`LeaseStatus`,xmlName:`LeaseStatus`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},leaseState:{serializedName:`LeaseState`,xmlName:`LeaseState`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseDuration:{serializedName:`LeaseDuration`,xmlName:`LeaseDuration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},publicAccess:{serializedName:`PublicAccess`,xmlName:`PublicAccess`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},hasImmutabilityPolicy:{serializedName:`HasImmutabilityPolicy`,xmlName:`HasImmutabilityPolicy`,type:{name:`Boolean`}},hasLegalHold:{serializedName:`HasLegalHold`,xmlName:`HasLegalHold`,type:{name:`Boolean`}},defaultEncryptionScope:{serializedName:`DefaultEncryptionScope`,xmlName:`DefaultEncryptionScope`,type:{name:`String`}},preventEncryptionScopeOverride:{serializedName:`DenyEncryptionScopeOverride`,xmlName:`DenyEncryptionScopeOverride`,type:{name:`Boolean`}},deletedOn:{serializedName:`DeletedTime`,xmlName:`DeletedTime`,type:{name:`DateTimeRfc1123`}},remainingRetentionDays:{serializedName:`RemainingRetentionDays`,xmlName:`RemainingRetentionDays`,type:{name:`Number`}},isImmutableStorageWithVersioningEnabled:{serializedName:`ImmutableStorageWithVersioningEnabled`,xmlName:`ImmutableStorageWithVersioningEnabled`,type:{name:`Boolean`}}}}},Wg={serializedName:`KeyInfo`,type:{name:`Composite`,className:`KeyInfo`,modelProperties:{startsOn:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`String`}},expiresOn:{serializedName:`Expiry`,required:!0,xmlName:`Expiry`,type:{name:`String`}}}}},Gg={serializedName:`UserDelegationKey`,type:{name:`Composite`,className:`UserDelegationKey`,modelProperties:{signedObjectId:{serializedName:`SignedOid`,required:!0,xmlName:`SignedOid`,type:{name:`String`}},signedTenantId:{serializedName:`SignedTid`,required:!0,xmlName:`SignedTid`,type:{name:`String`}},signedStartsOn:{serializedName:`SignedStart`,required:!0,xmlName:`SignedStart`,type:{name:`String`}},signedExpiresOn:{serializedName:`SignedExpiry`,required:!0,xmlName:`SignedExpiry`,type:{name:`String`}},signedService:{serializedName:`SignedService`,required:!0,xmlName:`SignedService`,type:{name:`String`}},signedVersion:{serializedName:`SignedVersion`,required:!0,xmlName:`SignedVersion`,type:{name:`String`}},value:{serializedName:`Value`,required:!0,xmlName:`Value`,type:{name:`String`}}}}},Kg={serializedName:`FilterBlobSegment`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`FilterBlobSegment`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},where:{serializedName:`Where`,required:!0,xmlName:`Where`,type:{name:`String`}},blobs:{serializedName:`Blobs`,required:!0,xmlName:`Blobs`,xmlIsWrapped:!0,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`FilterBlobItem`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},qg={serializedName:`FilterBlobItem`,xmlName:`Blob`,type:{name:`Composite`,className:`FilterBlobItem`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,type:{name:`String`}},tags:{serializedName:`Tags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`}}}}},Jg={serializedName:`BlobTags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`,modelProperties:{blobTagSet:{serializedName:`BlobTagSet`,required:!0,xmlName:`TagSet`,xmlIsWrapped:!0,xmlElementName:`Tag`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobTag`}}}}}}},Yg={serializedName:`BlobTag`,xmlName:`Tag`,type:{name:`Composite`,className:`BlobTag`,modelProperties:{key:{serializedName:`Key`,required:!0,xmlName:`Key`,type:{name:`String`}},value:{serializedName:`Value`,required:!0,xmlName:`Value`,type:{name:`String`}}}}},Xg={serializedName:`SignedIdentifier`,xmlName:`SignedIdentifier`,type:{name:`Composite`,className:`SignedIdentifier`,modelProperties:{id:{serializedName:`Id`,required:!0,xmlName:`Id`,type:{name:`String`}},accessPolicy:{serializedName:`AccessPolicy`,xmlName:`AccessPolicy`,type:{name:`Composite`,className:`AccessPolicy`}}}}},Zg={serializedName:`AccessPolicy`,type:{name:`Composite`,className:`AccessPolicy`,modelProperties:{startsOn:{serializedName:`Start`,xmlName:`Start`,type:{name:`String`}},expiresOn:{serializedName:`Expiry`,xmlName:`Expiry`,type:{name:`String`}},permissions:{serializedName:`Permission`,xmlName:`Permission`,type:{name:`String`}}}}},Qg={serializedName:`ListBlobsFlatSegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListBlobsFlatSegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},segment:{serializedName:`Segment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobFlatListSegment`}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},$g={serializedName:`BlobFlatListSegment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobFlatListSegment`,modelProperties:{blobItems:{serializedName:`BlobItems`,required:!0,xmlName:`BlobItems`,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobItemInternal`}}}}}}},e_={serializedName:`BlobItemInternal`,xmlName:`Blob`,type:{name:`Composite`,className:`BlobItemInternal`,modelProperties:{name:{serializedName:`Name`,xmlName:`Name`,type:{name:`Composite`,className:`BlobName`}},deleted:{serializedName:`Deleted`,required:!0,xmlName:`Deleted`,type:{name:`Boolean`}},snapshot:{serializedName:`Snapshot`,required:!0,xmlName:`Snapshot`,type:{name:`String`}},versionId:{serializedName:`VersionId`,xmlName:`VersionId`,type:{name:`String`}},isCurrentVersion:{serializedName:`IsCurrentVersion`,xmlName:`IsCurrentVersion`,type:{name:`Boolean`}},properties:{serializedName:`Properties`,xmlName:`Properties`,type:{name:`Composite`,className:`BlobPropertiesInternal`}},metadata:{serializedName:`Metadata`,xmlName:`Metadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},blobTags:{serializedName:`BlobTags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`}},objectReplicationMetadata:{serializedName:`ObjectReplicationMetadata`,xmlName:`OrMetadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},hasVersionsOnly:{serializedName:`HasVersionsOnly`,xmlName:`HasVersionsOnly`,type:{name:`Boolean`}}}}},t_={serializedName:`BlobName`,type:{name:`Composite`,className:`BlobName`,modelProperties:{encoded:{serializedName:`Encoded`,xmlName:`Encoded`,xmlIsAttribute:!0,type:{name:`Boolean`}},content:{serializedName:`content`,xmlName:`content`,xmlIsMsText:!0,type:{name:`String`}}}}},n_={serializedName:`BlobPropertiesInternal`,xmlName:`Properties`,type:{name:`Composite`,className:`BlobPropertiesInternal`,modelProperties:{createdOn:{serializedName:`Creation-Time`,xmlName:`Creation-Time`,type:{name:`DateTimeRfc1123`}},lastModified:{serializedName:`Last-Modified`,required:!0,xmlName:`Last-Modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`Etag`,required:!0,xmlName:`Etag`,type:{name:`String`}},contentLength:{serializedName:`Content-Length`,xmlName:`Content-Length`,type:{name:`Number`}},contentType:{serializedName:`Content-Type`,xmlName:`Content-Type`,type:{name:`String`}},contentEncoding:{serializedName:`Content-Encoding`,xmlName:`Content-Encoding`,type:{name:`String`}},contentLanguage:{serializedName:`Content-Language`,xmlName:`Content-Language`,type:{name:`String`}},contentMD5:{serializedName:`Content-MD5`,xmlName:`Content-MD5`,type:{name:`ByteArray`}},contentDisposition:{serializedName:`Content-Disposition`,xmlName:`Content-Disposition`,type:{name:`String`}},cacheControl:{serializedName:`Cache-Control`,xmlName:`Cache-Control`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`BlobType`,xmlName:`BlobType`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},leaseStatus:{serializedName:`LeaseStatus`,xmlName:`LeaseStatus`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},leaseState:{serializedName:`LeaseState`,xmlName:`LeaseState`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseDuration:{serializedName:`LeaseDuration`,xmlName:`LeaseDuration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},copyId:{serializedName:`CopyId`,xmlName:`CopyId`,type:{name:`String`}},copyStatus:{serializedName:`CopyStatus`,xmlName:`CopyStatus`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},copySource:{serializedName:`CopySource`,xmlName:`CopySource`,type:{name:`String`}},copyProgress:{serializedName:`CopyProgress`,xmlName:`CopyProgress`,type:{name:`String`}},copyCompletedOn:{serializedName:`CopyCompletionTime`,xmlName:`CopyCompletionTime`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`CopyStatusDescription`,xmlName:`CopyStatusDescription`,type:{name:`String`}},serverEncrypted:{serializedName:`ServerEncrypted`,xmlName:`ServerEncrypted`,type:{name:`Boolean`}},incrementalCopy:{serializedName:`IncrementalCopy`,xmlName:`IncrementalCopy`,type:{name:`Boolean`}},destinationSnapshot:{serializedName:`DestinationSnapshot`,xmlName:`DestinationSnapshot`,type:{name:`String`}},deletedOn:{serializedName:`DeletedTime`,xmlName:`DeletedTime`,type:{name:`DateTimeRfc1123`}},remainingRetentionDays:{serializedName:`RemainingRetentionDays`,xmlName:`RemainingRetentionDays`,type:{name:`Number`}},accessTier:{serializedName:`AccessTier`,xmlName:`AccessTier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}},accessTierInferred:{serializedName:`AccessTierInferred`,xmlName:`AccessTierInferred`,type:{name:`Boolean`}},archiveStatus:{serializedName:`ArchiveStatus`,xmlName:`ArchiveStatus`,type:{name:`Enum`,allowedValues:[`rehydrate-pending-to-hot`,`rehydrate-pending-to-cool`,`rehydrate-pending-to-cold`]}},customerProvidedKeySha256:{serializedName:`CustomerProvidedKeySha256`,xmlName:`CustomerProvidedKeySha256`,type:{name:`String`}},encryptionScope:{serializedName:`EncryptionScope`,xmlName:`EncryptionScope`,type:{name:`String`}},accessTierChangedOn:{serializedName:`AccessTierChangeTime`,xmlName:`AccessTierChangeTime`,type:{name:`DateTimeRfc1123`}},tagCount:{serializedName:`TagCount`,xmlName:`TagCount`,type:{name:`Number`}},expiresOn:{serializedName:`Expiry-Time`,xmlName:`Expiry-Time`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`Sealed`,xmlName:`Sealed`,type:{name:`Boolean`}},rehydratePriority:{serializedName:`RehydratePriority`,xmlName:`RehydratePriority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}},lastAccessedOn:{serializedName:`LastAccessTime`,xmlName:`LastAccessTime`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`ImmutabilityPolicyUntilDate`,xmlName:`ImmutabilityPolicyUntilDate`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`ImmutabilityPolicyMode`,xmlName:`ImmutabilityPolicyMode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`LegalHold`,xmlName:`LegalHold`,type:{name:`Boolean`}}}}},r_={serializedName:`ListBlobsHierarchySegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListBlobsHierarchySegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},delimiter:{serializedName:`Delimiter`,xmlName:`Delimiter`,type:{name:`String`}},segment:{serializedName:`Segment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobHierarchyListSegment`}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},i_={serializedName:`BlobHierarchyListSegment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobHierarchyListSegment`,modelProperties:{blobPrefixes:{serializedName:`BlobPrefixes`,xmlName:`BlobPrefixes`,xmlElementName:`BlobPrefix`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobPrefix`}}}},blobItems:{serializedName:`BlobItems`,required:!0,xmlName:`BlobItems`,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobItemInternal`}}}}}}},a_={serializedName:`BlobPrefix`,type:{name:`Composite`,className:`BlobPrefix`,modelProperties:{name:{serializedName:`Name`,xmlName:`Name`,type:{name:`Composite`,className:`BlobName`}}}}},o_={serializedName:`BlockLookupList`,xmlName:`BlockList`,type:{name:`Composite`,className:`BlockLookupList`,modelProperties:{committed:{serializedName:`Committed`,xmlName:`Committed`,xmlElementName:`Committed`,type:{name:`Sequence`,element:{type:{name:`String`}}}},uncommitted:{serializedName:`Uncommitted`,xmlName:`Uncommitted`,xmlElementName:`Uncommitted`,type:{name:`Sequence`,element:{type:{name:`String`}}}},latest:{serializedName:`Latest`,xmlName:`Latest`,xmlElementName:`Latest`,type:{name:`Sequence`,element:{type:{name:`String`}}}}}}},s_={serializedName:`BlockList`,type:{name:`Composite`,className:`BlockList`,modelProperties:{committedBlocks:{serializedName:`CommittedBlocks`,xmlName:`CommittedBlocks`,xmlIsWrapped:!0,xmlElementName:`Block`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`Block`}}}},uncommittedBlocks:{serializedName:`UncommittedBlocks`,xmlName:`UncommittedBlocks`,xmlIsWrapped:!0,xmlElementName:`Block`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`Block`}}}}}}},c_={serializedName:`Block`,type:{name:`Composite`,className:`Block`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},size:{serializedName:`Size`,required:!0,xmlName:`Size`,type:{name:`Number`}}}}},l_={serializedName:`PageList`,type:{name:`Composite`,className:`PageList`,modelProperties:{pageRange:{serializedName:`PageRange`,xmlName:`PageRange`,xmlElementName:`PageRange`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`PageRange`}}}},clearRange:{serializedName:`ClearRange`,xmlName:`ClearRange`,xmlElementName:`ClearRange`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ClearRange`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},u_={serializedName:`PageRange`,xmlName:`PageRange`,type:{name:`Composite`,className:`PageRange`,modelProperties:{start:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`Number`}},end:{serializedName:`End`,required:!0,xmlName:`End`,type:{name:`Number`}}}}},d_={serializedName:`ClearRange`,xmlName:`ClearRange`,type:{name:`Composite`,className:`ClearRange`,modelProperties:{start:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`Number`}},end:{serializedName:`End`,required:!0,xmlName:`End`,type:{name:`Number`}}}}},f_={serializedName:`QueryRequest`,xmlName:`QueryRequest`,type:{name:`Composite`,className:`QueryRequest`,modelProperties:{queryType:{serializedName:`QueryType`,required:!0,xmlName:`QueryType`,type:{name:`String`}},expression:{serializedName:`Expression`,required:!0,xmlName:`Expression`,type:{name:`String`}},inputSerialization:{serializedName:`InputSerialization`,xmlName:`InputSerialization`,type:{name:`Composite`,className:`QuerySerialization`}},outputSerialization:{serializedName:`OutputSerialization`,xmlName:`OutputSerialization`,type:{name:`Composite`,className:`QuerySerialization`}}}}},p_={serializedName:`QuerySerialization`,type:{name:`Composite`,className:`QuerySerialization`,modelProperties:{format:{serializedName:`Format`,xmlName:`Format`,type:{name:`Composite`,className:`QueryFormat`}}}}},m_={serializedName:`QueryFormat`,type:{name:`Composite`,className:`QueryFormat`,modelProperties:{type:{serializedName:`Type`,required:!0,xmlName:`Type`,type:{name:`Enum`,allowedValues:[`delimited`,`json`,`arrow`,`parquet`]}},delimitedTextConfiguration:{serializedName:`DelimitedTextConfiguration`,xmlName:`DelimitedTextConfiguration`,type:{name:`Composite`,className:`DelimitedTextConfiguration`}},jsonTextConfiguration:{serializedName:`JsonTextConfiguration`,xmlName:`JsonTextConfiguration`,type:{name:`Composite`,className:`JsonTextConfiguration`}},arrowConfiguration:{serializedName:`ArrowConfiguration`,xmlName:`ArrowConfiguration`,type:{name:`Composite`,className:`ArrowConfiguration`}},parquetTextConfiguration:{serializedName:`ParquetTextConfiguration`,xmlName:`ParquetTextConfiguration`,type:{name:`Dictionary`,value:{type:{name:`any`}}}}}}},h_={serializedName:`DelimitedTextConfiguration`,xmlName:`DelimitedTextConfiguration`,type:{name:`Composite`,className:`DelimitedTextConfiguration`,modelProperties:{columnSeparator:{serializedName:`ColumnSeparator`,xmlName:`ColumnSeparator`,type:{name:`String`}},fieldQuote:{serializedName:`FieldQuote`,xmlName:`FieldQuote`,type:{name:`String`}},recordSeparator:{serializedName:`RecordSeparator`,xmlName:`RecordSeparator`,type:{name:`String`}},escapeChar:{serializedName:`EscapeChar`,xmlName:`EscapeChar`,type:{name:`String`}},headersPresent:{serializedName:`HeadersPresent`,xmlName:`HasHeaders`,type:{name:`Boolean`}}}}},g_={serializedName:`JsonTextConfiguration`,xmlName:`JsonTextConfiguration`,type:{name:`Composite`,className:`JsonTextConfiguration`,modelProperties:{recordSeparator:{serializedName:`RecordSeparator`,xmlName:`RecordSeparator`,type:{name:`String`}}}}},__={serializedName:`ArrowConfiguration`,xmlName:`ArrowConfiguration`,type:{name:`Composite`,className:`ArrowConfiguration`,modelProperties:{schema:{serializedName:`Schema`,required:!0,xmlName:`Schema`,xmlIsWrapped:!0,xmlElementName:`Field`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ArrowField`}}}}}}},v_={serializedName:`ArrowField`,xmlName:`Field`,type:{name:`Composite`,className:`ArrowField`,modelProperties:{type:{serializedName:`Type`,required:!0,xmlName:`Type`,type:{name:`String`}},name:{serializedName:`Name`,xmlName:`Name`,type:{name:`String`}},precision:{serializedName:`Precision`,xmlName:`Precision`,type:{name:`Number`}},scale:{serializedName:`Scale`,xmlName:`Scale`,type:{name:`Number`}}}}},y_={serializedName:`Service_setPropertiesHeaders`,type:{name:`Composite`,className:`ServiceSetPropertiesHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},b_={serializedName:`Service_setPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ServiceSetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},x_={serializedName:`Service_getPropertiesHeaders`,type:{name:`Composite`,className:`ServiceGetPropertiesHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},S_={serializedName:`Service_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},C_={serializedName:`Service_getStatisticsHeaders`,type:{name:`Composite`,className:`ServiceGetStatisticsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},w_={serializedName:`Service_getStatisticsExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetStatisticsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},T_={serializedName:`Service_listContainersSegmentHeaders`,type:{name:`Composite`,className:`ServiceListContainersSegmentHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},E_={serializedName:`Service_listContainersSegmentExceptionHeaders`,type:{name:`Composite`,className:`ServiceListContainersSegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},D_={serializedName:`Service_getUserDelegationKeyHeaders`,type:{name:`Composite`,className:`ServiceGetUserDelegationKeyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},O_={serializedName:`Service_getUserDelegationKeyExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetUserDelegationKeyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},k_={serializedName:`Service_getAccountInfoHeaders`,type:{name:`Composite`,className:`ServiceGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},A_={serializedName:`Service_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},j_={serializedName:`Service_submitBatchHeaders`,type:{name:`Composite`,className:`ServiceSubmitBatchHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},M_={serializedName:`Service_submitBatchExceptionHeaders`,type:{name:`Composite`,className:`ServiceSubmitBatchExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},N_={serializedName:`Service_filterBlobsHeaders`,type:{name:`Composite`,className:`ServiceFilterBlobsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},P_={serializedName:`Service_filterBlobsExceptionHeaders`,type:{name:`Composite`,className:`ServiceFilterBlobsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},F_={serializedName:`Container_createHeaders`,type:{name:`Composite`,className:`ContainerCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},I_={serializedName:`Container_createExceptionHeaders`,type:{name:`Composite`,className:`ContainerCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},L_={serializedName:`Container_getPropertiesHeaders`,type:{name:`Composite`,className:`ContainerGetPropertiesHeaders`,modelProperties:{metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobPublicAccess:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},hasImmutabilityPolicy:{serializedName:`x-ms-has-immutability-policy`,xmlName:`x-ms-has-immutability-policy`,type:{name:`Boolean`}},hasLegalHold:{serializedName:`x-ms-has-legal-hold`,xmlName:`x-ms-has-legal-hold`,type:{name:`Boolean`}},defaultEncryptionScope:{serializedName:`x-ms-default-encryption-scope`,xmlName:`x-ms-default-encryption-scope`,type:{name:`String`}},denyEncryptionScopeOverride:{serializedName:`x-ms-deny-encryption-scope-override`,xmlName:`x-ms-deny-encryption-scope-override`,type:{name:`Boolean`}},isImmutableStorageWithVersioningEnabled:{serializedName:`x-ms-immutable-storage-with-versioning-enabled`,xmlName:`x-ms-immutable-storage-with-versioning-enabled`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},R_={serializedName:`Container_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},z_={serializedName:`Container_deleteHeaders`,type:{name:`Composite`,className:`ContainerDeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},B_={serializedName:`Container_deleteExceptionHeaders`,type:{name:`Composite`,className:`ContainerDeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},V_={serializedName:`Container_setMetadataHeaders`,type:{name:`Composite`,className:`ContainerSetMetadataHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},H_={serializedName:`Container_setMetadataExceptionHeaders`,type:{name:`Composite`,className:`ContainerSetMetadataExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},U_={serializedName:`Container_getAccessPolicyHeaders`,type:{name:`Composite`,className:`ContainerGetAccessPolicyHeaders`,modelProperties:{blobPublicAccess:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},W_={serializedName:`Container_getAccessPolicyExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetAccessPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},G_={serializedName:`Container_setAccessPolicyHeaders`,type:{name:`Composite`,className:`ContainerSetAccessPolicyHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},K_={serializedName:`Container_setAccessPolicyExceptionHeaders`,type:{name:`Composite`,className:`ContainerSetAccessPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},q_={serializedName:`Container_restoreHeaders`,type:{name:`Composite`,className:`ContainerRestoreHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},J_={serializedName:`Container_restoreExceptionHeaders`,type:{name:`Composite`,className:`ContainerRestoreExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Y_={serializedName:`Container_renameHeaders`,type:{name:`Composite`,className:`ContainerRenameHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},X_={serializedName:`Container_renameExceptionHeaders`,type:{name:`Composite`,className:`ContainerRenameExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Z_={serializedName:`Container_submitBatchHeaders`,type:{name:`Composite`,className:`ContainerSubmitBatchHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}}}}},Q_={serializedName:`Container_submitBatchExceptionHeaders`,type:{name:`Composite`,className:`ContainerSubmitBatchExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},$_={serializedName:`Container_filterBlobsHeaders`,type:{name:`Composite`,className:`ContainerFilterBlobsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},ev={serializedName:`Container_filterBlobsExceptionHeaders`,type:{name:`Composite`,className:`ContainerFilterBlobsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},tv={serializedName:`Container_acquireLeaseHeaders`,type:{name:`Composite`,className:`ContainerAcquireLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},nv={serializedName:`Container_acquireLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerAcquireLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},rv={serializedName:`Container_releaseLeaseHeaders`,type:{name:`Composite`,className:`ContainerReleaseLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},iv={serializedName:`Container_releaseLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerReleaseLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},av={serializedName:`Container_renewLeaseHeaders`,type:{name:`Composite`,className:`ContainerRenewLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},ov={serializedName:`Container_renewLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerRenewLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},sv={serializedName:`Container_breakLeaseHeaders`,type:{name:`Composite`,className:`ContainerBreakLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseTime:{serializedName:`x-ms-lease-time`,xmlName:`x-ms-lease-time`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},cv={serializedName:`Container_breakLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerBreakLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},lv={serializedName:`Container_changeLeaseHeaders`,type:{name:`Composite`,className:`ContainerChangeLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},uv={serializedName:`Container_changeLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerChangeLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},dv={serializedName:`Container_listBlobFlatSegmentHeaders`,type:{name:`Composite`,className:`ContainerListBlobFlatSegmentHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},fv={serializedName:`Container_listBlobFlatSegmentExceptionHeaders`,type:{name:`Composite`,className:`ContainerListBlobFlatSegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},pv={serializedName:`Container_listBlobHierarchySegmentHeaders`,type:{name:`Composite`,className:`ContainerListBlobHierarchySegmentHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},mv={serializedName:`Container_listBlobHierarchySegmentExceptionHeaders`,type:{name:`Composite`,className:`ContainerListBlobHierarchySegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},hv={serializedName:`Container_getAccountInfoHeaders`,type:{name:`Composite`,className:`ContainerGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}}}}},gv={serializedName:`Container_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},_v={serializedName:`Blob_downloadHeaders`,type:{name:`Composite`,className:`BlobDownloadHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},createdOn:{serializedName:`x-ms-creation-time`,xmlName:`x-ms-creation-time`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},objectReplicationPolicyId:{serializedName:`x-ms-or-policy-id`,xmlName:`x-ms-or-policy-id`,type:{name:`String`}},objectReplicationRules:{serializedName:`x-ms-or`,headerCollectionPrefix:`x-ms-or-`,xmlName:`x-ms-or`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},contentRange:{serializedName:`content-range`,xmlName:`content-range`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletedOn:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},isCurrentVersion:{serializedName:`x-ms-is-current-version`,xmlName:`x-ms-is-current-version`,type:{name:`Boolean`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},blobContentMD5:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}},tagCount:{serializedName:`x-ms-tag-count`,xmlName:`x-ms-tag-count`,type:{name:`Number`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}},lastAccessed:{serializedName:`x-ms-last-access-time`,xmlName:`x-ms-last-access-time`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},contentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}}}},vv={serializedName:`Blob_downloadExceptionHeaders`,type:{name:`Composite`,className:`BlobDownloadExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},yv={serializedName:`Blob_getPropertiesHeaders`,type:{name:`Composite`,className:`BlobGetPropertiesHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},createdOn:{serializedName:`x-ms-creation-time`,xmlName:`x-ms-creation-time`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},objectReplicationPolicyId:{serializedName:`x-ms-or-policy-id`,xmlName:`x-ms-or-policy-id`,type:{name:`String`}},objectReplicationRules:{serializedName:`x-ms-or`,headerCollectionPrefix:`x-ms-or-`,xmlName:`x-ms-or`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletedOn:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},isIncrementalCopy:{serializedName:`x-ms-incremental-copy`,xmlName:`x-ms-incremental-copy`,type:{name:`Boolean`}},destinationSnapshot:{serializedName:`x-ms-copy-destination-snapshot`,xmlName:`x-ms-copy-destination-snapshot`,type:{name:`String`}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},accessTier:{serializedName:`x-ms-access-tier`,xmlName:`x-ms-access-tier`,type:{name:`String`}},accessTierInferred:{serializedName:`x-ms-access-tier-inferred`,xmlName:`x-ms-access-tier-inferred`,type:{name:`Boolean`}},archiveStatus:{serializedName:`x-ms-archive-status`,xmlName:`x-ms-archive-status`,type:{name:`String`}},accessTierChangedOn:{serializedName:`x-ms-access-tier-change-time`,xmlName:`x-ms-access-tier-change-time`,type:{name:`DateTimeRfc1123`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},isCurrentVersion:{serializedName:`x-ms-is-current-version`,xmlName:`x-ms-is-current-version`,type:{name:`Boolean`}},tagCount:{serializedName:`x-ms-tag-count`,xmlName:`x-ms-tag-count`,type:{name:`Number`}},expiresOn:{serializedName:`x-ms-expiry-time`,xmlName:`x-ms-expiry-time`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}},rehydratePriority:{serializedName:`x-ms-rehydrate-priority`,xmlName:`x-ms-rehydrate-priority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}},lastAccessed:{serializedName:`x-ms-last-access-time`,xmlName:`x-ms-last-access-time`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},bv={serializedName:`Blob_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`BlobGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},xv={serializedName:`Blob_deleteHeaders`,type:{name:`Composite`,className:`BlobDeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Sv={serializedName:`Blob_deleteExceptionHeaders`,type:{name:`Composite`,className:`BlobDeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Cv={serializedName:`Blob_undeleteHeaders`,type:{name:`Composite`,className:`BlobUndeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},wv={serializedName:`Blob_undeleteExceptionHeaders`,type:{name:`Composite`,className:`BlobUndeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Tv={serializedName:`Blob_setExpiryHeaders`,type:{name:`Composite`,className:`BlobSetExpiryHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Ev={serializedName:`Blob_setExpiryExceptionHeaders`,type:{name:`Composite`,className:`BlobSetExpiryExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Dv={serializedName:`Blob_setHttpHeadersHeaders`,type:{name:`Composite`,className:`BlobSetHttpHeadersHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ov={serializedName:`Blob_setHttpHeadersExceptionHeaders`,type:{name:`Composite`,className:`BlobSetHttpHeadersExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},kv={serializedName:`Blob_setImmutabilityPolicyHeaders`,type:{name:`Composite`,className:`BlobSetImmutabilityPolicyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiry:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}}}}},Av={serializedName:`Blob_setImmutabilityPolicyExceptionHeaders`,type:{name:`Composite`,className:`BlobSetImmutabilityPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},jv={serializedName:`Blob_deleteImmutabilityPolicyHeaders`,type:{name:`Composite`,className:`BlobDeleteImmutabilityPolicyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Mv={serializedName:`Blob_deleteImmutabilityPolicyExceptionHeaders`,type:{name:`Composite`,className:`BlobDeleteImmutabilityPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Nv={serializedName:`Blob_setLegalHoldHeaders`,type:{name:`Composite`,className:`BlobSetLegalHoldHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}}}},Pv={serializedName:`Blob_setLegalHoldExceptionHeaders`,type:{name:`Composite`,className:`BlobSetLegalHoldExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Fv={serializedName:`Blob_setMetadataHeaders`,type:{name:`Composite`,className:`BlobSetMetadataHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Iv={serializedName:`Blob_setMetadataExceptionHeaders`,type:{name:`Composite`,className:`BlobSetMetadataExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Lv={serializedName:`Blob_acquireLeaseHeaders`,type:{name:`Composite`,className:`BlobAcquireLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Rv={serializedName:`Blob_acquireLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobAcquireLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},zv={serializedName:`Blob_releaseLeaseHeaders`,type:{name:`Composite`,className:`BlobReleaseLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Bv={serializedName:`Blob_releaseLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobReleaseLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Vv={serializedName:`Blob_renewLeaseHeaders`,type:{name:`Composite`,className:`BlobRenewLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Hv={serializedName:`Blob_renewLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobRenewLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Uv={serializedName:`Blob_changeLeaseHeaders`,type:{name:`Composite`,className:`BlobChangeLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Wv={serializedName:`Blob_changeLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobChangeLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Gv={serializedName:`Blob_breakLeaseHeaders`,type:{name:`Composite`,className:`BlobBreakLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseTime:{serializedName:`x-ms-lease-time`,xmlName:`x-ms-lease-time`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Kv={serializedName:`Blob_breakLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobBreakLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},qv={serializedName:`Blob_createSnapshotHeaders`,type:{name:`Composite`,className:`BlobCreateSnapshotHeaders`,modelProperties:{snapshot:{serializedName:`x-ms-snapshot`,xmlName:`x-ms-snapshot`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Jv={serializedName:`Blob_createSnapshotExceptionHeaders`,type:{name:`Composite`,className:`BlobCreateSnapshotExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Yv={serializedName:`Blob_startCopyFromURLHeaders`,type:{name:`Composite`,className:`BlobStartCopyFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Xv={serializedName:`Blob_startCopyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobStartCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Zv={serializedName:`Blob_copyFromURLHeaders`,type:{name:`Composite`,className:`BlobCopyFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{defaultValue:`success`,isConstant:!0,serializedName:`x-ms-copy-status`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Qv={serializedName:`Blob_copyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},$v={serializedName:`Blob_abortCopyFromURLHeaders`,type:{name:`Composite`,className:`BlobAbortCopyFromURLHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ey={serializedName:`Blob_abortCopyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobAbortCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ty={serializedName:`Blob_setTierHeaders`,type:{name:`Composite`,className:`BlobSetTierHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ny={serializedName:`Blob_setTierExceptionHeaders`,type:{name:`Composite`,className:`BlobSetTierExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ry={serializedName:`Blob_getAccountInfoHeaders`,type:{name:`Composite`,className:`BlobGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}}}}},iy={serializedName:`Blob_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`BlobGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ay={serializedName:`Blob_queryHeaders`,type:{name:`Composite`,className:`BlobQueryHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},contentRange:{serializedName:`content-range`,xmlName:`content-range`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletionTime:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},blobContentMD5:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},contentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}}}},oy={serializedName:`Blob_queryExceptionHeaders`,type:{name:`Composite`,className:`BlobQueryExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},sy={serializedName:`Blob_getTagsHeaders`,type:{name:`Composite`,className:`BlobGetTagsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},cy={serializedName:`Blob_getTagsExceptionHeaders`,type:{name:`Composite`,className:`BlobGetTagsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ly={serializedName:`Blob_setTagsHeaders`,type:{name:`Composite`,className:`BlobSetTagsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},uy={serializedName:`Blob_setTagsExceptionHeaders`,type:{name:`Composite`,className:`BlobSetTagsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},dy={serializedName:`PageBlob_createHeaders`,type:{name:`Composite`,className:`PageBlobCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},fy={serializedName:`PageBlob_createExceptionHeaders`,type:{name:`Composite`,className:`PageBlobCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},py={serializedName:`PageBlob_uploadPagesHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},my={serializedName:`PageBlob_uploadPagesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},hy={serializedName:`PageBlob_clearPagesHeaders`,type:{name:`Composite`,className:`PageBlobClearPagesHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},gy={serializedName:`PageBlob_clearPagesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobClearPagesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},_y={serializedName:`PageBlob_uploadPagesFromURLHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},vy={serializedName:`PageBlob_uploadPagesFromURLExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},yy={serializedName:`PageBlob_getPageRangesHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},by={serializedName:`PageBlob_getPageRangesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},xy={serializedName:`PageBlob_getPageRangesDiffHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesDiffHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Sy={serializedName:`PageBlob_getPageRangesDiffExceptionHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesDiffExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Cy={serializedName:`PageBlob_resizeHeaders`,type:{name:`Composite`,className:`PageBlobResizeHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},wy={serializedName:`PageBlob_resizeExceptionHeaders`,type:{name:`Composite`,className:`PageBlobResizeExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ty={serializedName:`PageBlob_updateSequenceNumberHeaders`,type:{name:`Composite`,className:`PageBlobUpdateSequenceNumberHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ey={serializedName:`PageBlob_updateSequenceNumberExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUpdateSequenceNumberExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Dy={serializedName:`PageBlob_copyIncrementalHeaders`,type:{name:`Composite`,className:`PageBlobCopyIncrementalHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Oy={serializedName:`PageBlob_copyIncrementalExceptionHeaders`,type:{name:`Composite`,className:`PageBlobCopyIncrementalExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ky={serializedName:`AppendBlob_createHeaders`,type:{name:`Composite`,className:`AppendBlobCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ay={serializedName:`AppendBlob_createExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},jy={serializedName:`AppendBlob_appendBlockHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobAppendOffset:{serializedName:`x-ms-blob-append-offset`,xmlName:`x-ms-blob-append-offset`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},My={serializedName:`AppendBlob_appendBlockExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ny={serializedName:`AppendBlob_appendBlockFromUrlHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockFromUrlHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobAppendOffset:{serializedName:`x-ms-blob-append-offset`,xmlName:`x-ms-blob-append-offset`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Py={serializedName:`AppendBlob_appendBlockFromUrlExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockFromUrlExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Fy={serializedName:`AppendBlob_sealHeaders`,type:{name:`Composite`,className:`AppendBlobSealHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}}}}},Iy={serializedName:`AppendBlob_sealExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobSealExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ly={serializedName:`BlockBlob_uploadHeaders`,type:{name:`Composite`,className:`BlockBlobUploadHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ry={serializedName:`BlockBlob_uploadExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobUploadExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},zy={serializedName:`BlockBlob_putBlobFromUrlHeaders`,type:{name:`Composite`,className:`BlockBlobPutBlobFromUrlHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},By={serializedName:`BlockBlob_putBlobFromUrlExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobPutBlobFromUrlExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Vy={serializedName:`BlockBlob_stageBlockHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockHeaders`,modelProperties:{contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Hy={serializedName:`BlockBlob_stageBlockExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Uy={serializedName:`BlockBlob_stageBlockFromURLHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockFromURLHeaders`,modelProperties:{contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Wy={serializedName:`BlockBlob_stageBlockFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Gy={serializedName:`BlockBlob_commitBlockListHeaders`,type:{name:`Composite`,className:`BlockBlobCommitBlockListHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ky={serializedName:`BlockBlob_commitBlockListExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobCommitBlockListExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},qy={serializedName:`BlockBlob_getBlockListHeaders`,type:{name:`Composite`,className:`BlockBlobGetBlockListHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Jy={serializedName:`BlockBlob_getBlockListExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobGetBlockListExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Yy={parameterPath:[`options`,`contentType`],mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Content-Type`,type:{name:`String`}}},Xy={parameterPath:`blobServiceProperties`,mapper:Ng},Zy={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},q={parameterPath:`url`,mapper:{serializedName:`url`,required:!0,xmlName:`url`,type:{name:`String`}},skipEncoding:!0},Qy={parameterPath:`restype`,mapper:{defaultValue:`service`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},$y={parameterPath:`comp`,mapper:{defaultValue:`properties`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},J={parameterPath:[`options`,`timeoutInSeconds`],mapper:{constraints:{InclusiveMinimum:0},serializedName:`timeout`,xmlName:`timeout`,type:{name:`Number`}}},Y={parameterPath:`version`,mapper:{defaultValue:`2026-02-06`,isConstant:!0,serializedName:`x-ms-version`,type:{name:`String`}}},X={parameterPath:[`options`,`requestId`],mapper:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}}},Z={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},eb={parameterPath:`comp`,mapper:{defaultValue:`stats`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},tb={parameterPath:`comp`,mapper:{defaultValue:`list`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},nb={parameterPath:[`options`,`prefix`],mapper:{serializedName:`prefix`,xmlName:`prefix`,type:{name:`String`}}},rb={parameterPath:[`options`,`marker`],mapper:{serializedName:`marker`,xmlName:`marker`,type:{name:`String`}}},ib={parameterPath:[`options`,`maxPageSize`],mapper:{constraints:{InclusiveMinimum:1},serializedName:`maxresults`,xmlName:`maxresults`,type:{name:`Number`}}},ab={parameterPath:[`options`,`include`],mapper:{serializedName:`include`,xmlName:`include`,xmlElementName:`ListContainersIncludeType`,type:{name:`Sequence`,element:{type:{name:`Enum`,allowedValues:[`metadata`,`deleted`,`system`]}}}},collectionFormat:`CSV`},ob={parameterPath:`keyInfo`,mapper:Wg},sb={parameterPath:`comp`,mapper:{defaultValue:`userdelegationkey`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},cb={parameterPath:`restype`,mapper:{defaultValue:`account`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},lb={parameterPath:`body`,mapper:{serializedName:`body`,required:!0,xmlName:`body`,type:{name:`Stream`}}},ub={parameterPath:`comp`,mapper:{defaultValue:`batch`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},db={parameterPath:`contentLength`,mapper:{serializedName:`Content-Length`,required:!0,xmlName:`Content-Length`,type:{name:`Number`}}},fb={parameterPath:`multipartContentType`,mapper:{serializedName:`Content-Type`,required:!0,xmlName:`Content-Type`,type:{name:`String`}}},pb={parameterPath:`comp`,mapper:{defaultValue:`blobs`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},mb={parameterPath:[`options`,`where`],mapper:{serializedName:`where`,xmlName:`where`,type:{name:`String`}}},hb={parameterPath:`restype`,mapper:{defaultValue:`container`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},gb={parameterPath:[`options`,`metadata`],mapper:{serializedName:`x-ms-meta`,xmlName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,type:{name:`Dictionary`,value:{type:{name:`String`}}}}},_b={parameterPath:[`options`,`access`],mapper:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}}},vb={parameterPath:[`options`,`containerEncryptionScope`,`defaultEncryptionScope`],mapper:{serializedName:`x-ms-default-encryption-scope`,xmlName:`x-ms-default-encryption-scope`,type:{name:`String`}}},yb={parameterPath:[`options`,`containerEncryptionScope`,`preventEncryptionScopeOverride`],mapper:{serializedName:`x-ms-deny-encryption-scope-override`,xmlName:`x-ms-deny-encryption-scope-override`,type:{name:`Boolean`}}},bb={parameterPath:[`options`,`leaseAccessConditions`,`leaseId`],mapper:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}}},xb={parameterPath:[`options`,`modifiedAccessConditions`,`ifModifiedSince`],mapper:{serializedName:`If-Modified-Since`,xmlName:`If-Modified-Since`,type:{name:`DateTimeRfc1123`}}},Sb={parameterPath:[`options`,`modifiedAccessConditions`,`ifUnmodifiedSince`],mapper:{serializedName:`If-Unmodified-Since`,xmlName:`If-Unmodified-Since`,type:{name:`DateTimeRfc1123`}}},Cb={parameterPath:`comp`,mapper:{defaultValue:`metadata`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},wb={parameterPath:`comp`,mapper:{defaultValue:`acl`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Tb={parameterPath:[`options`,`containerAcl`],mapper:{serializedName:`containerAcl`,xmlName:`SignedIdentifiers`,xmlIsWrapped:!0,xmlElementName:`SignedIdentifier`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`SignedIdentifier`}}}}},Eb={parameterPath:`comp`,mapper:{defaultValue:`undelete`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Db={parameterPath:[`options`,`deletedContainerName`],mapper:{serializedName:`x-ms-deleted-container-name`,xmlName:`x-ms-deleted-container-name`,type:{name:`String`}}},Ob={parameterPath:[`options`,`deletedContainerVersion`],mapper:{serializedName:`x-ms-deleted-container-version`,xmlName:`x-ms-deleted-container-version`,type:{name:`String`}}},kb={parameterPath:`comp`,mapper:{defaultValue:`rename`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Ab={parameterPath:`sourceContainerName`,mapper:{serializedName:`x-ms-source-container-name`,required:!0,xmlName:`x-ms-source-container-name`,type:{name:`String`}}},jb={parameterPath:[`options`,`sourceLeaseId`],mapper:{serializedName:`x-ms-source-lease-id`,xmlName:`x-ms-source-lease-id`,type:{name:`String`}}},Mb={parameterPath:`comp`,mapper:{defaultValue:`lease`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Nb={parameterPath:`action`,mapper:{defaultValue:`acquire`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Pb={parameterPath:[`options`,`duration`],mapper:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Number`}}},Fb={parameterPath:[`options`,`proposedLeaseId`],mapper:{serializedName:`x-ms-proposed-lease-id`,xmlName:`x-ms-proposed-lease-id`,type:{name:`String`}}},Ib={parameterPath:`action`,mapper:{defaultValue:`release`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Lb={parameterPath:`leaseId`,mapper:{serializedName:`x-ms-lease-id`,required:!0,xmlName:`x-ms-lease-id`,type:{name:`String`}}},Rb={parameterPath:`action`,mapper:{defaultValue:`renew`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},zb={parameterPath:`action`,mapper:{defaultValue:`break`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Bb={parameterPath:[`options`,`breakPeriod`],mapper:{serializedName:`x-ms-lease-break-period`,xmlName:`x-ms-lease-break-period`,type:{name:`Number`}}},Vb={parameterPath:`action`,mapper:{defaultValue:`change`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Hb={parameterPath:`proposedLeaseId`,mapper:{serializedName:`x-ms-proposed-lease-id`,required:!0,xmlName:`x-ms-proposed-lease-id`,type:{name:`String`}}},Ub={parameterPath:[`options`,`include`],mapper:{serializedName:`include`,xmlName:`include`,xmlElementName:`ListBlobsIncludeItem`,type:{name:`Sequence`,element:{type:{name:`Enum`,allowedValues:[`copy`,`deleted`,`metadata`,`snapshots`,`uncommittedblobs`,`versions`,`tags`,`immutabilitypolicy`,`legalhold`,`deletedwithversions`]}}}},collectionFormat:`CSV`},Wb={parameterPath:[`options`,`startFrom`],mapper:{serializedName:`startFrom`,xmlName:`startFrom`,type:{name:`String`}}},Gb={parameterPath:`delimiter`,mapper:{serializedName:`delimiter`,required:!0,xmlName:`delimiter`,type:{name:`String`}}},Kb={parameterPath:[`options`,`snapshot`],mapper:{serializedName:`snapshot`,xmlName:`snapshot`,type:{name:`String`}}},qb={parameterPath:[`options`,`versionId`],mapper:{serializedName:`versionid`,xmlName:`versionid`,type:{name:`String`}}},Jb={parameterPath:[`options`,`range`],mapper:{serializedName:`x-ms-range`,xmlName:`x-ms-range`,type:{name:`String`}}},Yb={parameterPath:[`options`,`rangeGetContentMD5`],mapper:{serializedName:`x-ms-range-get-content-md5`,xmlName:`x-ms-range-get-content-md5`,type:{name:`Boolean`}}},Xb={parameterPath:[`options`,`rangeGetContentCRC64`],mapper:{serializedName:`x-ms-range-get-content-crc64`,xmlName:`x-ms-range-get-content-crc64`,type:{name:`Boolean`}}},Zb={parameterPath:[`options`,`cpkInfo`,`encryptionKey`],mapper:{serializedName:`x-ms-encryption-key`,xmlName:`x-ms-encryption-key`,type:{name:`String`}}},Qb={parameterPath:[`options`,`cpkInfo`,`encryptionKeySha256`],mapper:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}}},$b={parameterPath:[`options`,`cpkInfo`,`encryptionAlgorithm`],mapper:{serializedName:`x-ms-encryption-algorithm`,xmlName:`x-ms-encryption-algorithm`,type:{name:`String`}}},ex={parameterPath:[`options`,`modifiedAccessConditions`,`ifMatch`],mapper:{serializedName:`If-Match`,xmlName:`If-Match`,type:{name:`String`}}},tx={parameterPath:[`options`,`modifiedAccessConditions`,`ifNoneMatch`],mapper:{serializedName:`If-None-Match`,xmlName:`If-None-Match`,type:{name:`String`}}},nx={parameterPath:[`options`,`modifiedAccessConditions`,`ifTags`],mapper:{serializedName:`x-ms-if-tags`,xmlName:`x-ms-if-tags`,type:{name:`String`}}},rx={parameterPath:[`options`,`deleteSnapshots`],mapper:{serializedName:`x-ms-delete-snapshots`,xmlName:`x-ms-delete-snapshots`,type:{name:`Enum`,allowedValues:[`include`,`only`]}}},ix={parameterPath:[`options`,`blobDeleteType`],mapper:{serializedName:`deletetype`,xmlName:`deletetype`,type:{name:`String`}}},ax={parameterPath:`comp`,mapper:{defaultValue:`expiry`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},ox={parameterPath:`expiryOptions`,mapper:{serializedName:`x-ms-expiry-option`,required:!0,xmlName:`x-ms-expiry-option`,type:{name:`String`}}},sx={parameterPath:[`options`,`expiresOn`],mapper:{serializedName:`x-ms-expiry-time`,xmlName:`x-ms-expiry-time`,type:{name:`String`}}},cx={parameterPath:[`options`,`blobHttpHeaders`,`blobCacheControl`],mapper:{serializedName:`x-ms-blob-cache-control`,xmlName:`x-ms-blob-cache-control`,type:{name:`String`}}},lx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentType`],mapper:{serializedName:`x-ms-blob-content-type`,xmlName:`x-ms-blob-content-type`,type:{name:`String`}}},ux={parameterPath:[`options`,`blobHttpHeaders`,`blobContentMD5`],mapper:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}}},dx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentEncoding`],mapper:{serializedName:`x-ms-blob-content-encoding`,xmlName:`x-ms-blob-content-encoding`,type:{name:`String`}}},fx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentLanguage`],mapper:{serializedName:`x-ms-blob-content-language`,xmlName:`x-ms-blob-content-language`,type:{name:`String`}}},px={parameterPath:[`options`,`blobHttpHeaders`,`blobContentDisposition`],mapper:{serializedName:`x-ms-blob-content-disposition`,xmlName:`x-ms-blob-content-disposition`,type:{name:`String`}}},mx={parameterPath:`comp`,mapper:{defaultValue:`immutabilityPolicies`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},hx={parameterPath:[`options`,`immutabilityPolicyExpiry`],mapper:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}}},gx={parameterPath:[`options`,`immutabilityPolicyMode`],mapper:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}}},_x={parameterPath:`comp`,mapper:{defaultValue:`legalhold`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},vx={parameterPath:`legalHold`,mapper:{serializedName:`x-ms-legal-hold`,required:!0,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}},yx={parameterPath:[`options`,`encryptionScope`],mapper:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}}},bx={parameterPath:`comp`,mapper:{defaultValue:`snapshot`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},xx={parameterPath:[`options`,`tier`],mapper:{serializedName:`x-ms-access-tier`,xmlName:`x-ms-access-tier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}}},Sx={parameterPath:[`options`,`rehydratePriority`],mapper:{serializedName:`x-ms-rehydrate-priority`,xmlName:`x-ms-rehydrate-priority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}}},Cx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfModifiedSince`],mapper:{serializedName:`x-ms-source-if-modified-since`,xmlName:`x-ms-source-if-modified-since`,type:{name:`DateTimeRfc1123`}}},wx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfUnmodifiedSince`],mapper:{serializedName:`x-ms-source-if-unmodified-since`,xmlName:`x-ms-source-if-unmodified-since`,type:{name:`DateTimeRfc1123`}}},Tx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfMatch`],mapper:{serializedName:`x-ms-source-if-match`,xmlName:`x-ms-source-if-match`,type:{name:`String`}}},Ex={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfNoneMatch`],mapper:{serializedName:`x-ms-source-if-none-match`,xmlName:`x-ms-source-if-none-match`,type:{name:`String`}}},Dx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfTags`],mapper:{serializedName:`x-ms-source-if-tags`,xmlName:`x-ms-source-if-tags`,type:{name:`String`}}},Ox={parameterPath:`copySource`,mapper:{serializedName:`x-ms-copy-source`,required:!0,xmlName:`x-ms-copy-source`,type:{name:`String`}}},kx={parameterPath:[`options`,`blobTagsString`],mapper:{serializedName:`x-ms-tags`,xmlName:`x-ms-tags`,type:{name:`String`}}},Ax={parameterPath:[`options`,`sealBlob`],mapper:{serializedName:`x-ms-seal-blob`,xmlName:`x-ms-seal-blob`,type:{name:`Boolean`}}},jx={parameterPath:[`options`,`legalHold`],mapper:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}},Mx={parameterPath:`xMsRequiresSync`,mapper:{defaultValue:`true`,isConstant:!0,serializedName:`x-ms-requires-sync`,type:{name:`String`}}},Nx={parameterPath:[`options`,`sourceContentMD5`],mapper:{serializedName:`x-ms-source-content-md5`,xmlName:`x-ms-source-content-md5`,type:{name:`ByteArray`}}},Px={parameterPath:[`options`,`copySourceAuthorization`],mapper:{serializedName:`x-ms-copy-source-authorization`,xmlName:`x-ms-copy-source-authorization`,type:{name:`String`}}},Fx={parameterPath:[`options`,`copySourceTags`],mapper:{serializedName:`x-ms-copy-source-tag-option`,xmlName:`x-ms-copy-source-tag-option`,type:{name:`Enum`,allowedValues:[`REPLACE`,`COPY`]}}},Ix={parameterPath:[`options`,`fileRequestIntent`],mapper:{serializedName:`x-ms-file-request-intent`,xmlName:`x-ms-file-request-intent`,type:{name:`String`}}},Lx={parameterPath:`comp`,mapper:{defaultValue:`copy`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Rx={parameterPath:`copyActionAbortConstant`,mapper:{defaultValue:`abort`,isConstant:!0,serializedName:`x-ms-copy-action`,type:{name:`String`}}},zx={parameterPath:`copyId`,mapper:{serializedName:`copyid`,required:!0,xmlName:`copyid`,type:{name:`String`}}},Bx={parameterPath:`comp`,mapper:{defaultValue:`tier`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Vx={parameterPath:`tier`,mapper:{serializedName:`x-ms-access-tier`,required:!0,xmlName:`x-ms-access-tier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}}},Hx={parameterPath:[`options`,`queryRequest`],mapper:f_},Ux={parameterPath:`comp`,mapper:{defaultValue:`query`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Wx={parameterPath:`comp`,mapper:{defaultValue:`tags`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Gx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifModifiedSince`],mapper:{serializedName:`x-ms-blob-if-modified-since`,xmlName:`x-ms-blob-if-modified-since`,type:{name:`DateTimeRfc1123`}}},Kx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifUnmodifiedSince`],mapper:{serializedName:`x-ms-blob-if-unmodified-since`,xmlName:`x-ms-blob-if-unmodified-since`,type:{name:`DateTimeRfc1123`}}},qx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifMatch`],mapper:{serializedName:`x-ms-blob-if-match`,xmlName:`x-ms-blob-if-match`,type:{name:`String`}}},Jx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifNoneMatch`],mapper:{serializedName:`x-ms-blob-if-none-match`,xmlName:`x-ms-blob-if-none-match`,type:{name:`String`}}},Yx={parameterPath:[`options`,`tags`],mapper:Jg},Xx={parameterPath:[`options`,`transactionalContentMD5`],mapper:{serializedName:`Content-MD5`,xmlName:`Content-MD5`,type:{name:`ByteArray`}}},Zx={parameterPath:[`options`,`transactionalContentCrc64`],mapper:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}},Qx={parameterPath:`blobType`,mapper:{defaultValue:`PageBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},$x={parameterPath:`blobContentLength`,mapper:{serializedName:`x-ms-blob-content-length`,required:!0,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}}},eS={parameterPath:[`options`,`blobSequenceNumber`],mapper:{defaultValue:0,serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}}},tS={parameterPath:[`options`,`contentType`],mapper:{defaultValue:`application/octet-stream`,isConstant:!0,serializedName:`Content-Type`,type:{name:`String`}}},nS={parameterPath:`body`,mapper:{serializedName:`body`,required:!0,xmlName:`body`,type:{name:`Stream`}}},rS={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},iS={parameterPath:`comp`,mapper:{defaultValue:`page`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},aS={parameterPath:`pageWrite`,mapper:{defaultValue:`update`,isConstant:!0,serializedName:`x-ms-page-write`,type:{name:`String`}}},oS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberLessThanOrEqualTo`],mapper:{serializedName:`x-ms-if-sequence-number-le`,xmlName:`x-ms-if-sequence-number-le`,type:{name:`Number`}}},sS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberLessThan`],mapper:{serializedName:`x-ms-if-sequence-number-lt`,xmlName:`x-ms-if-sequence-number-lt`,type:{name:`Number`}}},cS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberEqualTo`],mapper:{serializedName:`x-ms-if-sequence-number-eq`,xmlName:`x-ms-if-sequence-number-eq`,type:{name:`Number`}}},lS={parameterPath:`pageWrite`,mapper:{defaultValue:`clear`,isConstant:!0,serializedName:`x-ms-page-write`,type:{name:`String`}}},uS={parameterPath:`sourceUrl`,mapper:{serializedName:`x-ms-copy-source`,required:!0,xmlName:`x-ms-copy-source`,type:{name:`String`}}},dS={parameterPath:`sourceRange`,mapper:{serializedName:`x-ms-source-range`,required:!0,xmlName:`x-ms-source-range`,type:{name:`String`}}},fS={parameterPath:[`options`,`sourceContentCrc64`],mapper:{serializedName:`x-ms-source-content-crc64`,xmlName:`x-ms-source-content-crc64`,type:{name:`ByteArray`}}},pS={parameterPath:`range`,mapper:{serializedName:`x-ms-range`,required:!0,xmlName:`x-ms-range`,type:{name:`String`}}},mS={parameterPath:`comp`,mapper:{defaultValue:`pagelist`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},hS={parameterPath:[`options`,`prevsnapshot`],mapper:{serializedName:`prevsnapshot`,xmlName:`prevsnapshot`,type:{name:`String`}}},gS={parameterPath:[`options`,`prevSnapshotUrl`],mapper:{serializedName:`x-ms-previous-snapshot-url`,xmlName:`x-ms-previous-snapshot-url`,type:{name:`String`}}},_S={parameterPath:`sequenceNumberAction`,mapper:{serializedName:`x-ms-sequence-number-action`,required:!0,xmlName:`x-ms-sequence-number-action`,type:{name:`Enum`,allowedValues:[`max`,`update`,`increment`]}}},vS={parameterPath:`comp`,mapper:{defaultValue:`incrementalcopy`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},yS={parameterPath:`blobType`,mapper:{defaultValue:`AppendBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},bS={parameterPath:`comp`,mapper:{defaultValue:`appendblock`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},xS={parameterPath:[`options`,`appendPositionAccessConditions`,`maxSize`],mapper:{serializedName:`x-ms-blob-condition-maxsize`,xmlName:`x-ms-blob-condition-maxsize`,type:{name:`Number`}}},SS={parameterPath:[`options`,`appendPositionAccessConditions`,`appendPosition`],mapper:{serializedName:`x-ms-blob-condition-appendpos`,xmlName:`x-ms-blob-condition-appendpos`,type:{name:`Number`}}},CS={parameterPath:[`options`,`sourceRange`],mapper:{serializedName:`x-ms-source-range`,xmlName:`x-ms-source-range`,type:{name:`String`}}},wS={parameterPath:`comp`,mapper:{defaultValue:`seal`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},TS={parameterPath:`blobType`,mapper:{defaultValue:`BlockBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},ES={parameterPath:[`options`,`copySourceBlobProperties`],mapper:{serializedName:`x-ms-copy-source-blob-properties`,xmlName:`x-ms-copy-source-blob-properties`,type:{name:`Boolean`}}},DS={parameterPath:`comp`,mapper:{defaultValue:`block`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},OS={parameterPath:`blockId`,mapper:{serializedName:`blockid`,required:!0,xmlName:`blockid`,type:{name:`String`}}},kS={parameterPath:`blocks`,mapper:o_},AS={parameterPath:`comp`,mapper:{defaultValue:`blocklist`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},jS={parameterPath:`listType`,mapper:{defaultValue:`committed`,serializedName:`blocklisttype`,required:!0,xmlName:`blocklisttype`,type:{name:`Enum`,allowedValues:[`committed`,`uncommitted`,`all`]}}};var MS=class{client;constructor(e){this.client=e}setProperties(e,t){return this.client.sendOperationRequest({blobServiceProperties:e,options:t},PS)}getProperties(e){return this.client.sendOperationRequest({options:e},FS)}getStatistics(e){return this.client.sendOperationRequest({options:e},IS)}listContainersSegment(e){return this.client.sendOperationRequest({options:e},LS)}getUserDelegationKey(e,t){return this.client.sendOperationRequest({keyInfo:e,options:t},RS)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},zS)}submitBatch(e,t,n,r){return this.client.sendOperationRequest({contentLength:e,multipartContentType:t,body:n,options:r},BS)}filterBlobs(e){return this.client.sendOperationRequest({options:e},VS)}};const NS=Xd(Mg,!0),PS={path:`/`,httpMethod:`PUT`,responses:{202:{headersMapper:y_},default:{bodyMapper:K,headersMapper:b_}},requestBody:Xy,queryParameters:[Qy,$y,J],urlParameters:[q],headerParameters:[Yy,Zy,Y,X],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:NS},FS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Ng,headersMapper:x_},default:{bodyMapper:K,headersMapper:S_}},queryParameters:[Qy,$y,J],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:NS},IS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:zg,headersMapper:C_},default:{bodyMapper:K,headersMapper:w_}},queryParameters:[Qy,J,eb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:NS},LS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Vg,headersMapper:T_},default:{bodyMapper:K,headersMapper:E_}},queryParameters:[J,tb,nb,rb,ib,ab],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:NS},RS={path:`/`,httpMethod:`POST`,responses:{200:{bodyMapper:Gg,headersMapper:D_},default:{bodyMapper:K,headersMapper:O_}},requestBody:ob,queryParameters:[Qy,J,sb],urlParameters:[q],headerParameters:[Yy,Zy,Y,X],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:NS},zS={path:`/`,httpMethod:`GET`,responses:{200:{headersMapper:k_},default:{bodyMapper:K,headersMapper:A_}},queryParameters:[$y,J,cb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:NS},BS={path:`/`,httpMethod:`POST`,responses:{202:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:j_},default:{bodyMapper:K,headersMapper:M_}},requestBody:lb,queryParameters:[J,ub],urlParameters:[q],headerParameters:[Zy,Y,X,db,fb],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:NS},VS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Kg,headersMapper:N_},default:{bodyMapper:K,headersMapper:P_}},queryParameters:[J,rb,ib,pb,mb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:NS};var HS=class{client;constructor(e){this.client=e}create(e){return this.client.sendOperationRequest({options:e},WS)}getProperties(e){return this.client.sendOperationRequest({options:e},GS)}delete(e){return this.client.sendOperationRequest({options:e},KS)}setMetadata(e){return this.client.sendOperationRequest({options:e},qS)}getAccessPolicy(e){return this.client.sendOperationRequest({options:e},JS)}setAccessPolicy(e){return this.client.sendOperationRequest({options:e},YS)}restore(e){return this.client.sendOperationRequest({options:e},XS)}rename(e,t){return this.client.sendOperationRequest({sourceContainerName:e,options:t},ZS)}submitBatch(e,t,n,r){return this.client.sendOperationRequest({contentLength:e,multipartContentType:t,body:n,options:r},QS)}filterBlobs(e){return this.client.sendOperationRequest({options:e},$S)}acquireLease(e){return this.client.sendOperationRequest({options:e},eC)}releaseLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},tC)}renewLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},nC)}breakLease(e){return this.client.sendOperationRequest({options:e},rC)}changeLease(e,t,n){return this.client.sendOperationRequest({leaseId:e,proposedLeaseId:t,options:n},iC)}listBlobFlatSegment(e){return this.client.sendOperationRequest({options:e},aC)}listBlobHierarchySegment(e,t){return this.client.sendOperationRequest({delimiter:e,options:t},oC)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},sC)}};const US=Xd(Mg,!0),WS={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:F_},default:{bodyMapper:K,headersMapper:I_}},queryParameters:[J,hb],urlParameters:[q],headerParameters:[Y,X,Z,gb,_b,vb,yb],isXML:!0,serializer:US},GS={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{headersMapper:L_},default:{bodyMapper:K,headersMapper:R_}},queryParameters:[J,hb],urlParameters:[q],headerParameters:[Y,X,Z,bb],isXML:!0,serializer:US},KS={path:`/{containerName}`,httpMethod:`DELETE`,responses:{202:{headersMapper:z_},default:{bodyMapper:K,headersMapper:B_}},queryParameters:[J,hb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb],isXML:!0,serializer:US},qS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:V_},default:{bodyMapper:K,headersMapper:H_}},queryParameters:[J,hb,Cb],urlParameters:[q],headerParameters:[Y,X,Z,gb,bb,xb],isXML:!0,serializer:US},JS={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:{type:{name:`Sequence`,element:{type:{name:`Composite`,className:`SignedIdentifier`}}},serializedName:`SignedIdentifiers`,xmlName:`SignedIdentifiers`,xmlIsWrapped:!0,xmlElementName:`SignedIdentifier`},headersMapper:U_},default:{bodyMapper:K,headersMapper:W_}},queryParameters:[J,hb,wb],urlParameters:[q],headerParameters:[Y,X,Z,bb],isXML:!0,serializer:US},YS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:G_},default:{bodyMapper:K,headersMapper:K_}},requestBody:Tb,queryParameters:[J,hb,wb],urlParameters:[q],headerParameters:[Yy,Zy,Y,X,_b,bb,xb,Sb],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:US},XS={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:q_},default:{bodyMapper:K,headersMapper:J_}},queryParameters:[J,hb,Eb],urlParameters:[q],headerParameters:[Y,X,Z,Db,Ob],isXML:!0,serializer:US},ZS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:Y_},default:{bodyMapper:K,headersMapper:X_}},queryParameters:[J,hb,kb],urlParameters:[q],headerParameters:[Y,X,Z,Ab,jb],isXML:!0,serializer:US},QS={path:`/{containerName}`,httpMethod:`POST`,responses:{202:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:Z_},default:{bodyMapper:K,headersMapper:Q_}},requestBody:lb,queryParameters:[J,ub,hb],urlParameters:[q],headerParameters:[Zy,Y,X,db,fb],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:US},$S={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:Kg,headersMapper:$_},default:{bodyMapper:K,headersMapper:ev}},queryParameters:[J,rb,ib,pb,mb,hb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:US},eC={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:tv},default:{bodyMapper:K,headersMapper:nv}},queryParameters:[J,hb,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Nb,Pb,Fb],isXML:!0,serializer:US},tC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:rv},default:{bodyMapper:K,headersMapper:iv}},queryParameters:[J,hb,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Ib,Lb],isXML:!0,serializer:US},nC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:av},default:{bodyMapper:K,headersMapper:ov}},queryParameters:[J,hb,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Lb,Rb],isXML:!0,serializer:US},rC={path:`/{containerName}`,httpMethod:`PUT`,responses:{202:{headersMapper:sv},default:{bodyMapper:K,headersMapper:cv}},queryParameters:[J,hb,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,zb,Bb],isXML:!0,serializer:US},iC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:lv},default:{bodyMapper:K,headersMapper:uv}},queryParameters:[J,hb,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Lb,Vb,Hb],isXML:!0,serializer:US},aC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:Qg,headersMapper:dv},default:{bodyMapper:K,headersMapper:fv}},queryParameters:[J,tb,nb,rb,ib,hb,Ub,Wb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:US},oC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:r_,headersMapper:pv},default:{bodyMapper:K,headersMapper:mv}},queryParameters:[J,tb,nb,rb,ib,hb,Ub,Wb,Gb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:US},sC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{headersMapper:hv},default:{bodyMapper:K,headersMapper:gv}},queryParameters:[$y,J,cb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:US};var cC=class{client;constructor(e){this.client=e}download(e){return this.client.sendOperationRequest({options:e},uC)}getProperties(e){return this.client.sendOperationRequest({options:e},dC)}delete(e){return this.client.sendOperationRequest({options:e},fC)}undelete(e){return this.client.sendOperationRequest({options:e},pC)}setExpiry(e,t){return this.client.sendOperationRequest({expiryOptions:e,options:t},mC)}setHttpHeaders(e){return this.client.sendOperationRequest({options:e},hC)}setImmutabilityPolicy(e){return this.client.sendOperationRequest({options:e},gC)}deleteImmutabilityPolicy(e){return this.client.sendOperationRequest({options:e},_C)}setLegalHold(e,t){return this.client.sendOperationRequest({legalHold:e,options:t},vC)}setMetadata(e){return this.client.sendOperationRequest({options:e},yC)}acquireLease(e){return this.client.sendOperationRequest({options:e},bC)}releaseLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},xC)}renewLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},SC)}changeLease(e,t,n){return this.client.sendOperationRequest({leaseId:e,proposedLeaseId:t,options:n},CC)}breakLease(e){return this.client.sendOperationRequest({options:e},wC)}createSnapshot(e){return this.client.sendOperationRequest({options:e},TC)}startCopyFromURL(e,t){return this.client.sendOperationRequest({copySource:e,options:t},EC)}copyFromURL(e,t){return this.client.sendOperationRequest({copySource:e,options:t},DC)}abortCopyFromURL(e,t){return this.client.sendOperationRequest({copyId:e,options:t},OC)}setTier(e,t){return this.client.sendOperationRequest({tier:e,options:t},kC)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},AC)}query(e){return this.client.sendOperationRequest({options:e},jC)}getTags(e){return this.client.sendOperationRequest({options:e},MC)}setTags(e){return this.client.sendOperationRequest({options:e},NC)}};const lC=Xd(Mg,!0),uC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:_v},206:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:_v},default:{bodyMapper:K,headersMapper:vv}},queryParameters:[J,Kb,qb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx],isXML:!0,serializer:lC},dC={path:`/{containerName}/{blob}`,httpMethod:`HEAD`,responses:{200:{headersMapper:yv},default:{bodyMapper:K,headersMapper:bv}},queryParameters:[J,Kb,qb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx],isXML:!0,serializer:lC},fC={path:`/{containerName}/{blob}`,httpMethod:`DELETE`,responses:{202:{headersMapper:xv},default:{bodyMapper:K,headersMapper:Sv}},queryParameters:[J,Kb,qb,ix],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,ex,tx,nx,rx],isXML:!0,serializer:lC},pC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Cv},default:{bodyMapper:K,headersMapper:wv}},queryParameters:[J,Eb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:lC},mC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Tv},default:{bodyMapper:K,headersMapper:Ev}},queryParameters:[J,ax],urlParameters:[q],headerParameters:[Y,X,Z,ox,sx],isXML:!0,serializer:lC},hC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Dv},default:{bodyMapper:K,headersMapper:Ov}},queryParameters:[$y,J],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,ex,tx,nx,cx,lx,ux,dx,fx,px],isXML:!0,serializer:lC},gC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:kv},default:{bodyMapper:K,headersMapper:Av}},queryParameters:[J,Kb,qb,mx],urlParameters:[q],headerParameters:[Y,X,Z,Sb,hx,gx],isXML:!0,serializer:lC},_C={path:`/{containerName}/{blob}`,httpMethod:`DELETE`,responses:{200:{headersMapper:jv},default:{bodyMapper:K,headersMapper:Mv}},queryParameters:[J,Kb,qb,mx],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:lC},vC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Nv},default:{bodyMapper:K,headersMapper:Pv}},queryParameters:[J,Kb,qb,_x],urlParameters:[q],headerParameters:[Y,X,Z,vx],isXML:!0,serializer:lC},yC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Fv},default:{bodyMapper:K,headersMapper:Iv}},queryParameters:[J,Cb],urlParameters:[q],headerParameters:[Y,X,Z,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx],isXML:!0,serializer:lC},bC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Lv},default:{bodyMapper:K,headersMapper:Rv}},queryParameters:[J,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Nb,Pb,Fb,ex,tx,nx],isXML:!0,serializer:lC},xC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:zv},default:{bodyMapper:K,headersMapper:Bv}},queryParameters:[J,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Ib,Lb,ex,tx,nx],isXML:!0,serializer:lC},SC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Vv},default:{bodyMapper:K,headersMapper:Hv}},queryParameters:[J,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Lb,Rb,ex,tx,nx],isXML:!0,serializer:lC},CC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Uv},default:{bodyMapper:K,headersMapper:Wv}},queryParameters:[J,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,Lb,Vb,Hb,ex,tx,nx],isXML:!0,serializer:lC},wC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Gv},default:{bodyMapper:K,headersMapper:Kv}},queryParameters:[J,Mb],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,zb,Bb,ex,tx,nx],isXML:!0,serializer:lC},TC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:qv},default:{bodyMapper:K,headersMapper:Jv}},queryParameters:[J,bx],urlParameters:[q],headerParameters:[Y,X,Z,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx],isXML:!0,serializer:lC},EC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Yv},default:{bodyMapper:K,headersMapper:Xv}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,gb,bb,xb,Sb,ex,tx,nx,hx,gx,xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax,jx],isXML:!0,serializer:lC},DC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Zv},default:{bodyMapper:K,headersMapper:Qv}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,gb,bb,xb,Sb,ex,tx,nx,hx,gx,yx,xx,Cx,wx,Tx,Ex,Ox,kx,jx,Mx,Nx,Px,Fx,Ix],isXML:!0,serializer:lC},OC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{204:{headersMapper:$v},default:{bodyMapper:K,headersMapper:ey}},queryParameters:[J,Lx,zx],urlParameters:[q],headerParameters:[Y,X,Z,bb,Rx],isXML:!0,serializer:lC},kC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:ty},202:{headersMapper:ty},default:{bodyMapper:K,headersMapper:ny}},queryParameters:[J,Kb,qb,Bx],urlParameters:[q],headerParameters:[Y,X,Z,bb,nx,Sx,Vx],isXML:!0,serializer:lC},AC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{headersMapper:ry},default:{bodyMapper:K,headersMapper:iy}},queryParameters:[$y,J,cb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:lC},jC={path:`/{containerName}/{blob}`,httpMethod:`POST`,responses:{200:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:ay},206:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:ay},default:{bodyMapper:K,headersMapper:oy}},requestBody:Hx,queryParameters:[J,Kb,Ux],urlParameters:[q],headerParameters:[Yy,Zy,Y,X,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:lC},MC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:Jg,headersMapper:sy},default:{bodyMapper:K,headersMapper:cy}},queryParameters:[J,Kb,qb,Wx],urlParameters:[q],headerParameters:[Y,X,Z,bb,nx,Gx,Kx,qx,Jx],isXML:!0,serializer:lC},NC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{204:{headersMapper:ly},default:{bodyMapper:K,headersMapper:uy}},requestBody:Yx,queryParameters:[J,qb,Wx],urlParameters:[q],headerParameters:[Yy,Zy,Y,X,bb,nx,Gx,Kx,qx,Jx,Xx,Zx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:lC};var PC=class{client;constructor(e){this.client=e}create(e,t,n){return this.client.sendOperationRequest({contentLength:e,blobContentLength:t,options:n},IC)}uploadPages(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},LC)}clearPages(e,t){return this.client.sendOperationRequest({contentLength:e,options:t},RC)}uploadPagesFromURL(e,t,n,r,i){return this.client.sendOperationRequest({sourceUrl:e,sourceRange:t,contentLength:n,range:r,options:i},zC)}getPageRanges(e){return this.client.sendOperationRequest({options:e},BC)}getPageRangesDiff(e){return this.client.sendOperationRequest({options:e},VC)}resize(e,t){return this.client.sendOperationRequest({blobContentLength:e,options:t},HC)}updateSequenceNumber(e,t){return this.client.sendOperationRequest({sequenceNumberAction:e,options:t},UC)}copyIncremental(e,t){return this.client.sendOperationRequest({copySource:e,options:t},WC)}};const FC=Xd(Mg,!0),IC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:dy},default:{bodyMapper:K,headersMapper:fy}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,db,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,cx,lx,ux,dx,fx,px,hx,gx,yx,xx,kx,jx,Qx,$x,eS],isXML:!0,serializer:FC},LC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:py},default:{bodyMapper:K,headersMapper:my}},requestBody:nS,queryParameters:[J,iS],urlParameters:[q],headerParameters:[Y,X,db,bb,xb,Sb,Jb,Zb,Qb,$b,ex,tx,nx,yx,Xx,Zx,tS,rS,aS,oS,sS,cS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:FC},RC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:hy},default:{bodyMapper:K,headersMapper:gy}},queryParameters:[J,iS],urlParameters:[q],headerParameters:[Y,X,Z,db,bb,xb,Sb,Jb,Zb,Qb,$b,ex,tx,nx,yx,oS,sS,cS,lS],isXML:!0,serializer:FC},zC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:_y},default:{bodyMapper:K,headersMapper:vy}},queryParameters:[J,iS],urlParameters:[q],headerParameters:[Y,X,Z,db,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx,Cx,wx,Tx,Ex,Nx,Px,Ix,aS,oS,sS,cS,uS,dS,fS,pS],isXML:!0,serializer:FC},BC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:l_,headersMapper:yy},default:{bodyMapper:K,headersMapper:by}},queryParameters:[J,rb,ib,Kb,mS],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,Jb,ex,tx,nx],isXML:!0,serializer:FC},VC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:l_,headersMapper:xy},default:{bodyMapper:K,headersMapper:Sy}},queryParameters:[J,rb,ib,Kb,mS,hS],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,Jb,ex,tx,nx,gS],isXML:!0,serializer:FC},HC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Cy},default:{bodyMapper:K,headersMapper:wy}},queryParameters:[$y,J],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx,$x],isXML:!0,serializer:FC},UC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Ty},default:{bodyMapper:K,headersMapper:Ey}},queryParameters:[$y,J],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,ex,tx,nx,eS,_S],isXML:!0,serializer:FC},WC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Dy},default:{bodyMapper:K,headersMapper:Oy}},queryParameters:[J,vS],urlParameters:[q],headerParameters:[Y,X,Z,xb,Sb,ex,tx,nx,Ox],isXML:!0,serializer:FC};var GC=class{client;constructor(e){this.client=e}create(e,t){return this.client.sendOperationRequest({contentLength:e,options:t},qC)}appendBlock(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},JC)}appendBlockFromUrl(e,t,n){return this.client.sendOperationRequest({sourceUrl:e,contentLength:t,options:n},YC)}seal(e){return this.client.sendOperationRequest({options:e},XC)}};const KC=Xd(Mg,!0),qC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:ky},default:{bodyMapper:K,headersMapper:Ay}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,db,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,cx,lx,ux,dx,fx,px,hx,gx,yx,kx,jx,yS],isXML:!0,serializer:KC},JC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:jy},default:{bodyMapper:K,headersMapper:My}},requestBody:nS,queryParameters:[J,bS],urlParameters:[q],headerParameters:[Y,X,db,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx,Xx,Zx,tS,rS,xS,SS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:KC},YC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Ny},default:{bodyMapper:K,headersMapper:Py}},queryParameters:[J,bS],urlParameters:[q],headerParameters:[Y,X,Z,db,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,yx,Cx,wx,Tx,Ex,Nx,Px,Ix,Xx,uS,fS,xS,SS,CS],isXML:!0,serializer:KC},XC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Fy},default:{bodyMapper:K,headersMapper:Iy}},queryParameters:[J,wS],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Sb,ex,tx,SS],isXML:!0,serializer:KC};var ZC=class{client;constructor(e){this.client=e}upload(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},$C)}putBlobFromUrl(e,t,n){return this.client.sendOperationRequest({contentLength:e,copySource:t,options:n},ew)}stageBlock(e,t,n,r){return this.client.sendOperationRequest({blockId:e,contentLength:t,body:n,options:r},tw)}stageBlockFromURL(e,t,n,r){return this.client.sendOperationRequest({blockId:e,contentLength:t,sourceUrl:n,options:r},nw)}commitBlockList(e,t){return this.client.sendOperationRequest({blocks:e,options:t},rw)}getBlockList(e,t){return this.client.sendOperationRequest({listType:e,options:t},iw)}};const QC=Xd(Mg,!0),$C={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Ly},default:{bodyMapper:K,headersMapper:Ry}},requestBody:nS,queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,db,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,cx,lx,ux,dx,fx,px,hx,gx,yx,xx,kx,jx,Xx,Zx,tS,rS,TS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:QC},ew={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:zy},default:{bodyMapper:K,headersMapper:By}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,db,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,cx,lx,ux,dx,fx,px,yx,xx,Cx,wx,Tx,Ex,Dx,Ox,kx,Nx,Px,Fx,Ix,Xx,TS,ES],isXML:!0,serializer:QC},tw={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Vy},default:{bodyMapper:K,headersMapper:Hy}},requestBody:nS,queryParameters:[J,DS,OS],urlParameters:[q],headerParameters:[Y,X,db,bb,Zb,Qb,$b,yx,Xx,Zx,tS,rS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:QC},nw={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Uy},default:{bodyMapper:K,headersMapper:Wy}},queryParameters:[J,DS,OS],urlParameters:[q],headerParameters:[Y,X,Z,db,bb,Zb,Qb,$b,yx,Cx,wx,Tx,Ex,Nx,Px,Ix,uS,fS,CS],isXML:!0,serializer:QC},rw={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Gy},default:{bodyMapper:K,headersMapper:Ky}},requestBody:kS,queryParameters:[J,AS],urlParameters:[q],headerParameters:[Yy,Zy,Y,X,gb,bb,xb,Sb,Zb,Qb,$b,ex,tx,nx,cx,lx,ux,dx,fx,px,hx,gx,yx,xx,kx,jx,Xx,Zx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:QC},iw={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:s_,headersMapper:qy},default:{bodyMapper:K,headersMapper:Jy}},queryParameters:[J,Kb,AS,jS],urlParameters:[q],headerParameters:[Y,X,Z,bb,nx],isXML:!0,serializer:QC};var aw=class extends Dp{url;version;constructor(e,t){if(e===void 0)throw Error(`'url' cannot be null`);t||={};let n={requestContentType:`application/json; charset=utf-8`},r=`azsdk-js-azure-storage-blob/12.30.0`,i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,a={...n,...t,userAgentOptions:{userAgentPrefix:i},endpoint:t.endpoint??t.baseUri??`{url}`};super(a),this.url=e,this.version=t.version||`2026-02-06`,this.service=new MS(this),this.container=new HS(this),this.blob=new cC(this),this.pageBlob=new PC(this),this.appendBlob=new GC(this),this.blockBlob=new ZC(this)}service;container;blob;pageBlob;appendBlob;blockBlob},ow=class extends aw{async sendOperationRequest(e,t){let n={...t};return(n.path===`/{containerName}`||n.path===`/{containerName}/{blob}`)&&(n.path=``),super.sendOperationRequest(e,n)}};function sw(e){let t=new URL(e),n=t.pathname;return n||=`/`,n=dw(n),t.pathname=n,t.toString()}function cw(e){let t=``;if(e.search(`DevelopmentStorageProxyUri=`)!==-1){let n=e.split(`;`);for(let e of n)e.trim().startsWith(`DevelopmentStorageProxyUri=`)&&(t=e.trim().match(`DevelopmentStorageProxyUri=(.*)`)[1])}return t}function lw(e,t){let n=e.split(`;`);for(let e of n)if(e.trim().startsWith(t))return e.trim().match(t+`=(.*)`)[1];return``}function uw(e){let t=``;e.startsWith(`UseDevelopmentStorage=true`)&&(t=cw(e),e=`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`);let n=lw(e,`BlobEndpoint`);if(n=n.endsWith(`/`)?n.slice(0,-1):n,e.search(`DefaultEndpointsProtocol=`)!==-1&&e.search(`AccountKey=`)!==-1){let r=``,i=``,a=Buffer.from(`accountKey`,`base64`),o=``;if(i=lw(e,`AccountName`),a=Buffer.from(lw(e,`AccountKey`),`base64`),!n){r=lw(e,`DefaultEndpointsProtocol`);let t=r.toLowerCase();if(t!==`https`&&t!==`http`)throw Error(`Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'`);if(o=lw(e,`EndpointSuffix`),!o)throw Error(`Invalid EndpointSuffix in the provided Connection String`);n=`${r}://${i}.blob.${o}`}if(!i)throw Error(`Invalid AccountName in the provided Connection String`);if(a.length===0)throw Error(`Invalid AccountKey in the provided Connection String`);return{kind:`AccountConnString`,url:n,accountName:i,accountKey:a,proxyUri:t}}else{let t=lw(e,`SharedAccessSignature`),r=lw(e,`AccountName`);if(r||=Sw(n),!n)throw Error(`Invalid BlobEndpoint in the provided SAS Connection String`);if(!t)throw Error(`Invalid SharedAccessSignature in the provided SAS Connection String`);return t.startsWith(`?`)&&(t=t.substring(1)),{kind:`SASConnString`,url:n,accountName:r,accountSas:t}}}function dw(e){return encodeURIComponent(e).replace(/%2F/g,`/`).replace(/'/g,`%27`).replace(/\+/g,`%20`).replace(/%25/g,`%`)}function fw(e,t){let n=new URL(e),r=n.pathname;return r=r?r.endsWith(`/`)?`${r}${t}`:`${r}/${t}`:t,n.pathname=r,n.toString()}function pw(e,t,n){let r=new URL(e),i=encodeURIComponent(t),a=n?encodeURIComponent(n):void 0,o=r.search===``?`?`:r.search,s=[];for(let e of o.slice(1).split(`&`))if(e){let[t]=e.split(`=`,2);t!==i&&s.push(e)}return a&&s.push(`${i}=${a}`),r.search=s.length?`?${s.join(`&`)}`:``,r.toString()}function mw(e,t){return new URL(e).searchParams.get(t)??void 0}function hw(e){try{let t=new URL(e);return t.protocol.endsWith(`:`)?t.protocol.slice(0,-1):t.protocol}catch{return}}function gw(e,t){let n=new URL(e),r=n.search;return r?r+=`&`+t:r=t,n.search=r,n.toString()}function _w(e,t=!0){let n=e.toISOString();return t?n.substring(0,n.length-1)+`0000Z`:n.substring(0,n.length-5)+`Z`}function vw(e){return Gu?Buffer.from(e).toString(`base64`):btoa(e)}function yw(e,t){return e.length>42&&(e=e.slice(0,42)),vw(e+bw(t.toString(),48-e.length,`0`))}function bw(e,t,n=` `){return String.prototype.padStart?e.padStart(t,n):(n||=` `,e.length>t?e:(t-=e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e))}function xw(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()}function Sw(e){let t=new URL(e),n;try{return n=t.hostname.split(`.`)[1]===`blob`?t.hostname.split(`.`)[0]:Cw(t)?t.pathname.split(`/`)[1]:``,n}catch{throw Error(`Unable to extract accountName with provided information.`)}}function Cw(e){let t=e.host;return/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(t)||!!e.port&&_g.includes(e.port)}function ww(e){if(e===void 0)return;let t=[];for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];t.push(`${encodeURIComponent(n)}=${encodeURIComponent(r)}`)}return t.join(`&`)}function Tw(e){if(e===void 0)return;let t={blobTagSet:[]};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];t.blobTagSet.push({key:n,value:r})}return t}function Ew(e){if(e===void 0)return;let t={};for(let n of e.blobTagSet)t[n.key]=n.value;return t}function Dw(e){if(e!==void 0)switch(e.kind){case`csv`:return{format:{type:`delimited`,delimitedTextConfiguration:{columnSeparator:e.columnSeparator||`,`,fieldQuote:e.fieldQuote||``,recordSeparator:e.recordSeparator,escapeChar:e.escapeCharacter||``,headersPresent:e.hasHeaders||!1}}};case`json`:return{format:{type:`json`,jsonTextConfiguration:{recordSeparator:e.recordSeparator}}};case`arrow`:return{format:{type:`arrow`,arrowConfiguration:{schema:e.schema}}};case`parquet`:return{format:{type:`parquet`}};default:throw Error(`Invalid BlobQueryTextConfiguration.`)}}function Ow(e){if(!e||`policy-id`in e)return;let t=[];for(let n in e){let r=n.split(`_`);r[0].startsWith(`or-`)&&(r[0]=r[0].substring(3));let i={ruleId:r[1],replicationStatus:e[n]},a=t.findIndex(e=>e.policyId===r[0]);a>-1?t[a].rules.push(i):t.push({policyId:r[0],rules:[i]})}return t}function kw(e){return e?e.scheme+` `+e.value:void 0}function*Aw(e){let t=[],n=[];e.pageRange&&(t=e.pageRange),e.clearRange&&(n=e.clearRange);let r=0,i=0;for(;r0&&n.length>0&&e.push(`${t}=${n}`))}};function Rw(e,t,n){return zw(e,t,n).sasQueryParameters}function zw(e,t,n){let r=e.version?e.version:dg,i=t instanceof Jh?t:void 0,a;if(i===void 0&&n!==void 0&&(a=new lg(n,t)),i===void 0&&a===void 0)throw TypeError(`Invalid sharedKeyCredential, userDelegationKey or accountName.`);if(r>=`2020-12-06`)return i===void 0?r>=`2025-07-05`?Kw(e,a):Gw(e,a):Hw(e,i);if(r>=`2018-11-09`)return i===void 0?r>=`2020-02-10`?Ww(e,a):Uw(e,a):Vw(e,i);if(r>=`2015-04-05`){if(i!==void 0)return Bw(e,i);throw RangeError(`'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.`)}throw RangeError(`'version' must be >= '2015-04-05'.`)}function Bw(e,t){if(e=Jw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`;e.blobName&&(n=`b`);let r;e.permissions&&(r=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let i=[r||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` -`),a=t.computeHMACSHA256(i);return{sasQueryParameters:new Lw(e.version,a,r,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType),stringToSign:i}}function Vw(e,t){if(e=Jw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType),stringToSign:a}}function Hw(e,t){if(e=Jw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,void 0,void 0,void 0,e.encryptionScope),stringToSign:a}}function Uw(e,t){if(e=Jw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?_w(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?_w(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey),stringToSign:a}}function Ww(e,t){if(e=Jw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?_w(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?_w(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId),stringToSign:a}}function Gw(e,t){if(e=Jw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?_w(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?_w(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope),stringToSign:a}}function Kw(e,t){if(e=Jw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Nw.parse(e.permissions.toString()).toString():Pw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?_w(e.startsOn,!1):``,e.expiresOn?_w(e.expiresOn,!1):``,qw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?_w(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?_w(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,void 0,e.delegatedUserObjectId,e.ipRange?Fw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` -`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Lw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope,e.delegatedUserObjectId),stringToSign:a}}function qw(e,t,n){let r=[`/blob/${e}/${t}`];return n&&r.push(`/${n}`),r.join(``)}function Jw(e){let t=e.version?e.version:dg;if(e.snapshotTime&&t<`2018-11-09`)throw RangeError(`'version' must be >= '2018-11-09' when providing 'snapshotTime'.`);if(e.blobName===void 0&&e.snapshotTime)throw RangeError(`Must provide 'blobName' when providing 'snapshotTime'.`);if(e.versionId&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'versionId'.`);if(e.blobName===void 0&&e.versionId)throw RangeError(`Must provide 'blobName' when providing 'versionId'.`);if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<`2020-08-04`)throw RangeError(`'version' must be >= '2020-08-04' when provided 'i' permission.`);if(e.permissions&&e.permissions.deleteVersion&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'x' permission.`);if(e.permissions&&e.permissions.permanentDelete&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'y' permission.`);if(e.permissions&&e.permissions.tag&&t<`2019-12-12`)throw RangeError(`'version' must be >= '2019-12-12' when providing 't' permission.`);if(t<`2020-02-10`&&e.permissions&&(e.permissions.move||e.permissions.execute))throw RangeError(`'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.`);if(t<`2021-04-10`&&e.permissions&&e.permissions.filterByTags)throw RangeError(`'version' must be >= '2021-04-10' when providing the 'f' permission.`);if(t<`2020-02-10`&&(e.preauthorizedAgentObjectId||e.correlationId))throw RangeError(`'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.`);if(e.encryptionScope&&t<`2020-12-06`)throw RangeError(`'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.`);return e.version=t,e}var Yw=class{_leaseId;_url;_containerOrBlobOperation;_isContainer;get leaseId(){return this._leaseId}get url(){return this._url}constructor(e,t){let n=e.storageClientContext;this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=n.container):(this._isContainer=!1,this._containerOrBlobOperation=n.blob),t||=Wu(),this._leaseId=t}async acquireLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-acquireLease`,t,async n=>jw(await this._containerOrBlobOperation.acquireLease({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},proposedLeaseId:this._leaseId,tracingOptions:n.tracingOptions})))}async changeLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-changeLease`,t,async n=>{let r=jw(await this._containerOrBlobOperation.changeLease(this._leaseId,e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return this._leaseId=e,r})}async releaseLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==``||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==``||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-releaseLease`,e,async t=>jw(await this._containerOrBlobOperation.releaseLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async renewLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==``||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==``||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-renewLease`,e,async t=>this._containerOrBlobOperation.renewLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions}))}async breakLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-breakLease`,t,async n=>{let r={abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions};return jw(await this._containerOrBlobOperation.breakLease(r))})}},Xw=class extends w{start;offset;end;getter;source;retries=0;maxRetryRequests;onProgress;options;constructor(e,t,n,r,i={}){super({highWaterMark:i.highWaterMark}),this.getter=t,this.source=e,this.start=n,this.offset=n,this.end=n+r-1,this.maxRetryRequests=i.maxRetryRequests&&i.maxRetryRequests>=0?i.maxRetryRequests:0,this.onProgress=i.onProgress,this.options=i,this.setSourceEventHandlers()}_read(){this.source.resume()}setSourceEventHandlers(){this.source.on(`data`,this.sourceDataHandler),this.source.on(`end`,this.sourceErrorOrEndHandler),this.source.on(`error`,this.sourceErrorOrEndHandler),this.source.on(`aborted`,this.sourceAbortedHandler)}removeSourceEventHandlers(){this.source.removeListener(`data`,this.sourceDataHandler),this.source.removeListener(`end`,this.sourceErrorOrEndHandler),this.source.removeListener(`error`,this.sourceErrorOrEndHandler),this.source.removeListener(`aborted`,this.sourceAbortedHandler)}sourceDataHandler=e=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=void 0,this.source.pause(),this.sourceErrorOrEndHandler(),this.source.destroy();return}this.offset+=e.length,this.onProgress&&this.onProgress({loadedBytes:this.offset-this.start}),this.push(e)||this.source.pause()};sourceAbortedHandler=()=>{let e=new zu(`The operation was aborted.`);this.destroy(e)};sourceErrorOrEndHandler=e=>{if(e&&e.name===`AbortError`){this.destroy(e);return}this.removeSourceEventHandlers(),this.offset-1===this.end?this.push(null):this.offset<=this.end?this.retries{this.source=e,this.setSourceEventHandlers()}).catch(e=>{this.destroy(e)})):this.destroy(Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)):this.destroy(Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`))};_destroy(e,t){this.removeSourceEventHandlers(),this.source.destroy(),t(e===null?void 0:e)}},Zw=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return this.originalResponse.copyCompletedOn}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get tagCount(){return this.originalResponse.tagCount}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get lastAccessed(){return this.originalResponse.lastAccessed}get createdOn(){return this.originalResponse.createdOn}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get versionId(){return this.originalResponse.versionId}get isCurrentVersion(){return this.originalResponse.isCurrentVersion}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId}get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties}get isSealed(){return this.originalResponse.isSealed}get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn}get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode}get legalHold(){return this.originalResponse.legalHold}get contentAsBlob(){return this.originalResponse.blobBody}get readableStreamBody(){return Gu?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t,n,r,i={}){this.originalResponse=e,this.blobDownloadStream=new Xw(this.originalResponse.readableStreamBody,t,n,r,i)}};const Qw=new Uint8Array([79,98,106,1]);var $w=class e{static async readFixedBytes(e,t,n={}){let r=await e.read(t,{abortSignal:n.abortSignal});if(r.length!==t)throw Error(`Hit stream end.`);return r}static async readByte(t,n={}){return(await e.readFixedBytes(t,1,n))[0]}static async readZigZagLong(t,n={}){let r=0,i=0,a,o,s;do a=await e.readByte(t,n),o=a&128,r|=(a&127)<2**53-1)throw Error(`Integer overflow.`);return i}return r>>1^-(r&1)}static async readLong(t,n={}){return e.readZigZagLong(t,n)}static async readInt(t,n={}){return e.readZigZagLong(t,n)}static async readNull(){return null}static async readBoolean(t,n={}){let r=await e.readByte(t,n);if(r===1)return!0;if(r===0)return!1;throw Error(`Byte was not a boolean.`)}static async readFloat(t,n={}){let r=await e.readFixedBytes(t,4,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,!0)}static async readDouble(t,n={}){let r=await e.readFixedBytes(t,8,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,!0)}static async readBytes(t,n={}){let r=await e.readLong(t,n);if(r<0)throw Error(`Bytes size was negative.`);return t.read(r,{abortSignal:n.abortSignal})}static async readString(t,n={}){let r=await e.readBytes(t,n);return new TextDecoder().decode(r)}static async readMapPair(t,n,r={}){return{key:await e.readString(t,r),value:await n(t,r)}}static async readMap(t,n,r={}){let i=await e.readArray(t,(t,r={})=>e.readMapPair(t,n,r),r),a={};for(let e of i)a[e.key]=e.value;return a}static async readArray(t,n,r={}){let i=[];for(let a=await e.readLong(t,r);a!==0;a=await e.readLong(t,r))for(a<0&&(await e.readLong(t,r),a=-a);a--;){let e=await n(t,r);i.push(e)}return i}},eT;(function(e){e.RECORD=`record`,e.ENUM=`enum`,e.ARRAY=`array`,e.MAP=`map`,e.UNION=`union`,e.FIXED=`fixed`})(eT||={});var tT;(function(e){e.NULL=`null`,e.BOOLEAN=`boolean`,e.INT=`int`,e.LONG=`long`,e.FLOAT=`float`,e.DOUBLE=`double`,e.BYTES=`bytes`,e.STRING=`string`})(tT||={});var nT=class e{static fromSchema(t){return typeof t==`string`?e.fromStringSchema(t):Array.isArray(t)?e.fromArraySchema(t):e.fromObjectSchema(t)}static fromStringSchema(e){switch(e){case tT.NULL:case tT.BOOLEAN:case tT.INT:case tT.LONG:case tT.FLOAT:case tT.DOUBLE:case tT.BYTES:case tT.STRING:return new rT(e);default:throw Error(`Unexpected Avro type ${e}`)}}static fromArraySchema(t){return new aT(t.map(e.fromSchema))}static fromObjectSchema(t){let n=t.type;try{return e.fromStringSchema(n)}catch{}switch(n){case eT.RECORD:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.name)throw Error(`Required attribute 'name' doesn't exist on schema: ${t}`);let r={};if(!t.fields)throw Error(`Required attribute 'fields' doesn't exist on schema: ${t}`);for(let n of t.fields)r[n.name]=e.fromSchema(n.type);return new sT(r,t.name);case eT.ENUM:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.symbols)throw Error(`Required attribute 'symbols' doesn't exist on schema: ${t}`);return new iT(t.symbols);case eT.MAP:if(!t.values)throw Error(`Required attribute 'values' doesn't exist on schema: ${t}`);return new oT(e.fromSchema(t.values));case eT.ARRAY:case eT.FIXED:default:throw Error(`Unexpected Avro type ${n} in ${t}`)}}},rT=class extends nT{_primitive;constructor(e){super(),this._primitive=e}read(e,t={}){switch(this._primitive){case tT.NULL:return $w.readNull();case tT.BOOLEAN:return $w.readBoolean(e,t);case tT.INT:return $w.readInt(e,t);case tT.LONG:return $w.readLong(e,t);case tT.FLOAT:return $w.readFloat(e,t);case tT.DOUBLE:return $w.readDouble(e,t);case tT.BYTES:return $w.readBytes(e,t);case tT.STRING:return $w.readString(e,t);default:throw Error(`Unknown Avro Primitive`)}}},iT=class extends nT{_symbols;constructor(e){super(),this._symbols=e}async read(e,t={}){let n=await $w.readInt(e,t);return this._symbols[n]}},aT=class extends nT{_types;constructor(e){super(),this._types=e}async read(e,t={}){let n=await $w.readInt(e,t);return this._types[n].read(e,t)}},oT=class extends nT{_itemType;constructor(e){super(),this._itemType=e}read(e,t={}){return $w.readMap(e,(e,t)=>this._itemType.read(e,t),t)}},sT=class extends nT{_name;_fields;constructor(e,t){super(),this._fields=e,this._name=t}async read(e,t={}){let n={};n.$schema=this._name;for(let r in this._fields)Object.prototype.hasOwnProperty.call(this._fields,r)&&(n[r]=await this._fields[r].read(e,t));return n}};function cT(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n0)for(let t=0;t0}async*parseObjects(e={}){for(this._initialized||await this.initialize(e);this.hasNext();){let t=await this._itemType.read(this._dataStream,{abortSignal:e.abortSignal});if(this._itemsRemainingInBlock--,this._objectIndex++,this._itemsRemainingInBlock===0){let t=await $w.readFixedBytes(this._dataStream,16,{abortSignal:e.abortSignal});if(this._blockOffset=this._initialBlockOffset+this._dataStream.position,this._objectIndex=0,!cT(this._syncMarker,t))throw Error(`Stream is not a valid Avro file.`);try{this._itemsRemainingInBlock=await $w.readLong(this._dataStream,{abortSignal:e.abortSignal})}catch{this._itemsRemainingInBlock=0}this._itemsRemainingInBlock>0&&await $w.readLong(this._dataStream,{abortSignal:e.abortSignal})}yield t}}},uT=class{};const dT=new zu(`Reading from the avro stream was aborted.`);var fT=class extends uT{_position;_readable;toUint8Array(e){return typeof e==`string`?ne.from(e):e}constructor(e){super(),this._readable=e,this._position=0}get position(){return this._position}async read(e,t={}){if(t.abortSignal?.aborted)throw dT;if(e<0)throw Error(`size parameter should be positive: ${e}`);if(e===0)return new Uint8Array;if(!this._readable.readable)throw Error(`Stream no longer readable.`);let n=this._readable.read(e);return n?(this._position+=n.length,this.toUint8Array(n)):new Promise((n,r)=>{let i=()=>{this._readable.removeListener(`readable`,a),this._readable.removeListener(`error`,o),this._readable.removeListener(`end`,o),this._readable.removeListener(`close`,o),t.abortSignal&&t.abortSignal.removeEventListener(`abort`,s)},a=()=>{let t=this._readable.read(e);t&&(this._position+=t.length,i(),n(this.toUint8Array(t)))},o=()=>{i(),r()},s=()=>{i(),r(dT)};this._readable.on(`readable`,a),this._readable.once(`error`,o),this._readable.once(`end`,o),this._readable.once(`close`,o),t.abortSignal&&t.abortSignal.addEventListener(`abort`,s)})}},pT=class extends w{source;avroReader;avroIter;avroPaused=!0;onProgress;onError;constructor(e,t={}){super(),this.source=e,this.onProgress=t.onProgress,this.onError=t.onError,this.avroReader=new lT(new fT(this.source)),this.avroIter=this.avroReader.parseObjects({abortSignal:t.abortSignal})}_read(){this.avroPaused&&this.readInternal().catch(e=>{this.emit(`error`,e)})}async readInternal(){this.avroPaused=!1;let e;do{if(e=await this.avroIter.next(),e.done)break;let t=e.value,n=t.$schema;if(typeof n!=`string`)throw Error(`Missing schema in avro record.`);switch(n){case`com.microsoft.azure.storage.queryBlobContents.resultData`:{let e=t.data;if(!(e instanceof Uint8Array))throw Error(`Invalid data in avro result record.`);this.push(Buffer.from(e))||(this.avroPaused=!0)}break;case`com.microsoft.azure.storage.queryBlobContents.progress`:{let e=t.bytesScanned;if(typeof e!=`number`)throw Error(`Invalid bytesScanned in avro progress record.`);this.onProgress&&this.onProgress({loadedBytes:e})}break;case`com.microsoft.azure.storage.queryBlobContents.end`:if(this.onProgress){let e=t.totalBytes;if(typeof e!=`number`)throw Error(`Invalid totalBytes in avro end record.`);this.onProgress({loadedBytes:e})}this.push(null);break;case`com.microsoft.azure.storage.queryBlobContents.error`:if(this.onError){let e=t.fatal;if(typeof e!=`boolean`)throw Error(`Invalid fatal in avro error record.`);let n=t.name;if(typeof n!=`string`)throw Error(`Invalid name in avro error record.`);let r=t.description;if(typeof r!=`string`)throw Error(`Invalid description in avro error record.`);let i=t.position;if(typeof i!=`number`)throw Error(`Invalid position in avro error record.`);this.onError({position:i,name:n,isFatal:e,description:r})}break;default:throw Error(`Unknown schema ${n} in avro progress record.`)}}while(!e.done&&!this.avroPaused)}},mT=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get blobBody(){}get readableStreamBody(){return Gu?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t={}){this.originalResponse=e,this.blobDownloadStream=new pT(this.originalResponse.readableStreamBody,t)}},hT;(function(e){e.Hot=`Hot`,e.Cool=`Cool`,e.Cold=`Cold`,e.Archive=`Archive`})(hT||={});var gT;(function(e){e.P4=`P4`,e.P6=`P6`,e.P10=`P10`,e.P15=`P15`,e.P20=`P20`,e.P30=`P30`,e.P40=`P40`,e.P50=`P50`,e.P60=`P60`,e.P70=`P70`,e.P80=`P80`})(gT||={});function _T(e){if(e!==void 0)return e}function vT(e,t){if(e&&!t)throw RangeError(`Customer-provided encryption key must be used over HTTPS.`);e&&!e.encryptionAlgorithm&&(e.encryptionAlgorithm=`AES256`)}var yT;(function(e){e.StorageOAuthScopes=`https://storage.azure.com/.default`,e.DiskComputeOAuthScopes=`https://disk.compute.azure.com/.default`})(yT||={});function bT(e){let t=(e._response.parsedBody.pageRange||[]).map(e=>({offset:e.start,count:e.end-e.start})),n=(e._response.parsedBody.clearRange||[]).map(e=>({offset:e.start,count:e.end-e.start}));return{...e,pageRange:t,clearRange:n,_response:{...e._response,parsedBody:{pageRange:t,clearRange:n}}}}var xT=class e extends Error{constructor(t){super(t),this.name=`PollerStoppedError`,Object.setPrototypeOf(this,e.prototype)}},ST=class e extends Error{constructor(t){super(t),this.name=`PollerCancelledError`,Object.setPrototypeOf(this,e.prototype)}},CT=class{constructor(e){this.resolveOnUnsuccessful=!1,this.stopped=!0,this.pollProgressCallbacks=[],this.operation=e,this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),this.promise.catch(()=>{})}async startPolling(e={}){for(this.stopped&&=!1;!this.isStopped()&&!this.isDone();)await this.poll(e),await this.delay()}async pollOnce(e={}){this.isDone()||(this.operation=await this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})),this.processUpdatedState()}fireProgress(e){for(let t of this.pollProgressCallbacks)t(e)}async cancelOnce(e={}){this.operation=await this.operation.cancel(e)}poll(e={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);let t=()=>{this.pollOncePromise=void 0};this.pollOncePromise.then(t,t).catch(this.reject)}return this.pollOncePromise}processUpdatedState(){if(this.operation.state.error&&(this.stopped=!0,!this.resolveOnUnsuccessful))throw this.reject(this.operation.state.error),this.operation.state.error;if(this.operation.state.isCancelled&&(this.stopped=!0,!this.resolveOnUnsuccessful)){let e=new ST(`Operation was canceled`);throw this.reject(e),e}this.isDone()&&this.resolve&&this.resolve(this.getResult())}async pollUntilDone(e={}){return this.stopped&&this.startPolling(e).catch(this.reject),this.processUpdatedState(),this.promise}onProgress(e){return this.pollProgressCallbacks.push(e),()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter(t=>t!==e)}}isDone(){let e=this.operation.state;return!!(e.isCompleted||e.isCancelled||e.error)}stopPolling(){this.stopped||(this.stopped=!0,this.reject&&this.reject(new xT(`This poller is already stopped`)))}isStopped(){return this.stopped}cancelOperation(e={}){if(!this.cancelPromise)this.cancelPromise=this.cancelOnce(e);else if(e.abortSignal)throw Error(`A cancel request is currently pending`);return this.cancelPromise}getOperationState(){return this.operation.state}getResult(){return this.operation.state.result}toString(){return this.operation.toString()}},wT=class extends CT{intervalInMs;constructor(e){let{blobClient:t,copySource:n,intervalInMs:r=15e3,onProgress:i,resumeFrom:a,startCopyFromURLOptions:o}=e,s;a&&(s=JSON.parse(a).state);let c=OT({...s,blobClient:t,copySource:n,startCopyFromURLOptions:o});super(c),typeof i==`function`&&this.onProgress(i),this.intervalInMs=r}delay(){return Vu(this.intervalInMs)}};const TT=async function(e={}){let t=this.state,{copyId:n}=t;return t.isCompleted?OT(t):n?(await t.blobClient.abortCopyFromURL(n,{abortSignal:e.abortSignal}),t.isCancelled=!0,OT(t)):(t.isCancelled=!0,OT(t))},ET=async function(e={}){let t=this.state,{blobClient:n,copySource:r,startCopyFromURLOptions:i}=t;if(!t.isStarted){t.isStarted=!0;let e=await n.startCopyFromURL(r,i);t.copyId=e.copyId,e.copyStatus===`success`&&(t.result=e,t.isCompleted=!0)}else if(!t.isCompleted)try{let n=await t.blobClient.getProperties({abortSignal:e.abortSignal}),{copyStatus:r,copyProgress:i}=n,a=t.copyProgress;i&&(t.copyProgress=i),r===`pending`&&i!==a&&typeof e.fireProgress==`function`?e.fireProgress(t):r===`success`?(t.result=n,t.isCompleted=!0):r===`failed`&&(t.error=Error(`Blob copy failed with reason: "${n.copyStatusDescription||`unknown`}"`),t.isCompleted=!0)}catch(e){t.error=e,t.isCompleted=!0}return OT(t)},DT=function(){return JSON.stringify({state:this.state},(e,t)=>{if(e!==`blobClient`)return t})};function OT(e){return{state:{...e},cancel:TT,toString:DT,update:ET}}function kT(e){if(e.offset<0)throw RangeError(`Range.offset cannot be smaller than 0.`);if(e.count&&e.count<=0)throw RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);return e.count?`bytes=${e.offset}-${e.offset+e.count-1}`:`bytes=${e.offset}-`}var AT;(function(e){e[e.Good=0]=`Good`,e[e.Error=1]=`Error`})(AT||={});var jT=class{concurrency;actives=0;completed=0;offset=0;operations=[];state=AT.Good;emitter;constructor(e=5){if(e<1)throw RangeError(`concurrency must be larger than 0`);this.concurrency=e,this.emitter=new y}addOperation(e){this.operations.push(async()=>{try{this.actives++,await e(),this.actives--,this.completed++,this.parallelExecute()}catch(e){this.emitter.emit(`error`,e)}})}async do(){return this.operations.length===0?Promise.resolve():(this.parallelExecute(),new Promise((e,t)=>{this.emitter.on(`finish`,e),this.emitter.on(`error`,e=>{this.state=AT.Error,t(e)})}))}nextOperation(){return this.offset=this.operations.length){this.emitter.emit(`finish`);return}for(;this.actives{let c=setTimeout(()=>s(Error(`The operation cannot be completed in timeout.`)),1e5);e.on(`readable`,()=>{if(a>=o){clearTimeout(c),r();return}let s=e.read();if(!s)return;typeof s==`string`&&(s=Buffer.from(s,i));let l=a+s.length>o?o-a:s.length;t.fill(s.slice(0,l),n+a,n+a+l),a+=l}),e.on(`end`,()=>{clearTimeout(c),a{clearTimeout(c),s(e)})})}async function NT(e,t){return new Promise((n,r)=>{let i=H.createWriteStream(t);e.on(`error`,e=>{r(e)}),i.on(`error`,e=>{r(e)}),i.on(`close`,n),e.pipe(i)})}const PT=D.promisify(H.stat),FT=H.createReadStream;var IT=class e extends Mw{blobContext;_name;_containerName;_versionId;_snapshot;get name(){return this._name}get containerName(){return this._containerName}constructor(e,t,n,r){r||={};let i,a;if(vg(t))a=e,i=t;else if(Gu&&t instanceof Jh||t instanceof Vh||Id(t))a=e,r=n,i=bg(t,r);else if(!t&&typeof t!=`string`)a=e,n&&typeof n!=`string`&&(r=n),i=bg(new Vh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=uw(e);if(c.kind===`AccountConnString`)if(Gu){let e=new Jh(c.accountName,c.accountKey);a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=ed(c.proxyUri),i=bg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=bg(new Vh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),{blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl(),this.blobContext=this.storageClientContext.blob,this._snapshot=mw(this.url,mg.Parameters.SNAPSHOT),this._versionId=mw(this.url,mg.Parameters.VERSIONID)}withSnapshot(t){return new e(pw(this.url,mg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}withVersion(t){return new e(pw(this.url,mg.Parameters.VERSIONID,t.length===0?void 0:t),this.pipeline)}getAppendBlobClient(){return new LT(this.url,this.pipeline)}getBlockBlobClient(){return new RT(this.url,this.pipeline)}getPageBlobClient(){return new zT(this.url,this.pipeline)}async download(e=0,t,n={}){return n.conditions=n.conditions||{},n.conditions=n.conditions||{},vT(n.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-download`,n,async r=>{let i=jw(await this.blobContext.download({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onDownloadProgress:Gu?void 0:n.onProgress},range:e===0&&!t?void 0:kT({offset:e,count:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey,tracingOptions:r.tracingOptions})),a={...i,_response:i._response,objectReplicationDestinationPolicyId:i.objectReplicationPolicyId,objectReplicationSourceProperties:Ow(i.objectReplicationRules)};if(!Gu)return a;if((n.maxRetryRequests===void 0||n.maxRetryRequests<0)&&(n.maxRetryRequests=5),i.contentLength===void 0)throw RangeError(`File download response doesn't contain valid content length header`);if(!i.etag)throw RangeError(`File download response doesn't contain valid etag header`);return new Zw(a,async t=>{let r={leaseAccessConditions:n.conditions,modifiedAccessConditions:{ifMatch:n.conditions.ifMatch||i.etag,ifModifiedSince:n.conditions.ifModifiedSince,ifNoneMatch:n.conditions.ifNoneMatch,ifUnmodifiedSince:n.conditions.ifUnmodifiedSince,ifTags:n.conditions?.tagConditions},range:kT({count:e+i.contentLength-t,offset:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey};return(await this.blobContext.download({abortSignal:n.abortSignal,...r})).readableStreamBody},e,i.contentLength,{maxRetryRequests:n.maxRetryRequests,onProgress:n.onProgress})})}async exists(e={}){return Q.withSpan(`BlobClient-exists`,e,async t=>{try{return vT(e.customerProvidedKey,this.isHttps),await this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:t.tracingOptions}),!0}catch(e){if(e.statusCode===404)return!1;if(e.statusCode===409&&(e.details.errorCode===`BlobUsesCustomerSpecifiedEncryption`||e.details.errorCode===`BlobDoesNotUseCustomerSpecifiedEncryption`))return!0;throw e}})}async getProperties(e={}){return e.conditions=e.conditions||{},vT(e.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-getProperties`,e,async t=>{let n=jw(await this.blobContext.getProperties({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,objectReplicationDestinationPolicyId:n.objectReplicationPolicyId,objectReplicationSourceProperties:Ow(n.objectReplicationRules)}})}async delete(e={}){return e.conditions=e.conditions||{},Q.withSpan(`BlobClient-delete`,e,async t=>jw(await this.blobContext.delete({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async deleteIfExists(e={}){return Q.withSpan(`BlobClient-deleteIfExists`,e,async e=>{try{let t=jw(await this.delete(e));return{succeeded:!0,...t,_response:t._response}}catch(e){if(e.details?.errorCode===`BlobNotFound`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async undelete(e={}){return Q.withSpan(`BlobClient-undelete`,e,async t=>jw(await this.blobContext.undelete({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async setHTTPHeaders(e,t={}){return t.conditions=t.conditions||{},vT(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-setHTTPHeaders`,t,async n=>jw(await this.blobContext.setHttpHeaders({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}async setMetadata(e,t={}){return t.conditions=t.conditions||{},vT(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-setMetadata`,t,async n=>jw(await this.blobContext.setMetadata({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async setTags(e,t={}){return Q.withSpan(`BlobClient-setTags`,t,async n=>jw(await this.blobContext.setTags({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},blobModifiedAccessConditions:t.conditions,tracingOptions:n.tracingOptions,tags:Tw(e)})))}async getTags(e={}){return Q.withSpan(`BlobClient-getTags`,e,async t=>{let n=jw(await this.blobContext.getTags({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},blobModifiedAccessConditions:e.conditions,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,tags:Ew({blobTagSet:n.blobTagSet})||{}}})}getBlobLeaseClient(e){return new Yw(this,e)}async createSnapshot(e={}){return e.conditions=e.conditions||{},vT(e.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-createSnapshot`,e,async t=>jw(await this.blobContext.createSnapshot({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,tracingOptions:t.tracingOptions})))}async beginCopyFromURL(e,t={}){let n=new wT({blobClient:{abortCopyFromURL:(...e)=>this.abortCopyFromURL(...e),getProperties:(...e)=>this.getProperties(...e),startCopyFromURL:(...e)=>this.startCopyFromURL(...e)},copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return await n.poll(),n}async abortCopyFromURL(e,t={}){return Q.withSpan(`BlobClient-abortCopyFromURL`,t,async n=>jw(await this.blobContext.abortCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,tracingOptions:n.tracingOptions})))}async syncCopyFromURL(e,t={}){return t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},Q.withSpan(`BlobClient-syncCopyFromURL`,t,async n=>jw(await this.blobContext.copyFromURL(e,{abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:kw(t.sourceAuthorization),tier:_T(t.tier),blobTagsString:ww(t.tags),immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,encryptionScope:t.encryptionScope,copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async setAccessTier(e,t={}){return Q.withSpan(`BlobClient-setAccessTier`,t,async n=>jw(await this.blobContext.setTier(_T(e),{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},rehydratePriority:t.rehydratePriority,tracingOptions:n.tracingOptions})))}async downloadToBuffer(e,t,n,r={}){let i,a=0,o=0,s=r;e instanceof Buffer?(i=e,a=t||0,o=typeof n==`number`?n:0):(a=typeof e==`number`?e:0,o=typeof t==`number`?t:0,s=n||{});let c=s.blockSize??0;if(c<0)throw RangeError(`blockSize option must be >= 0`);if(c===0&&(c=pg),a<0)throw RangeError(`offset option must be >= 0`);if(o&&o<=0)throw RangeError(`count option must be greater than 0`);return s.conditions||={},Q.withSpan(`BlobClient-downloadToBuffer`,s,async e=>{if(!o){let t=await this.getProperties({...s,tracingOptions:e.tracingOptions});if(o=t.contentLength-a,o<0)throw RangeError(`offset ${a} shouldn't be larger than blob size ${t.contentLength}`)}if(!i)try{i=Buffer.alloc(o)}catch(e){throw Error(`Unable to allocate the buffer of size: ${o}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${e.message}`)}if(i.length{let n=a+o;r+c{let a=await this.download(t,n,{...r,tracingOptions:i.tracingOptions});return a.readableStreamBody&&await NT(a.readableStreamBody,e),a.blobDownloadStream=void 0,a})}getBlobAndContainerNamesFromUrl(){let e,t;try{let n=new URL(this.url);if(n.host.split(`.`)[1]===`blob`){let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}else if(Cw(n)){let r=n.pathname.match(`/([^/]*)/([^/]*)(/(.*))?`);e=r[2],t=r[4]}else{let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}if(e=decodeURIComponent(e),t=decodeURIComponent(t),t=t.replace(/\\/g,`/`),!e)throw Error(`Provided containerName is invalid.`);return{blobName:t,containerName:e}}catch{throw Error(`Unable to extract blobName and containerName with provided information.`)}}async startCopyFromURL(e,t={}){return Q.withSpan(`BlobClient-startCopyFromURL`,t,async n=>(t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},jw(await this.blobContext.startCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:_T(t.tier),blobTagsString:ww(t.tags),sealBlob:t.sealBlob,tracingOptions:n.tracingOptions}))))}generateSasUrl(e){return new Promise(t=>{if(!(this.credential instanceof Jh))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);let n=Rw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).toString();t(gw(this.url,n))})}generateSasStringToSign(e){if(!(this.credential instanceof Jh))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);return zw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).stringToSign}generateUserDelegationSasUrl(e,t){return new Promise(n=>{let r=Rw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).toString();n(gw(this.url,r))})}generateUserDelegationSasStringToSign(e,t){return zw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).stringToSign}async deleteImmutabilityPolicy(e={}){return Q.withSpan(`BlobClient-deleteImmutabilityPolicy`,e,async e=>jw(await this.blobContext.deleteImmutabilityPolicy({tracingOptions:e.tracingOptions})))}async setImmutabilityPolicy(e,t={}){return Q.withSpan(`BlobClient-setImmutabilityPolicy`,t,async t=>jw(await this.blobContext.setImmutabilityPolicy({immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,tracingOptions:t.tracingOptions})))}async setLegalHold(e,t={}){return Q.withSpan(`BlobClient-setLegalHold`,t,async t=>jw(await this.blobContext.setLegalHold(e,{tracingOptions:t.tracingOptions})))}async getAccountInfo(e={}){return Q.withSpan(`BlobClient-getAccountInfo`,e,async t=>jw(await this.blobContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}},LT=class e extends IT{appendBlobContext;constructor(e,t,n,r){let i,a;if(r||={},vg(t))a=e,i=t;else if(Gu&&t instanceof Jh||t instanceof Vh||Id(t))a=e,r=n,i=bg(t,r);else if(!t&&typeof t!=`string`)a=e,i=bg(new Vh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=uw(e);if(c.kind===`AccountConnString`)if(Gu){let e=new Jh(c.accountName,c.accountKey);a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=ed(c.proxyUri),i=bg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=bg(new Vh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.appendBlobContext=this.storageClientContext.appendBlob}withSnapshot(t){return new e(pw(this.url,mg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e={}){return e.conditions=e.conditions||{},vT(e.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-create`,e,async t=>jw(await this.appendBlobContext.create(0,{abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:e.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:e.immutabilityPolicy?.policyMode,legalHold:e.legalHold,blobTagsString:ww(e.tags),tracingOptions:t.tracingOptions})))}async createIfNotExists(e={}){let t={ifNoneMatch:`*`};return Q.withSpan(`AppendBlobClient-createIfNotExists`,e,async e=>{try{let n=jw(await this.create({...e,conditions:t}));return{succeeded:!0,...n,_response:n._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async seal(e={}){return e.conditions=e.conditions||{},Q.withSpan(`AppendBlobClient-seal`,e,async t=>jw(await this.appendBlobContext.seal({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async appendBlock(e,t,n={}){return n.conditions=n.conditions||{},vT(n.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-appendBlock`,n,async r=>jw(await this.appendBlobContext.appendBlock(t,e,{abortSignal:n.abortSignal,appendPositionAccessConditions:n.conditions,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},transactionalContentMD5:n.transactionalContentMD5,transactionalContentCrc64:n.transactionalContentCrc64,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async appendBlockFromURL(e,t,n,r={}){return r.conditions=r.conditions||{},r.sourceConditions=r.sourceConditions||{},vT(r.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-appendBlockFromURL`,r,async i=>jw(await this.appendBlobContext.appendBlockFromUrl(e,0,{abortSignal:r.abortSignal,sourceRange:kT({offset:t,count:n}),sourceContentMD5:r.sourceContentMD5,sourceContentCrc64:r.sourceContentCrc64,leaseAccessConditions:r.conditions,appendPositionAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:r.sourceConditions?.ifMatch,sourceIfModifiedSince:r.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:r.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:r.sourceConditions?.ifUnmodifiedSince},copySourceAuthorization:kw(r.sourceAuthorization),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,fileRequestIntent:r.sourceShareTokenIntent,tracingOptions:i.tracingOptions})))}},RT=class e extends IT{_blobContext;blockBlobContext;constructor(e,t,n,r){let i,a;if(r||={},vg(t))a=e,i=t;else if(Gu&&t instanceof Jh||t instanceof Vh||Id(t))a=e,r=n,i=bg(t,r);else if(!t&&typeof t!=`string`)a=e,n&&typeof n!=`string`&&(r=n),i=bg(new Vh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=uw(e);if(c.kind===`AccountConnString`)if(Gu){let e=new Jh(c.accountName,c.accountKey);a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=ed(c.proxyUri),i=bg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=bg(new Vh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.blockBlobContext=this.storageClientContext.blockBlob,this._blobContext=this.storageClientContext.blob}withSnapshot(t){return new e(pw(this.url,mg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async query(e,t={}){if(vT(t.customerProvidedKey,this.isHttps),!Gu)throw Error(`This operation currently is only supported in Node.js.`);return Q.withSpan(`BlockBlobClient-query`,t,async n=>new mT(jw(await this._blobContext.query({abortSignal:t.abortSignal,queryRequest:{queryType:`SQL`,expression:e,inputSerialization:Dw(t.inputTextConfiguration),outputSerialization:Dw(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,tracingOptions:n.tracingOptions})),{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError}))}async upload(e,t,n={}){return n.conditions=n.conditions||{},vT(n.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-upload`,n,async r=>jw(await this.blockBlobContext.upload(t,e,{abortSignal:n.abortSignal,blobHttpHeaders:n.blobHTTPHeaders,leaseAccessConditions:n.conditions,metadata:n.metadata,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,immutabilityPolicyExpiry:n.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:n.immutabilityPolicy?.policyMode,legalHold:n.legalHold,tier:_T(n.tier),blobTagsString:ww(n.tags),tracingOptions:r.tracingOptions})))}async syncUploadFromURL(e,t={}){return t.conditions=t.conditions||{},vT(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-syncUploadFromURL`,t,async n=>jw(await this.blockBlobContext.putBlobFromUrl(0,e,{...t,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince,sourceIfTags:t.sourceConditions?.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:kw(t.sourceAuthorization),tier:_T(t.tier),blobTagsString:ww(t.tags),copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async stageBlock(e,t,n,r={}){return vT(r.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-stageBlock`,r,async i=>jw(await this.blockBlobContext.stageBlock(e,n,t,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async stageBlockFromURL(e,t,n=0,r,i={}){return vT(i.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-stageBlockFromURL`,i,async a=>jw(await this.blockBlobContext.stageBlockFromURL(e,0,t,{abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,sourceRange:n===0&&!r?void 0:kT({offset:n,count:r}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:kw(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async commitBlockList(e,t={}){return t.conditions=t.conditions||{},vT(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-commitBlockList`,t,async n=>jw(await this.blockBlobContext.commitBlockList({latest:e},{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:_T(t.tier),blobTagsString:ww(t.tags),tracingOptions:n.tracingOptions})))}async getBlockList(e,t={}){return Q.withSpan(`BlockBlobClient-getBlockList`,t,async n=>{let r=jw(await this.blockBlobContext.getBlockList(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return r.committedBlocks||=[],r.uncommittedBlocks||=[],r})}async uploadData(e,t={}){return Q.withSpan(`BlockBlobClient-uploadData`,t,async t=>{if(Gu){let n;return e instanceof Buffer?n=e:e instanceof ArrayBuffer?n=Buffer.from(e):(e=e,n=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.byteLength,t)}else{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)}})}async uploadBrowserData(e,t={}){return Q.withSpan(`BlockBlobClient-uploadBrowserData`,t,async t=>{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)})}async uploadSeekableInternal(e,t,n={}){let r=n.blockSize??0;if(r<0||r>4194304e3)throw RangeError(`blockSize option must be >= 0 and <= 4194304000`);let i=n.maxSingleShotSize??268435456;if(i<0||i>268435456)throw RangeError(`maxSingleShotSize option must be >= 0 and <= 268435456`);if(r===0){if(t>4194304e3*5e4)throw RangeError(`${t} is too larger to upload to a block blob.`);t>i&&(r=Math.ceil(t/fg),r<4194304&&(r=pg))}return n.blobHTTPHeaders||={},n.conditions||={},Q.withSpan(`BlockBlobClient-uploadSeekableInternal`,n,async a=>{if(t<=i)return jw(await this.upload(e(0,t),t,a));let o=Math.floor((t-1)/r)+1;if(o>5e4)throw RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${fg}`);let s=[],c=Wu(),l=0,u=new jT(n.concurrency);for(let i=0;i{let u=yw(c,i),d=r*i,f=(i===o-1?t:d+r)-d;s.push(u),await this.stageBlock(u,e(d,f),f,{abortSignal:n.abortSignal,conditions:n.conditions,encryptionScope:n.encryptionScope,tracingOptions:a.tracingOptions}),l+=f,n.onProgress&&n.onProgress({loadedBytes:l})});return await u.do(),this.commitBlockList(s,a)})}async uploadFile(e,t={}){return Q.withSpan(`BlockBlobClient-uploadFile`,t,async n=>{let r=(await PT(e)).size;return this.uploadSeekableInternal((t,n)=>()=>FT(e,{autoClose:!0,end:n?t+n-1:1/0,start:t}),r,{...t,tracingOptions:n.tracingOptions})})}async uploadStream(e,t=8388608,n=5,r={}){return r.blobHTTPHeaders||={},r.conditions||={},Q.withSpan(`BlockBlobClient-uploadStream`,r,async i=>{let a=0,o=Wu(),s=0,c=[];return await new Th(e,t,n,async(e,t)=>{let n=yw(o,a);c.push(n),a++,await this.stageBlock(n,e,t,{customerProvidedKey:r.customerProvidedKey,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions}),s+=t,r.onProgress&&r.onProgress({loadedBytes:s})},Math.ceil(n/4*3)).do(),jw(await this.commitBlockList(c,{...r,tracingOptions:i.tracingOptions}))})}},zT=class e extends IT{pageBlobContext;constructor(e,t,n,r){let i,a;if(r||={},vg(t))a=e,i=t;else if(Gu&&t instanceof Jh||t instanceof Vh||Id(t))a=e,r=n,i=bg(t,r);else if(!t&&typeof t!=`string`)a=e,i=bg(new Vh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=uw(e);if(c.kind===`AccountConnString`)if(Gu){let e=new Jh(c.accountName,c.accountKey);a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=ed(c.proxyUri),i=bg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=fw(fw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=bg(new Vh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.pageBlobContext=this.storageClientContext.pageBlob}withSnapshot(t){return new e(pw(this.url,mg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e,t={}){return t.conditions=t.conditions||{},vT(t.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-create`,t,async n=>jw(await this.pageBlobContext.create(0,e,{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:_T(t.tier),blobTagsString:ww(t.tags),tracingOptions:n.tracingOptions})))}async createIfNotExists(e,t={}){return Q.withSpan(`PageBlobClient-createIfNotExists`,t,async n=>{try{let r={ifNoneMatch:`*`},i=jw(await this.create(e,{...t,conditions:r,tracingOptions:n.tracingOptions}));return{succeeded:!0,...i,_response:i._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async uploadPages(e,t,n,r={}){return r.conditions=r.conditions||{},vT(r.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-uploadPages`,r,async i=>jw(await this.pageBlobContext.uploadPages(n,e,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},requestOptions:{onUploadProgress:r.onProgress},range:kT({offset:t,count:n}),sequenceNumberAccessConditions:r.conditions,transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async uploadPagesFromURL(e,t,n,r,i={}){return i.conditions=i.conditions||{},i.sourceConditions=i.sourceConditions||{},vT(i.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-uploadPagesFromURL`,i,async a=>jw(await this.pageBlobContext.uploadPagesFromURL(e,kT({offset:t,count:r}),0,kT({offset:n,count:r}),{abortSignal:i.abortSignal,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,leaseAccessConditions:i.conditions,sequenceNumberAccessConditions:i.conditions,modifiedAccessConditions:{...i.conditions,ifTags:i.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions?.ifMatch,sourceIfModifiedSince:i.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions?.ifUnmodifiedSince},cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:kw(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async clearPages(e=0,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-clearPages`,n,async r=>jw(await this.pageBlobContext.clearPages(0,{abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:kT({offset:e,count:t}),sequenceNumberAccessConditions:n.conditions,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async getPageRanges(e=0,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-getPageRanges`,n,async r=>bT(jw(await this.pageBlobContext.getPageRanges({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:kT({offset:e,count:t}),tracingOptions:r.tracingOptions}))))}async listPageRangesSegment(e=0,t,n,r={}){return Q.withSpan(`PageBlobClient-getPageRangesSegment`,r,async i=>jw(await this.pageBlobContext.getPageRanges({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},range:kT({offset:e,count:t}),marker:n,maxPageSize:r.maxPageSize,tracingOptions:i.tracingOptions})))}async*listPageRangeItemSegments(e=0,t,n,r={}){let i;if(n||n===void 0)do i=await this.listPageRangesSegment(e,t,n,r),n=i.continuationToken,yield await i;while(n)}async*listPageRangeItems(e=0,t,n={}){for await(let r of this.listPageRangeItemSegments(e,t,void 0,n))yield*Aw(r)}listPageRanges(e=0,t,n={}){n.conditions=n.conditions||{};let r=this.listPageRangeItems(e,t,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listPageRangeItemSegments(e,t,r.continuationToken,{maxPageSize:r.maxPageSize,...n})}}async getPageRangesDiff(e,t,n,r={}){return r.conditions=r.conditions||{},Q.withSpan(`PageBlobClient-getPageRangesDiff`,r,async i=>bT(jw(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevsnapshot:n,range:kT({offset:e,count:t}),tracingOptions:i.tracingOptions}))))}async listPageRangesDiffSegment(e,t,n,r,i={}){return Q.withSpan(`PageBlobClient-getPageRangesDiffSegment`,i,async a=>jw(await this.pageBlobContext.getPageRangesDiff({abortSignal:i?.abortSignal,leaseAccessConditions:i?.conditions,modifiedAccessConditions:{...i?.conditions,ifTags:i?.conditions?.tagConditions},prevsnapshot:n,range:kT({offset:e,count:t}),marker:r,maxPageSize:i?.maxPageSize,tracingOptions:a.tracingOptions})))}async*listPageRangeDiffItemSegments(e,t,n,r,i){let a;if(r||r===void 0)do a=await this.listPageRangesDiffSegment(e,t,n,r,i),r=a.continuationToken,yield await a;while(r)}async*listPageRangeDiffItems(e,t,n,r){for await(let i of this.listPageRangeDiffItemSegments(e,t,n,void 0,r))yield*Aw(i)}listPageRangesDiff(e,t,n,r={}){r.conditions=r.conditions||{};let i=this.listPageRangeDiffItems(e,t,n,{...r});return{next(){return i.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.listPageRangeDiffItemSegments(e,t,n,i.continuationToken,{maxPageSize:i.maxPageSize,...r})}}async getPageRangesDiffForManagedDisks(e,t,n,r={}){return r.conditions=r.conditions||{},Q.withSpan(`PageBlobClient-GetPageRangesDiffForManagedDisks`,r,async i=>bT(jw(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevSnapshotUrl:n,range:kT({offset:e,count:t}),tracingOptions:i.tracingOptions}))))}async resize(e,t={}){return t.conditions=t.conditions||{},Q.withSpan(`PageBlobClient-resize`,t,async n=>jw(await this.pageBlobContext.resize(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async updateSequenceNumber(e,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-updateSequenceNumber`,n,async r=>jw(await this.pageBlobContext.updateSequenceNumber(e,{abortSignal:n.abortSignal,blobSequenceNumber:t,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},tracingOptions:r.tracingOptions})))}async startCopyIncremental(e,t={}){return Q.withSpan(`PageBlobClient-startCopyIncremental`,t,async n=>jw(await this.pageBlobContext.copyIncremental(e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}},BT=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},VT=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};VT.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var HT=class extends Error{constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries. Usage is recalculated every 6-12 hours. -More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name=`UsageError`}};HT.isUsageErrorMessage=e=>e?e.includes(`insufficient usage`):!1;var UT=class extends Error{constructor(e){super(e),this.name=`RateLimitError`}},WT=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},GT=class{constructor(e){this.contentLength=e,this.sentBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}setSentBytes(e){this.sentBytes=e}getTransferredBytes(){return this.sentBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.sentBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);jr(`Sent ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setSentBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};function KT(e,t,n){return WT(this,void 0,void 0,function*(){let r=new IT(e),i=r.getBlockBlobClient(),a=new GT(n?.archiveSizeBytes??0),o={blockSize:n?.uploadChunkSize,concurrency:n?.uploadConcurrency,maxSingleShotSize:128*1024*1024,onProgress:a.onProgress()};try{a.startDisplayTimer(),G(`BlobClient: ${r.name}:${r.accountName}:${r.containerName}`);let e=yield i.uploadFile(t,o);if(e._response.status>=400)throw new BT(`uploadCacheArchiveSDK: upload failed with status code ${e._response.status}`);return e}catch(e){throw Ar(`uploadCacheArchiveSDK: internal error uploading cache archive: ${e.message}`),e}finally{a.stopDisplayTimer()}})}var qT=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function JT(e){return e?e>=200&&e<300:!1}function YT(e){return e?e>=500:!0}function XT(e){return e?[bn.BadGateway,bn.ServiceUnavailable,bn.GatewayTimeout].includes(e):!1}function ZT(e){return qT(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}function QT(e,t,n){return qT(this,arguments,void 0,function*(e,t,n,r=2,i=Us,a=void 0){let o=``,s=1;for(;s<=r;){let c,l,u=!1;try{c=yield t()}catch(e){a&&(c=a(e)),u=!0,o=e.message}if(c&&(l=n(c),!YT(l)))return c;if(l&&(u=XT(l),o=`Cache service responded with ${l}`),G(`${e} - Attempt ${s} of ${r} failed with error: ${o}`),!u){G(`${e} - Error is not retryable`);break}yield ZT(i),s++}throw Error(`${e} failed: ${o}`)})}function $T(e,t){return qT(this,arguments,void 0,function*(e,t,n=2,r=Us){return yield QT(e,t,e=>e.statusCode,n,r,e=>{if(e instanceof En)return{statusCode:e.statusCode,result:null,headers:{},error:e}})})}function eE(e,t){return qT(this,arguments,void 0,function*(e,t,n=2,r=Us){return yield QT(e,t,e=>e.message.statusCode,n,r)})}var tE=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function nE(e,t){return tE(this,void 0,void 0,function*(){yield S.promisify(z.pipeline)(e.message,t)})}var rE=class{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset+=this.segmentSize,this.segmentIndex+=1,this.segmentSize=e,this.receivedBytes=0,G(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.receivedBytes=e}getTransferredBytes(){return this.segmentOffset+this.receivedBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);jr(`Received ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};function iE(e,t){return tE(this,void 0,void 0,function*(){let n=o.createWriteStream(t),r=new On(`actions/cache`),i=yield eE(`downloadCache`,()=>tE(this,void 0,void 0,function*(){return r.get(e)}));i.message.socket.setTimeout(Ws,()=>{i.message.destroy(),G(`Aborting download, socket timed out after ${Ws} ms`)}),yield nE(i,n);let a=i.message.headers[`content-length`];if(a){let e=parseInt(a),n=$s(t);if(n!==e)throw Error(`Incomplete download. Expected file size: ${e}, actual file size: ${n}`)}else G(`Unable to validate download, no Content-Length header`)})}function aE(e,t,n){return tE(this,void 0,void 0,function*(){let r=yield o.promises.open(t,`w`),i=new On(`actions/cache`,void 0,{socketTimeout:n.timeoutInMs,keepAlive:!0});try{let t=(yield eE(`downloadCacheMetadata`,()=>tE(this,void 0,void 0,function*(){return yield i.request(`HEAD`,e,null,{})}))).message.headers[`content-length`];if(t==null)throw Error(`Content-Length not found on blob response`);let a=parseInt(t);if(Number.isNaN(a))throw Error(`Could not interpret Content-Length: ${a}`);let o=[],s=4*1024*1024;for(let t=0;ttE(this,void 0,void 0,function*(){return yield oE(i,e,t,n)})})}o.reverse();let c=0,l=0,u=new rE(a);u.startDisplayTimer();let d=u.onProgress(),f=[],p,m=()=>tE(this,void 0,void 0,function*(){let e=yield Promise.race(Object.values(f));yield r.write(e.buffer,0,e.count,e.offset),c--,delete f[e.offset],l+=e.count,d({loadedBytes:l})});for(;p=o.pop();)f[p.offset]=p.promiseGetter(),c++,c>=(n.downloadConcurrency??10)&&(yield m());for(;c>0;)yield m()}finally{i.dispose(),yield r.close()}})}function oE(e,t,n,r){return tE(this,void 0,void 0,function*(){let i=0;for(;;)try{let i=yield lE(3e4,sE(e,t,n,r));if(typeof i==`string`)throw Error(`downloadSegmentRetry failed due to timeout`);return i}catch(e){if(i>=5)throw e;i++}})}function sE(e,t,n,r){return tE(this,void 0,void 0,function*(){let i=yield eE(`downloadCachePart`,()=>tE(this,void 0,void 0,function*(){return yield e.get(t,{Range:`bytes=${n}-${n+r-1}`})}));if(!i.readBodyBuffer)throw Error(`Expected HttpClientResponse to implement readBodyBuffer`);return{offset:n,count:r,buffer:yield i.readBodyBuffer()}})}function cE(e,t,n){return tE(this,void 0,void 0,function*(){let r=new RT(e,void 0,{retryOptions:{tryTimeoutInMs:n.timeoutInMs}}),i=(yield r.getProperties()).contentLength??-1;if(i<0)G(`Unable to determine content length, downloading file with http-client...`),yield iE(e,t);else{let e=Math.min(134217728,V.constants.MAX_LENGTH),a=new rE(i),s=o.openSync(t,`w`);try{a.startDisplayTimer();let t=new AbortController,c=t.signal;for(;!a.isDone();){let l=a.segmentOffset+a.segmentSize,u=Math.min(e,i-l);a.nextSegment(u);let d=yield lE(n.segmentTimeoutInMs||36e5,r.downloadToBuffer(l,u,{abortSignal:c,concurrency:n.downloadConcurrency,onProgress:a.onProgress()}));if(d===`timeout`)throw t.abort(),Error(`Aborting cache download as the download time exceeded the timeout.`);Buffer.isBuffer(d)&&o.writeFileSync(s,d)}}finally{a.stopDisplayTimer(),o.closeSync(s)}}})}const lE=(e,t)=>tE(void 0,void 0,void 0,function*(){let n,r=new Promise(t=>{n=setTimeout(()=>t(`timeout`),e)});return Promise.race([t,r]).then(e=>(clearTimeout(n),e))});function uE(e){let t={useAzureSdk:!1,uploadConcurrency:4,uploadChunkSize:32*1024*1024};return e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.uploadConcurrency==`number`&&(t.uploadConcurrency=e.uploadConcurrency),typeof e.uploadChunkSize==`number`&&(t.uploadChunkSize=e.uploadChunkSize)),t.uploadConcurrency=isNaN(Number(process.env.CACHE_UPLOAD_CONCURRENCY))?t.uploadConcurrency:Math.min(32,Number(process.env.CACHE_UPLOAD_CONCURRENCY)),t.uploadChunkSize=isNaN(Number(process.env.CACHE_UPLOAD_CHUNK_SIZE))?t.uploadChunkSize:Math.min(128*1024*1024,Number(process.env.CACHE_UPLOAD_CHUNK_SIZE)*1024*1024),G(`Use Azure SDK: ${t.useAzureSdk}`),G(`Upload concurrency: ${t.uploadConcurrency}`),G(`Upload chunk size: ${t.uploadChunkSize}`),t}function dE(e){let t={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.concurrentBlobDownloads==`boolean`&&(t.concurrentBlobDownloads=e.concurrentBlobDownloads),typeof e.downloadConcurrency==`number`&&(t.downloadConcurrency=e.downloadConcurrency),typeof e.timeoutInMs==`number`&&(t.timeoutInMs=e.timeoutInMs),typeof e.segmentTimeoutInMs==`number`&&(t.segmentTimeoutInMs=e.segmentTimeoutInMs),typeof e.lookupOnly==`boolean`&&(t.lookupOnly=e.lookupOnly));let n=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return n&&!isNaN(Number(n))&&isFinite(Number(n))&&(t.segmentTimeoutInMs=Number(n)*60*1e3),G(`Use Azure SDK: ${t.useAzureSdk}`),G(`Download concurrency: ${t.downloadConcurrency}`),G(`Request timeout (ms): ${t.timeoutInMs}`),G(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),G(`Segment download timeout (ms): ${t.segmentTimeoutInMs}`),G(`Lookup only: ${t.lookupOnly}`),t}function fE(){let e=new URL(process.env.GITHUB_SERVER_URL||`https://github.com`).hostname.trimEnd().toUpperCase(),t=e===`GITHUB.COM`,n=e.endsWith(`.GHE.COM`),r=e.endsWith(`.LOCALHOST`);return!t&&!n&&!r}function pE(){return fE()?`v1`:process.env.ACTIONS_CACHE_SERVICE_V2?`v2`:`v1`}function mE(){let e=pE();switch(e){case`v1`:return process.env.ACTIONS_CACHE_URL||process.env.ACTIONS_RESULTS_URL||``;case`v2`:return process.env.ACTIONS_RESULTS_URL||``;default:throw Error(`Unsupported cache service version: ${e}`)}}var hE=U(((e,t)=>{t.exports={name:`@actions/cache`,version:`6.0.0`,description:`Actions cache lib`,keywords:[`github`,`actions`,`cache`],homepage:`https://github.com/actions/toolkit/tree/main/packages/cache`,license:`MIT`,type:`module`,main:`lib/cache.js`,types:`lib/cache.d.ts`,exports:{".":{types:`./lib/cache.d.ts`,import:`./lib/cache.js`}},directories:{lib:`lib`,test:`__tests__`},files:[`lib`,`!.DS_Store`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/actions/toolkit.git`,directory:`packages/cache`},scripts:{"audit-moderate":`npm install && npm audit --json --audit-level=moderate > audit.json`,test:`echo "Error: run tests from root" && exit 1`,tsc:`tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/`},bugs:{url:`https://github.com/actions/toolkit/issues`},dependencies:{"@actions/core":`^3.0.0`,"@actions/exec":`^3.0.0`,"@actions/glob":`^0.6.1`,"@actions/http-client":`^4.0.0`,"@actions/io":`^3.0.0`,"@azure/core-rest-pipeline":`^1.22.0`,"@azure/storage-blob":`^12.30.0`,"@protobuf-ts/runtime-rpc":`^2.11.1`,semver:`^7.7.3`},devDependencies:{"@protobuf-ts/plugin":`^2.9.4`,"@types/node":`^25.1.0`,"@types/semver":`^7.7.1`,typescript:`^5.2.2`},overrides:{"uri-js":`npm:uri-js-replace@^1.0.1`,"node-fetch":`^3.3.2`}}})),gE=U(((e,t)=>{t.exports={version:hE().version}}))();function _E(){return`@actions/cache-${gE.version}`}var vE=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function yE(e){let t=mE();if(!t)throw Error(`Cache Service Url not found, unable to restore cache.`);let n=`${t}_apis/artifactcache/${e}`;return G(`Resource Url: ${n}`),n}function bE(e,t){return`${e};api-version=${t}`}function xE(){return{headers:{Accept:bE(`application/json`,`6.0-preview.1`)}}}function SE(){let e=new jn(process.env.ACTIONS_RUNTIME_TOKEN||``);return new On(_E(),[e],xE())}function CE(e,t,n){return vE(this,void 0,void 0,function*(){let r=SE(),i=sc(t,n?.compressionMethod,n?.enableCrossOsArchive),a=`cache?keys=${encodeURIComponent(e.join(`,`))}&version=${i}`,o=yield $T(`getCacheEntry`,()=>vE(this,void 0,void 0,function*(){return r.getJson(yE(a))}));if(o.statusCode===204)return Or()&&(yield wE(e[0],r,i)),null;if(!JT(o.statusCode))throw Error(`Cache service responded with ${o.statusCode}`);let s=o.result,c=s?.archiveLocation;if(!c)throw Error(`Cache not found.`);return Cr(c),G(`Cache Result:`),G(JSON.stringify(s)),s})}function wE(e,t,n){return vE(this,void 0,void 0,function*(){let r=`caches?key=${encodeURIComponent(e)}`,i=yield $T(`listCache`,()=>vE(this,void 0,void 0,function*(){return t.getJson(yE(r))}));if(i.statusCode===200){let t=i.result,r=t?.totalCount;if(r&&r>0){G(`No matching cache found for cache key '${e}', version '${n} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key \nOther caches with similar key:`);for(let e of t?.artifactCaches||[])G(`Cache Key: ${e?.cacheKey}, Cache Version: ${e?.cacheVersion}, Cache Scope: ${e?.scope}, Cache Created: ${e?.creationTime}`)}}})}function TE(e,t,n){return vE(this,void 0,void 0,function*(){let r=new B(e),i=dE(n);r.hostname.endsWith(`.blob.core.windows.net`)?i.useAzureSdk?yield cE(e,t,i):i.concurrentBlobDownloads?yield aE(e,t,i):yield iE(e,t):yield iE(e,t)})}function EE(e,t,n){return vE(this,void 0,void 0,function*(){let r=SE(),i={key:e,version:sc(t,n?.compressionMethod,n?.enableCrossOsArchive),cacheSize:n?.cacheSize};return yield $T(`reserveCache`,()=>vE(this,void 0,void 0,function*(){return r.postJson(yE(`caches`),i)}))})}function DE(e,t){return`bytes ${e}-${t}/*`}function OE(e,t,n,r,i){return vE(this,void 0,void 0,function*(){G(`Uploading chunk of size ${i-r+1} bytes at offset ${r} with content range: ${DE(r,i)}`);let a={"Content-Type":`application/octet-stream`,"Content-Range":DE(r,i)},o=yield eE(`uploadChunk (start: ${r}, end: ${i})`,()=>vE(this,void 0,void 0,function*(){return e.sendStream(`PATCH`,t,n(),a)}));if(!JT(o.message.statusCode))throw Error(`Cache service responded with ${o.message.statusCode} during upload chunk.`)})}function kE(e,t,n,r){return vE(this,void 0,void 0,function*(){let i=$s(n),a=yE(`caches/${t.toString()}`),s=o.openSync(n,`r`),c=uE(r),l=oc(`uploadConcurrency`,c.uploadConcurrency),u=oc(`uploadChunkSize`,c.uploadChunkSize),d=[...Array(l).keys()];G(`Awaiting all uploads`);let f=0;try{yield Promise.all(d.map(()=>vE(this,void 0,void 0,function*(){for(;fo.createReadStream(n,{fd:s,start:r,end:c,autoClose:!1}).on(`error`,e=>{throw Error(`Cache upload failed because file read failed with ${e.message}`)}),r,c)}})))}finally{o.closeSync(s)}})}function AE(e,t,n){return vE(this,void 0,void 0,function*(){let r={size:n};return yield $T(`commitCache`,()=>vE(this,void 0,void 0,function*(){return e.postJson(yE(`caches/${t.toString()}`),r)}))})}function jE(e,t,n,r){return vE(this,void 0,void 0,function*(){if(uE(r).useAzureSdk){if(!n)throw Error(`Azure Storage SDK can only be used when a signed URL is provided.`);yield KT(n,t,r)}else{let n=SE();G(`Upload cache`),yield kE(n,e,t,r),G(`Commiting cache`);let i=$s(t);jr(`Cache Size: ~${Math.round(i/(1024*1024))} MB (${i} B)`);let a=yield AE(n,e,i);if(!JT(a.statusCode))throw Error(`Cache service responded with ${a.statusCode} during commit cache.`);jr(`Cache saved successfully`)}})}var ME=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isJsonObject=e.typeofJsonValue=void 0;function t(e){let t=typeof e;if(t==`object`){if(Array.isArray(e))return`array`;if(e===null)return`null`}return t}e.typeofJsonValue=t;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}e.isJsonObject=n})),NE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.base64encode=e.base64decode=void 0;let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),n=[];for(let e=0;e>4,s=o,a=2;break;case 2:r[i++]=(s&15)<<4|(o&60)>>2,s=o,a=3;break;case 3:r[i++]=(s&3)<<6|o,a=0;break}}if(a==1)throw Error(`invalid base64 string.`);return r.subarray(0,i)}e.base64decode=r;function i(e){let n=``,r=0,i,a=0;for(let o=0;o>2],a=(i&3)<<4,r=1;break;case 1:n+=t[a|i>>4],a=(i&15)<<2,r=2;break;case 2:n+=t[a|i>>6],n+=t[i&63],r=0;break}return r&&(n+=t[a],n+=`=`,r==1&&(n+=`=`)),n}e.base64encode=i})),PE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.utf8read=void 0;let t=e=>String.fromCharCode.apply(String,e);function n(e){if(e.length<1)return``;let n=0,r=[],i=[],a=0,o,s=e.length;for(;n191&&o<224?i[a++]=(o&31)<<6|e[n++]&63:o>239&&o<365?(o=((o&7)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,i[a++]=55296+(o>>10),i[a++]=56320+(o&1023)):i[a++]=(o&15)<<12|(e[n++]&63)<<6|e[n++]&63,a>8191&&(r.push(t(i)),a=0);return r.length?(a&&r.push(t(i.slice(0,a))),r.join(``)):t(i.slice(0,a))}e.utf8read=n})),FE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WireType=e.mergeBinaryOptions=e.UnknownFieldHandler=void 0,(function(e){e.symbol=Symbol.for(`protobuf-ts/unknown`),e.onRead=(n,r,i,a,o)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:a,data:o})},e.onWrite=(t,n,r)=>{for(let{no:t,wireType:i,data:a}of e.list(n))r.tag(t,i).raw(a)},e.list=(n,r)=>{if(t(n)){let t=n[e.symbol];return r?t.filter(e=>e.no==r):t}return[]},e.last=(t,n)=>e.list(t,n).slice(-1)[0];let t=t=>t&&Array.isArray(t[e.symbol])})(e.UnknownFieldHandler||={});function t(e,t){return Object.assign(Object.assign({},e),t)}e.mergeBinaryOptions=t,(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(e.WireType||={})})),IE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.varint32read=e.varint32write=e.int64toString=e.int64fromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;let r=65536*65536;function i(e){let t=e[0]==`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,i,a]}e.int64fromString=i;function a(e,t){if(t>>>0<=2097151)return``+(r*t+(e>>>0));let n=e&16777215,i=(e>>>24|t<<8)>>>0&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,s=i+a*8147497,c=a*2,l=1e7;o>=l&&(s+=Math.floor(o/l),o%=l),s>=l&&(c+=Math.floor(s/l),s%=l);function u(e,t){let n=e?String(e):``;return t?`0000000`.slice(n.length)+n:n}return u(c,0)+u(s,c)+u(o,1)}e.int64toString=a;function o(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=o;function s(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=s})),LE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PbLong=e.PbULong=e.detectBi=void 0;let t=IE(),n;function r(){let e=new DataView(new ArrayBuffer(8));n=globalThis.BigInt!==void 0&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`?{MIN:BigInt(`-9223372036854775808`),MAX:BigInt(`9223372036854775807`),UMIN:BigInt(`0`),UMAX:BigInt(`18446744073709551615`),C:BigInt,V:e}:void 0}e.detectBi=r,r();function i(e){if(!e)throw Error(`BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support`)}let a=/^-?[0-9]+$/,o=4294967296,s=2147483648;var c=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*o+(this.lo>>>0);if(!Number.isSafeInteger(e))throw Error(`cannot convert to safe number`);return e}},l=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.UMAX)throw Error(`ulong too large`);return n.V.setBigUint64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,s]=t.int64fromString(r);if(n)throw Error(`signed value for ulong`);return new e(i,s);case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);if(r<0)throw Error(`signed value for ulong`);return new e(r,r/o)}throw Error(`unknown value `+typeof r)}toString(){return n?this.toBigInt().toString():t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigUint64(0,!0)}};e.PbULong=l,l.ZERO=new l(0,0);var u=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.MAX)throw Error(`signed long too large`);return n.V.setBigInt64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,c]=t.int64fromString(r);if(n){if(c>s||c==s&&i!=0)throw Error(`signed long too small`)}else if(c>=s)throw Error(`signed long too large`);let l=new e(i,c);return n?l.negate():l;case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);return r>0?new e(r,r/o):new e(-r,-r/o).negate()}throw Error(`unknown value `+typeof r)}isNegative(){return(this.hi&s)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new e(n,t)}toString(){if(n)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return`-`+t.int64toString(e.lo,e.hi)}return t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigInt64(0,!0)}};e.PbLong=u,u.ZERO=new u(0,0)})),RE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryReader=e.binaryReadOptions=void 0;let t=FE(),n=LE(),r=IE(),i={readUnknownField:!0,readerFactory:e=>new o(e)};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryReadOptions=a;var o=class{constructor(e,t){this.varint64=r.varint64read,this.uint32=r.varint32read,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e){let n=this.pos;switch(e){case t.WireType.Varint:for(;this.buf[this.pos++]&128;);break;case t.WireType.Bit64:this.pos+=4;case t.WireType.Bit32:this.pos+=4;break;case t.WireType.LengthDelimited:let n=this.uint32();this.pos+=n;break;case t.WireType.StartGroup:let r;for(;(r=this.tag()[1])!==t.WireType.EndGroup;)this.skip(r);break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new n.PbLong(...this.varint64())}uint64(){return new n.PbULong(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,new n.PbLong(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new n.PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new n.PbLong(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};e.BinaryReader=o})),zE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertFloat32=e.assertUInt32=e.assertInt32=e.assertNever=e.assert=void 0;function t(e,t){if(!e)throw Error(t)}e.assert=t;function n(e,t){throw Error(t??`Unexpected object: `+e)}e.assertNever=n;function r(e){if(typeof e!=`number`)throw Error(`invalid int 32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int 32: `+e)}e.assertInt32=r;function i(e){if(typeof e!=`number`)throw Error(`invalid uint 32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint 32: `+e)}e.assertUInt32=i;function a(e){if(typeof e!=`number`)throw Error(`invalid float 32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float 32: `+e)}e.assertFloat32=a})),BE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryWriter=e.binaryWriteOptions=void 0;let t=LE(),n=IE(),r=zE(),i={writeUnknownFields:!0,writerFactory:()=>new o};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryWriteOptions=a;var o=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(r.assertUInt32(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return r.assertInt32(e),n.varint32write(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){r.assertFloat32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){r.assertUInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){r.assertInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return r.assertInt32(e),e=(e<<1^e>>31)>>>0,n.varint32write(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbLong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbULong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(e){let r=t.PbLong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}sint64(e){let r=t.PbLong.from(e),i=r.hi>>31,a=r.lo<<1^i,o=(r.hi<<1|r.lo>>>31)^i;return n.varint64write(a,o,this.buf),this}uint64(e){let r=t.PbULong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}};e.BinaryWriter=o})),VE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeJsonOptions=e.jsonWriteOptions=e.jsonReadOptions=void 0;let t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},n={ignoreUnknownFields:!1};function r(e){return e?Object.assign(Object.assign({},n),e):n}e.jsonReadOptions=r;function i(e){return e?Object.assign(Object.assign({},t),e):t}e.jsonWriteOptions=i;function a(e,t){let n=Object.assign(Object.assign({},e),t);return n.typeRegistry=[...e?.typeRegistry??[],...t?.typeRegistry??[]],n}e.mergeJsonOptions=a})),HE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MESSAGE_TYPE=void 0,e.MESSAGE_TYPE=Symbol.for(`protobuf-ts/message-type`)})),UE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.lowerCamelCase=void 0;function t(e){let t=!1,n=[];for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.readMessageOption=e.readFieldOption=e.readFieldOptions=e.normalizeFieldInfo=e.RepeatType=e.LongType=e.ScalarType=void 0;let t=UE();(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(e.ScalarType||={}),(function(e){e[e.BIGINT=0]=`BIGINT`,e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`})(e.LongType||={});var n;(function(e){e[e.NO=0]=`NO`,e[e.PACKED=1]=`PACKED`,e[e.UNPACKED=2]=`UNPACKED`})(n=e.RepeatType||={});function r(e){return e.localName=e.localName??t.lowerCamelCase(e.name),e.jsonName=e.jsonName??t.lowerCamelCase(e.name),e.repeat=e.repeat??n.NO,e.opt=e.opt??(e.repeat||e.oneof?!1:e.kind==`message`),e}e.normalizeFieldInfo=r;function i(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readFieldOptions=i;function a(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readFieldOption=a;function o(e,t,n){let r=e.options[t];return r===void 0?r:n?n.fromJson(r):r}e.readMessageOption=o})),GE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSelectedOneofValue=e.clearOneofValue=e.setUnknownOneofValue=e.setOneofValue=e.getOneofValue=e.isOneofGroup=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(`oneofKind`))return!1;switch(typeof e.oneofKind){case`string`:return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case`undefined`:return Object.keys(e).length==1;default:return!1}}e.isOneofGroup=t;function n(e,t){return e[t]}e.getOneofValue=n;function r(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&(e[t]=n)}e.setOneofValue=r;function i(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&t!==void 0&&(e[t]=n)}e.setUnknownOneofValue=i;function a(e){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=void 0}e.clearOneofValue=a;function o(e){if(e.oneofKind!==void 0)return e[e.oneofKind]}e.getSelectedOneofValue=o})),KE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionTypeCheck=void 0;let t=WE(),n=GE();e.ReflectionTypeCheck=class{constructor(e){this.fields=e.fields??[]}prepare(){if(this.data)return;let e=[],t=[],n=[];for(let r of this.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),e.push(r.oneof),t.push(r.oneof));else switch(t.push(r.localName),r.kind){case`scalar`:case`enum`:(!r.opt||r.repeat)&&e.push(r.localName);break;case`message`:r.repeat&&e.push(r.localName);break;case`map`:e.push(r.localName);break}this.data={req:e,known:t,oneofs:Object.values(n)}}is(e,t,r=!1){if(t<0)return!0;if(typeof e!=`object`||!e)return!1;this.prepare();let i=Object.keys(e),a=this.data;if(i.length!i.includes(e))||!r&&i.some(e=>!a.known.includes(e)))return!1;if(t<1)return!0;for(let i of a.oneofs){let a=e[i];if(!n.isOneofGroup(a))return!1;if(a.oneofKind===void 0)continue;let o=this.fields.find(e=>e.localName===a.oneofKind);if(!o||!this.field(a[a.oneofKind],o,r,t))return!1}for(let n of this.fields)if(n.oneof===void 0&&!this.field(e[n.localName],n,r,t))return!1;return!0}field(e,n,r,i){let a=n.repeat;switch(n.kind){case`scalar`:return e===void 0?n.opt:a?this.scalars(e,n.T,i,n.L):this.scalar(e,n.T,n.L);case`enum`:return e===void 0?n.opt:a?this.scalars(e,t.ScalarType.INT32,i):this.scalar(e,t.ScalarType.INT32);case`message`:return e===void 0?!0:a?this.messages(e,n.T(),r,i):this.message(e,n.T(),r,i);case`map`:if(typeof e!=`object`||!e)return!1;if(i<2)return!0;if(!this.mapKeys(e,n.K,i))return!1;switch(n.V.kind){case`scalar`:return this.scalars(Object.values(e),n.V.T,i,n.V.L);case`enum`:return this.scalars(Object.values(e),t.ScalarType.INT32,i);case`message`:return this.messages(Object.values(e),n.V.T(),r,i)}break}return!0}message(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}messages(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(let n=0;nparseInt(e)),n,r);case t.ScalarType.BOOL:return this.scalars(i.slice(0,r).map(e=>e==`true`?!0:e==`false`?!1:e),n,r);default:return this.scalars(i,n,r,t.LongType.STRING)}}}})),qE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionLongConvert=void 0;let t=WE();function n(e,n){switch(n){case t.LongType.BIGINT:return e.toBigInt();case t.LongType.NUMBER:return e.toNumber();default:return e.toString()}}e.reflectionLongConvert=n})),JE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonReader=void 0;let t=ME(),n=NE(),r=WE(),i=LE(),a=zE(),o=qE();e.ReflectionJsonReader=class{constructor(e){this.info=e}prepare(){if(this.fMap===void 0){this.fMap={};let e=this.info.fields??[];for(let t of e)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(e,n,r){if(!e){let e=t.typeofJsonValue(r);throw(e==`number`||e==`boolean`)&&(e=r.toString()),Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${n}`)}}read(e,n,i){this.prepare();let a=[];for(let[o,s]of Object.entries(e)){let e=this.fMap[o];if(!e){if(!i.ignoreUnknownFields)throw Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}let c=e.localName,l;if(e.oneof){if(s===null&&(e.kind!==`enum`||e.T()[0]!==`google.protobuf.NullValue`))continue;if(a.includes(e.oneof))throw Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);a.push(e.oneof),l=n[e.oneof]={oneofKind:c}}else l=n;if(e.kind==`map`){if(s===null)continue;this.assert(t.isJsonObject(s),e.name,s);let n=l[c];for(let[t,a]of Object.entries(s)){this.assert(a!==null,e.name+` map value`,null);let o;switch(e.V.kind){case`message`:o=e.V.T().internalJsonRead(a,i);break;case`enum`:if(o=this.enum(e.V.T(),a,e.name,i.ignoreUnknownFields),o===!1)continue;break;case`scalar`:o=this.scalar(a,e.V.T,e.V.L,e.name);break}this.assert(o!==void 0,e.name+` map value`,a);let s=t;e.K==r.ScalarType.BOOL&&(s=s==`true`?!0:s==`false`?!1:s),s=this.scalar(s,e.K,r.LongType.STRING,e.name).toString(),n[s]=o}}else if(e.repeat){if(s===null)continue;this.assert(Array.isArray(s),e.name,s);let t=l[c];for(let n of s){this.assert(n!==null,e.name,null);let r;switch(e.kind){case`message`:r=e.T().internalJsonRead(n,i);break;case`enum`:if(r=this.enum(e.T(),n,e.name,i.ignoreUnknownFields),r===!1)continue;break;case`scalar`:r=this.scalar(n,e.T,e.L,e.name);break}this.assert(r!==void 0,e.name,s),t.push(r)}}else switch(e.kind){case`message`:if(s===null&&e.T().typeName!=`google.protobuf.Value`){this.assert(e.oneof===void 0,e.name+` (oneof member)`,null);continue}l[c]=e.T().internalJsonRead(s,i,l[c]);break;case`enum`:if(s===null)continue;let t=this.enum(e.T(),s,e.name,i.ignoreUnknownFields);if(t===!1)continue;l[c]=t;break;case`scalar`:if(s===null)continue;l[c]=this.scalar(s,e.T,e.L,e.name);break}}}enum(e,t,n,r){if(e[0]==`google.protobuf.NullValue`&&a.assert(t===null||t===`NULL_VALUE`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case`number`:return a.assert(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case`string`:let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let o=e[1][i];return o===void 0&&r?!1:(a.assert(typeof o==`number`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),o)}a.assert(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,s,c){let l;try{switch(t){case r.ScalarType.DOUBLE:case r.ScalarType.FLOAT:if(e===null)return 0;if(e===`NaN`)return NaN;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===``){l=`empty string`;break}if(typeof e==`string`&&e.trim().length!==e.length){l=`extra whitespace`;break}if(typeof e!=`string`&&typeof e!=`number`)break;let c=Number(e);if(Number.isNaN(c)){l=`not a number`;break}if(!Number.isFinite(c)){l=`too large or small`;break}return t==r.ScalarType.FLOAT&&a.assertFloat32(c),c;case r.ScalarType.INT32:case r.ScalarType.FIXED32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:case r.ScalarType.UINT32:if(e===null)return 0;let u;if(typeof e==`number`?u=e:e===``?l=`empty string`:typeof e==`string`&&(e.trim().length===e.length?u=Number(e):l=`extra whitespace`),u===void 0)break;return t==r.ScalarType.UINT32?a.assertUInt32(u):a.assertInt32(u),u;case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:if(e===null)return o.reflectionLongConvert(i.PbLong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbLong.from(e),s);case r.ScalarType.FIXED64:case r.ScalarType.UINT64:if(e===null)return o.reflectionLongConvert(i.PbULong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbULong.from(e),s);case r.ScalarType.BOOL:if(e===null)return!1;if(typeof e!=`boolean`)break;return e;case r.ScalarType.STRING:if(e===null)return``;if(typeof e!=`string`){l=`extra whitespace`;break}return e;case r.ScalarType.BYTES:if(e===null||e===``)return new Uint8Array;if(typeof e!=`string`)break;return n.base64decode(e)}}catch(e){l=e.message}this.assert(!1,c+(l?` - `+l:``),e)}}})),YE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonWriter=void 0;let t=NE(),n=LE(),r=WE(),i=zE();e.ReflectionJsonWriter=class{constructor(e){this.fields=e.fields??[]}write(e,t){let n={},r=e;for(let e of this.fields){if(!e.oneof){let i=this.field(e,r[e.localName],t);i!==void 0&&(n[t.useProtoFieldName?e.name:e.jsonName]=i);continue}let a=r[e.oneof];if(a.oneofKind!==e.localName)continue;let o=e.kind==`scalar`||e.kind==`enum`?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,s=this.field(e,a[e.localName],o);i.assert(s!==void 0),n[t.useProtoFieldName?e.name:e.jsonName]=s}return n}field(e,t,n){let r;if(e.kind==`map`){i.assert(typeof t==`object`&&!!t);let a={};switch(e.V.kind){case`scalar`:for(let[n,r]of Object.entries(t)){let t=this.scalar(e.V.T,r,e.name,!1,!0);i.assert(t!==void 0),a[n.toString()]=t}break;case`message`:let r=e.V.T();for(let[o,s]of Object.entries(t)){let t=this.message(r,s,e.name,n);i.assert(t!==void 0),a[o.toString()]=t}break;case`enum`:let o=e.V.T();for(let[r,s]of Object.entries(t)){i.assert(s===void 0||typeof s==`number`);let t=this.enum(o,s,e.name,!1,!0,n.enumAsInteger);i.assert(t!==void 0),a[r.toString()]=t}break}(n.emitDefaultValues||Object.keys(a).length>0)&&(r=a)}else if(e.repeat){i.assert(Array.isArray(t));let a=[];switch(e.kind){case`scalar`:for(let n=0;n0||n.emitDefaultValues)&&(r=a)}else switch(e.kind){case`scalar`:r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case`enum`:r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case`message`:r=this.message(e.T(),t,e.name,n);break}return r}enum(e,t,n,r,a,o){if(e[0]==`google.protobuf.NullValue`)return!a&&!r?void 0:null;if(t===void 0){i.assert(r);return}if(!(t===0&&!a&&!r))return i.assert(typeof t==`number`),i.assert(Number.isInteger(t)),o||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,r){return t===void 0?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}scalar(e,a,o,s,c){if(a===void 0){i.assert(s);return}let l=c||s;switch(e){case r.ScalarType.INT32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:return a===0?l?0:void 0:(i.assertInt32(a),a);case r.ScalarType.FIXED32:case r.ScalarType.UINT32:return a===0?l?0:void 0:(i.assertUInt32(a),a);case r.ScalarType.FLOAT:i.assertFloat32(a);case r.ScalarType.DOUBLE:return a===0?l?0:void 0:(i.assert(typeof a==`number`),Number.isNaN(a)?`NaN`:a===1/0?`Infinity`:a===-1/0?`-Infinity`:a);case r.ScalarType.STRING:return a===``?l?``:void 0:(i.assert(typeof a==`string`),a);case r.ScalarType.BOOL:return a===!1?l?!1:void 0:(i.assert(typeof a==`boolean`),a);case r.ScalarType.UINT64:case r.ScalarType.FIXED64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let e=n.PbULong.from(a);return e.isZero()&&!l?void 0:e.toString();case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let o=n.PbLong.from(a);return o.isZero()&&!l?void 0:o.toString();case r.ScalarType.BYTES:return i.assert(a instanceof Uint8Array),a.byteLength?t.base64encode(a):l?``:void 0}}}})),XE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionScalarDefault=void 0;let t=WE(),n=qE(),r=LE();function i(e,i=t.LongType.STRING){switch(e){case t.ScalarType.BOOL:return!1;case t.ScalarType.UINT64:case t.ScalarType.FIXED64:return n.reflectionLongConvert(r.PbULong.ZERO,i);case t.ScalarType.INT64:case t.ScalarType.SFIXED64:case t.ScalarType.SINT64:return n.reflectionLongConvert(r.PbLong.ZERO,i);case t.ScalarType.DOUBLE:case t.ScalarType.FLOAT:return 0;case t.ScalarType.BYTES:return new Uint8Array;case t.ScalarType.STRING:return``;default:return 0}}e.reflectionScalarDefault=i})),ZE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryReader=void 0;let t=FE(),n=WE(),r=qE(),i=XE();e.ReflectionBinaryReader=class{constructor(e){this.info=e}prepare(){if(!this.fieldNoToField){let e=this.info.fields??[];this.fieldNoToField=new Map(e.map(e=>[e.no,e]))}}read(e,r,i,a){this.prepare();let o=a===void 0?e.len:e.pos+a;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryWriter=void 0;let t=FE(),n=WE(),r=zE(),i=LE();e.ReflectionBinaryWriter=class{constructor(e){this.info=e}prepare(){this.fields||=(this.info.fields?this.info.fields.concat():[]).sort((e,t)=>e.no-t.no)}write(e,i,a){this.prepare();for(let t of this.fields){let o,s,c=t.repeat,l=t.localName;if(t.oneof){let n=e[t.oneof];if(n.oneofKind!==l)continue;o=n[l],s=!0}else o=e[l],s=!1;switch(t.kind){case`scalar`:case`enum`:let e=t.kind==`enum`?n.ScalarType.INT32:t.T;if(c)if(r.assert(Array.isArray(o)),c==n.RepeatType.PACKED)this.packed(i,e,t.no,o);else for(let n of o)this.scalar(i,e,t.no,n,!0);else o===void 0?r.assert(t.opt):this.scalar(i,e,t.no,o,s||t.opt);break;case`message`:if(c){r.assert(Array.isArray(o));for(let e of o)this.message(i,a,t.T(),t.no,e)}else this.message(i,a,t.T(),t.no,o);break;case`map`:r.assert(typeof o==`object`&&!!o);for(let[e,n]of Object.entries(o))this.mapEntry(i,a,t,e,n);break}}let o=a.writeUnknownFields;o!==!1&&(o===!0?t.UnknownFieldHandler.onWrite:o)(this.info.typeName,e,i)}mapEntry(e,i,a,o,s){e.tag(a.no,t.WireType.LengthDelimited),e.fork();let c=o;switch(a.K){case n.ScalarType.INT32:case n.ScalarType.FIXED32:case n.ScalarType.UINT32:case n.ScalarType.SFIXED32:case n.ScalarType.SINT32:c=Number.parseInt(o);break;case n.ScalarType.BOOL:r.assert(o==`true`||o==`false`),c=o==`true`;break}switch(this.scalar(e,a.K,1,c,!0),a.V.kind){case`scalar`:this.scalar(e,a.V.T,2,s,!0);break;case`enum`:this.scalar(e,n.ScalarType.INT32,2,s,!0);break;case`message`:this.message(e,i,a.V.T(),2,s);break}e.join()}message(e,n,r,i,a){a!==void 0&&(r.internalBinaryWrite(a,e.tag(i,t.WireType.LengthDelimited).fork(),n),e.join())}scalar(e,t,n,r,i){let[a,o,s]=this.scalarInfo(t,r);(!s||i)&&(e.tag(n,a),e[o](r))}packed(e,i,a,o){if(!o.length)return;r.assert(i!==n.ScalarType.BYTES&&i!==n.ScalarType.STRING),e.tag(a,t.WireType.LengthDelimited),e.fork();let[,s]=this.scalarInfo(i);for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionCreate=void 0;let t=XE(),n=HE();function r(e){let r=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},n.MESSAGE_TYPE,{value:e});for(let n of e.fields){let e=n.localName;if(!n.opt)if(n.oneof)r[n.oneof]={oneofKind:void 0};else if(n.repeat)r[e]=[];else switch(n.kind){case`scalar`:r[e]=t.reflectionScalarDefault(n.T,n.L);break;case`enum`:r[e]=0;break;case`map`:r[e]={};break}}return r}e.reflectionCreate=r})),eD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionMergePartial=void 0;function t(e,t,n){let r,i=n,a;for(let n of e.fields){let e=n.localName;if(n.oneof){let o=i[n.oneof];if(o?.oneofKind==null)continue;if(r=o[e],a=t[n.oneof],a.oneofKind=o.oneofKind,r==null){delete a[e];continue}}else if(r=i[e],a=t,r==null)continue;switch(n.repeat&&(a[e].length=r.length),n.kind){case`scalar`:case`enum`:if(n.repeat)for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionEquals=void 0;let t=WE();function n(e,n,s){if(n===s)return!0;if(!n||!s)return!1;for(let c of e.fields){let e=c.localName,l=c.oneof?n[c.oneof][e]:n[e],u=c.oneof?s[c.oneof][e]:s[e];switch(c.kind){case`enum`:case`scalar`:let e=c.kind==`enum`?t.ScalarType.INT32:c.T;if(!(c.repeat?a(e,l,u):i(e,l,u)))return!1;break;case`map`:if(!(c.V.kind==`message`?o(c.V.T(),r(l),r(u)):a(c.V.kind==`enum`?t.ScalarType.INT32:c.V.T,r(l),r(u))))return!1;break;case`message`:let n=c.T();if(!(c.repeat?o(n,l,u):n.equals(l,u)))return!1;break}}return!0}e.reflectionEquals=n;let r=Object.values;function i(e,n,r){if(n===r)return!0;if(e!==t.ScalarType.BYTES)return!1;let i=n,a=r;if(i.length!==a.length)return!1;for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.MessageType=void 0;let t=HE(),n=WE(),r=KE(),i=JE(),a=YE(),o=ZE(),s=QE(),c=$E(),l=eD(),u=ME(),d=VE(),f=tD(),p=BE(),m=RE(),h=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),g=h[t.MESSAGE_TYPE]={};e.MessageType=class{constructor(e,t,c){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(n.normalizeFieldInfo),this.options=c??{},g.value=this,this.messagePrototype=Object.create(null,h),this.refTypeCheck=new r.ReflectionTypeCheck(this),this.refJsonReader=new i.ReflectionJsonReader(this),this.refJsonWriter=new a.ReflectionJsonWriter(this),this.refBinReader=new o.ReflectionBinaryReader(this),this.refBinWriter=new s.ReflectionBinaryWriter(this)}create(e){let t=c.reflectionCreate(this);return e!==void 0&&l.reflectionMergePartial(this,t,e),t}clone(e){let t=this.create();return l.reflectionMergePartial(this,t,e),t}equals(e,t){return f.reflectionEquals(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){l.reflectionMergePartial(this,e,t)}fromBinary(e,t){let n=m.binaryReadOptions(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}fromJson(e,t){return this.internalJsonRead(e,d.jsonReadOptions(t))}fromJsonString(e,t){let n=JSON.parse(e);return this.fromJson(n,t)}toJson(e,t){return this.internalJsonWrite(e,d.jsonWriteOptions(t))}toJsonString(e,t){let n=this.toJson(e,t);return JSON.stringify(n,null,t?.prettySpaces??0)}toBinary(e,t){let n=p.binaryWriteOptions(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}internalJsonRead(e,t,n){if(typeof e==`object`&&e&&!Array.isArray(e)){let r=n??this.create();return this.refJsonReader.read(e,r,t),r}throw Error(`Unable to parse message ${this.typeName} from JSON ${u.typeofJsonValue(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,n){return this.refBinWriter.write(e,t,n),t}internalBinaryRead(e,t,n,r){let i=r??this.create();return this.refBinReader.read(e,i,n,t),i}}})),rD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.containsMessageType=void 0;let t=HE();function n(e){return e[t.MESSAGE_TYPE]!=null}e.containsMessageType=n})),iD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.listEnumNumbers=e.listEnumNames=e.listEnumValues=e.isEnumObject=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(0))return!1;for(let t of Object.keys(e)){let n=parseInt(t);if(Number.isNaN(n)){let n=e[t];if(n===void 0||typeof n!=`number`||e[n]===void 0)return!1}else{let t=e[n];if(t===void 0||e[t]!==n)return!1}}return!0}e.isEnumObject=t;function n(e){if(!t(e))throw Error(`not a typescript enum object`);let n=[];for(let[t,r]of Object.entries(e))typeof r==`number`&&n.push({name:t,number:r});return n}e.listEnumValues=n;function r(e){return n(e).map(e=>e.name)}e.listEnumNames=r;function i(e){return n(e).map(e=>e.number).filter((e,t,n)=>n.indexOf(e)==t)}e.listEnumNumbers=i})),aD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ME();Object.defineProperty(e,`typeofJsonValue`,{enumerable:!0,get:function(){return t.typeofJsonValue}}),Object.defineProperty(e,`isJsonObject`,{enumerable:!0,get:function(){return t.isJsonObject}});var n=NE();Object.defineProperty(e,`base64decode`,{enumerable:!0,get:function(){return n.base64decode}}),Object.defineProperty(e,`base64encode`,{enumerable:!0,get:function(){return n.base64encode}});var r=PE();Object.defineProperty(e,`utf8read`,{enumerable:!0,get:function(){return r.utf8read}});var i=FE();Object.defineProperty(e,`WireType`,{enumerable:!0,get:function(){return i.WireType}}),Object.defineProperty(e,`mergeBinaryOptions`,{enumerable:!0,get:function(){return i.mergeBinaryOptions}}),Object.defineProperty(e,`UnknownFieldHandler`,{enumerable:!0,get:function(){return i.UnknownFieldHandler}});var a=RE();Object.defineProperty(e,`BinaryReader`,{enumerable:!0,get:function(){return a.BinaryReader}}),Object.defineProperty(e,`binaryReadOptions`,{enumerable:!0,get:function(){return a.binaryReadOptions}});var o=BE();Object.defineProperty(e,`BinaryWriter`,{enumerable:!0,get:function(){return o.BinaryWriter}}),Object.defineProperty(e,`binaryWriteOptions`,{enumerable:!0,get:function(){return o.binaryWriteOptions}});var s=LE();Object.defineProperty(e,`PbLong`,{enumerable:!0,get:function(){return s.PbLong}}),Object.defineProperty(e,`PbULong`,{enumerable:!0,get:function(){return s.PbULong}});var c=VE();Object.defineProperty(e,`jsonReadOptions`,{enumerable:!0,get:function(){return c.jsonReadOptions}}),Object.defineProperty(e,`jsonWriteOptions`,{enumerable:!0,get:function(){return c.jsonWriteOptions}}),Object.defineProperty(e,`mergeJsonOptions`,{enumerable:!0,get:function(){return c.mergeJsonOptions}});var l=HE();Object.defineProperty(e,`MESSAGE_TYPE`,{enumerable:!0,get:function(){return l.MESSAGE_TYPE}});var u=nD();Object.defineProperty(e,`MessageType`,{enumerable:!0,get:function(){return u.MessageType}});var d=WE();Object.defineProperty(e,`ScalarType`,{enumerable:!0,get:function(){return d.ScalarType}}),Object.defineProperty(e,`LongType`,{enumerable:!0,get:function(){return d.LongType}}),Object.defineProperty(e,`RepeatType`,{enumerable:!0,get:function(){return d.RepeatType}}),Object.defineProperty(e,`normalizeFieldInfo`,{enumerable:!0,get:function(){return d.normalizeFieldInfo}}),Object.defineProperty(e,`readFieldOptions`,{enumerable:!0,get:function(){return d.readFieldOptions}}),Object.defineProperty(e,`readFieldOption`,{enumerable:!0,get:function(){return d.readFieldOption}}),Object.defineProperty(e,`readMessageOption`,{enumerable:!0,get:function(){return d.readMessageOption}});var f=KE();Object.defineProperty(e,`ReflectionTypeCheck`,{enumerable:!0,get:function(){return f.ReflectionTypeCheck}});var p=$E();Object.defineProperty(e,`reflectionCreate`,{enumerable:!0,get:function(){return p.reflectionCreate}});var m=XE();Object.defineProperty(e,`reflectionScalarDefault`,{enumerable:!0,get:function(){return m.reflectionScalarDefault}});var h=eD();Object.defineProperty(e,`reflectionMergePartial`,{enumerable:!0,get:function(){return h.reflectionMergePartial}});var g=tD();Object.defineProperty(e,`reflectionEquals`,{enumerable:!0,get:function(){return g.reflectionEquals}});var v=ZE();Object.defineProperty(e,`ReflectionBinaryReader`,{enumerable:!0,get:function(){return v.ReflectionBinaryReader}});var y=QE();Object.defineProperty(e,`ReflectionBinaryWriter`,{enumerable:!0,get:function(){return y.ReflectionBinaryWriter}});var b=JE();Object.defineProperty(e,`ReflectionJsonReader`,{enumerable:!0,get:function(){return b.ReflectionJsonReader}});var x=YE();Object.defineProperty(e,`ReflectionJsonWriter`,{enumerable:!0,get:function(){return x.ReflectionJsonWriter}});var S=rD();Object.defineProperty(e,`containsMessageType`,{enumerable:!0,get:function(){return S.containsMessageType}});var C=GE();Object.defineProperty(e,`isOneofGroup`,{enumerable:!0,get:function(){return C.isOneofGroup}}),Object.defineProperty(e,`setOneofValue`,{enumerable:!0,get:function(){return C.setOneofValue}}),Object.defineProperty(e,`getOneofValue`,{enumerable:!0,get:function(){return C.getOneofValue}}),Object.defineProperty(e,`clearOneofValue`,{enumerable:!0,get:function(){return C.clearOneofValue}}),Object.defineProperty(e,`getSelectedOneofValue`,{enumerable:!0,get:function(){return C.getSelectedOneofValue}});var w=iD();Object.defineProperty(e,`listEnumValues`,{enumerable:!0,get:function(){return w.listEnumValues}}),Object.defineProperty(e,`listEnumNames`,{enumerable:!0,get:function(){return w.listEnumNames}}),Object.defineProperty(e,`listEnumNumbers`,{enumerable:!0,get:function(){return w.listEnumNumbers}}),Object.defineProperty(e,`isEnumObject`,{enumerable:!0,get:function(){return w.isEnumObject}});var T=UE();Object.defineProperty(e,`lowerCamelCase`,{enumerable:!0,get:function(){return T.lowerCamelCase}});var E=zE();Object.defineProperty(e,`assert`,{enumerable:!0,get:function(){return E.assert}}),Object.defineProperty(e,`assertNever`,{enumerable:!0,get:function(){return E.assertNever}}),Object.defineProperty(e,`assertInt32`,{enumerable:!0,get:function(){return E.assertInt32}}),Object.defineProperty(e,`assertUInt32`,{enumerable:!0,get:function(){return E.assertUInt32}}),Object.defineProperty(e,`assertFloat32`,{enumerable:!0,get:function(){return E.assertFloat32}})})),oD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readServiceOption=e.readMethodOption=e.readMethodOptions=e.normalizeMethodInfo=void 0;let t=aD();function n(e,n){let r=e;return r.service=n,r.localName=r.localName??t.lowerCamelCase(r.name),r.serverStreaming=!!r.serverStreaming,r.clientStreaming=!!r.clientStreaming,r.options=r.options??{},r.idempotency=r.idempotency??void 0,r}e.normalizeMethodInfo=n;function r(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readMethodOptions=r;function i(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readMethodOption=i;function a(e,t,n){let r=e.options;if(!r)return;let i=r[t];return i===void 0?i:n?n.fromJson(i):i}e.readServiceOption=a})),sD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServiceType=void 0;let t=oD();e.ServiceType=class{constructor(e,n,r){this.typeName=e,this.methods=n.map(e=>t.normalizeMethodInfo(e,this)),this.options=r??{}}}})),cD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcError=void 0,e.RpcError=class extends Error{constructor(e,t=`UNKNOWN`,n){super(e),this.name=`RpcError`,Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.meta=n??{}}toString(){let e=[this.name+`: `+this.message];this.code&&(e.push(``),e.push(`Code: `+this.code)),this.serviceName&&this.methodName&&e.push(`Method: `+this.serviceName+`/`+this.methodName);let t=Object.entries(this.meta);if(t.length){e.push(``),e.push(`Meta:`);for(let[n,r]of t)e.push(` ${n}: ${r}`)}return e.join(` -`)}}})),lD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeRpcOptions=void 0;let t=aD();function n(e,n){if(!n)return e;let i={};r(e,i),r(n,i);for(let a of Object.keys(n)){let o=n[a];switch(a){case`jsonOptions`:i.jsonOptions=t.mergeJsonOptions(e.jsonOptions,i.jsonOptions);break;case`binaryOptions`:i.binaryOptions=t.mergeBinaryOptions(e.binaryOptions,i.binaryOptions);break;case`meta`:i.meta={},r(e.meta,i.meta),r(n.meta,i.meta);break;case`interceptors`:i.interceptors=e.interceptors?e.interceptors.concat(o):o.concat();break}}return i}e.mergeRpcOptions=n;function r(e,t){if(!e)return;let n=t;for(let[t,r]of Object.entries(e))r instanceof Date?n[t]=new Date(r.getTime()):Array.isArray(r)?n[t]=r.concat():n[t]=r}})),uD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Deferred=e.DeferredState=void 0;var t;(function(e){e[e.PENDING=0]=`PENDING`,e[e.REJECTED=1]=`REJECTED`,e[e.RESOLVED=2]=`RESOLVED`})(t=e.DeferredState||={}),e.Deferred=class{constructor(e=!0){this._state=t.PENDING,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),e&&this._promise.catch(e=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==t.PENDING)throw Error(`cannot resolve ${t[this.state].toLowerCase()}`);this._resolve(e),this._state=t.RESOLVED}reject(e){if(this.state!==t.PENDING)throw Error(`cannot reject ${t[this.state].toLowerCase()}`);this._reject(e),this._state=t.REJECTED}resolvePending(e){this._state===t.PENDING&&this.resolve(e)}rejectPending(e){this._state===t.PENDING&&this.reject(e)}}})),dD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcOutputStreamController=void 0;let t=uD(),n=aD();e.RpcOutputStreamController=class{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(e){return this.addLis(e,this._lis.nxt)}onMessage(e){return this.addLis(e,this._lis.msg)}onError(e){return this.addLis(e,this._lis.err)}onComplete(e){return this.addLis(e,this._lis.cmp)}addLis(e,t){return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,t,r){n.assert((e?1:0)+(t?1:0)+(r?1:0)<=1,`only one emission at a time`),e&&this.notifyMessage(e),t&&this.notifyError(t),r&&this.notifyComplete()}notifyMessage(e){n.assert(!this.closed,`stream is closed`),this.pushIt({value:e,done:!1}),this._lis.msg.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(e,void 0,!1))}notifyError(e){n.assert(!this.closed,`stream is closed`),this._closed=e,this.pushIt(e),this._lis.err.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(void 0,e,!1)),this.clearLis()}notifyComplete(){n.assert(!this.closed,`stream is closed`),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(e=>e()),this._lis.nxt.forEach(e=>e(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let e=this._itState;n.assert(e,`bad state`),n.assert(!e.p,`iterator contract broken`);let r=e.q.shift();return r?`value`in r?Promise.resolve(r):Promise.reject(r):(e.p=new t.Deferred,e.p.promise)}}}pushIt(e){let r=this._itState;if(r.p){let i=r.p;n.assert(i.state==t.DeferredState.PENDING,`iterator contract broken`),`value`in e?i.resolve(e):i.reject(e),delete r.p}else r.q.push(e)}}})),fD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.UnaryCall=void 0,e.UnaryCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:t,status:n,trailers:r}})}}})),pD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerStreamingCall=void 0,e.ServerStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,status:t,trailers:n}})}}})),mD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientStreamingCall=void 0,e.ClientStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,response:t,status:n,trailers:r}})}}})),hD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.DuplexStreamingCall=void 0,e.DuplexStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,status:t,trailers:n}})}}})),gD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.TestTransport=void 0;let n=cD(),r=aD(),i=dD(),a=lD(),o=fD(),s=pD(),c=mD(),l=hD();var u=class e{constructor(e){this.suppressUncaughtRejections=!0,this.headerDelay=10,this.responseDelay=50,this.betweenResponseDelay=10,this.afterResponseDelay=10,this.data=e??{}}get sentMessages(){return this.lastInput instanceof f?this.lastInput.sent:typeof this.lastInput==`object`?[this.lastInput.single]:[]}get sendComplete(){return this.lastInput instanceof f?this.lastInput.completed:typeof this.lastInput==`object`}promiseHeaders(){let t=this.data.headers??e.defaultHeaders;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseSingleResponse(e){if(this.data.response instanceof n.RpcError)return Promise.reject(this.data.response);let t;return Array.isArray(this.data.response)?(r.assert(this.data.response.length>0),t=this.data.response[0]):t=this.data.response===void 0?e.O.create():this.data.response,r.assert(e.O.is(t)),Promise.resolve(t)}streamResponses(e,i,a){return t(this,void 0,void 0,function*(){let t=[];if(this.data.response===void 0)t.push(e.O.create());else if(Array.isArray(this.data.response))for(let n of this.data.response)r.assert(e.O.is(n)),t.push(n);else this.data.response instanceof n.RpcError||(r.assert(e.O.is(this.data.response)),t.push(this.data.response));try{yield d(this.responseDelay,a)(void 0)}catch(e){i.notifyError(e);return}if(this.data.response instanceof n.RpcError){i.notifyError(this.data.response);return}for(let e of t){i.notifyMessage(e);try{yield d(this.betweenResponseDelay,a)(void 0)}catch(e){i.notifyError(e);return}}if(this.data.status instanceof n.RpcError){i.notifyError(this.data.status);return}if(this.data.trailers instanceof n.RpcError){i.notifyError(this.data.trailers);return}i.notifyComplete()})}promiseStatus(){let t=this.data.status??e.defaultStatus;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseTrailers(){let t=this.data.trailers??e.defaultTrailers;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}maybeSuppressUncaught(...e){if(this.suppressUncaughtRejections)for(let t of e)t.catch(()=>{})}mergeOptions(e){return a.mergeRpcOptions({},e)}unary(e,t,n){let r=n.meta??{},i=this.promiseHeaders().then(d(this.headerDelay,n.abort)),a=i.catch(e=>{}).then(d(this.responseDelay,n.abort)).then(t=>this.promiseSingleResponse(e)),s=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseStatus()),c=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput={single:t},new o.UnaryCall(e,r,t,i,a,s,c)}serverStreaming(e,t,n){let r=n.meta??{},a=this.promiseHeaders().then(d(this.headerDelay,n.abort)),o=new i.RpcOutputStreamController,c=a.then(d(this.responseDelay,n.abort)).catch(()=>{}).then(()=>this.streamResponses(e,o,n.abort)).then(d(this.afterResponseDelay,n.abort)),l=c.then(()=>this.promiseStatus()),u=c.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(l,u),this.lastInput={single:t},new s.ServerStreamingCall(e,r,t,a,o,l,u)}clientStreaming(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),i=r.catch(e=>{}).then(d(this.responseDelay,t.abort)).then(t=>this.promiseSingleResponse(e)),a=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseStatus()),o=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(a,o),this.lastInput=new f(this.data,t.abort),new c.ClientStreamingCall(e,n,this.lastInput,r,i,a,o)}duplex(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),a=new i.RpcOutputStreamController,o=r.then(d(this.responseDelay,t.abort)).catch(()=>{}).then(()=>this.streamResponses(e,a,t.abort)).then(d(this.afterResponseDelay,t.abort)),s=o.then(()=>this.promiseStatus()),c=o.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput=new f(this.data,t.abort),new l.DuplexStreamingCall(e,n,this.lastInput,r,a,s,c)}};e.TestTransport=u,u.defaultHeaders={responseHeader:`test`},u.defaultStatus={code:`OK`,detail:`all good`},u.defaultTrailers={responseTrailer:`test`};function d(e,t){return r=>new Promise((i,a)=>{if(t?.aborted)a(new n.RpcError(`user cancel`,`CANCELLED`));else{let o=setTimeout(()=>i(r),e);t&&t.addEventListener(`abort`,e=>{clearTimeout(o),a(new n.RpcError(`user cancel`,`CANCELLED`))})}})}var f=class{constructor(e,t){this._completed=!1,this._sent=[],this.data=e,this.abort=t}get sent(){return this._sent}get completed(){return this._completed}send(e){if(this.data.inputMessage instanceof n.RpcError)return Promise.reject(this.data.inputMessage);let t=this.data.inputMessage===void 0?10:this.data.inputMessage;return Promise.resolve(void 0).then(()=>{this._sent.push(e)}).then(d(t,this.abort))}complete(){if(this.data.inputComplete instanceof n.RpcError)return Promise.reject(this.data.inputComplete);let e=this.data.inputComplete===void 0?10:this.data.inputComplete;return Promise.resolve(void 0).then(()=>{this._completed=!0}).then(d(e,this.abort))}}})),_D=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stackDuplexStreamingInterceptors=e.stackClientStreamingInterceptors=e.stackServerStreamingInterceptors=e.stackUnaryInterceptors=e.stackIntercept=void 0;let t=aD();function n(e,n,r,i,a){if(e==`unary`){let e=(e,t,r)=>n.unary(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptUnary).reverse()){let n=e;e=(e,r,i)=>t.interceptUnary(n,e,r,i)}return e(r,a,i)}if(e==`serverStreaming`){let e=(e,t,r)=>n.serverStreaming(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptServerStreaming).reverse()){let n=e;e=(e,r,i)=>t.interceptServerStreaming(n,e,r,i)}return e(r,a,i)}if(e==`clientStreaming`){let e=(e,t)=>n.clientStreaming(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptClientStreaming).reverse()){let n=e;e=(e,r)=>t.interceptClientStreaming(n,e,r)}return e(r,i)}if(e==`duplex`){let e=(e,t)=>n.duplex(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptDuplex).reverse()){let n=e;e=(e,r)=>t.interceptDuplex(n,e,r)}return e(r,i)}t.assertNever(e)}e.stackIntercept=n;function r(e,t,r,i){return n(`unary`,e,t,i,r)}e.stackUnaryInterceptors=r;function i(e,t,r,i){return n(`serverStreaming`,e,t,i,r)}e.stackServerStreamingInterceptors=i;function a(e,t,r){return n(`clientStreaming`,e,t,r)}e.stackClientStreamingInterceptors=a;function o(e,t,r){return n(`duplex`,e,t,r)}e.stackDuplexStreamingInterceptors=o})),vD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerCallContextController=void 0,e.ServerCallContextController=class{constructor(e,t,n,r,i={code:`OK`,detail:``}){this._cancelled=!1,this._listeners=[],this.method=e,this.headers=t,this.deadline=n,this.trailers={},this._sendRH=r,this.status=i}notifyCancelled(){if(!this._cancelled){this._cancelled=!0;for(let e of this._listeners)e()}}sendResponseHeaders(e){this._sendRH(e)}get cancelled(){return this._cancelled}onCancel(e){let t=this._listeners;return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}}})),yD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=sD();Object.defineProperty(e,`ServiceType`,{enumerable:!0,get:function(){return t.ServiceType}});var n=oD();Object.defineProperty(e,`readMethodOptions`,{enumerable:!0,get:function(){return n.readMethodOptions}}),Object.defineProperty(e,`readMethodOption`,{enumerable:!0,get:function(){return n.readMethodOption}}),Object.defineProperty(e,`readServiceOption`,{enumerable:!0,get:function(){return n.readServiceOption}});var r=cD();Object.defineProperty(e,`RpcError`,{enumerable:!0,get:function(){return r.RpcError}});var i=lD();Object.defineProperty(e,`mergeRpcOptions`,{enumerable:!0,get:function(){return i.mergeRpcOptions}});var a=dD();Object.defineProperty(e,`RpcOutputStreamController`,{enumerable:!0,get:function(){return a.RpcOutputStreamController}});var o=gD();Object.defineProperty(e,`TestTransport`,{enumerable:!0,get:function(){return o.TestTransport}});var s=uD();Object.defineProperty(e,`Deferred`,{enumerable:!0,get:function(){return s.Deferred}}),Object.defineProperty(e,`DeferredState`,{enumerable:!0,get:function(){return s.DeferredState}});var c=hD();Object.defineProperty(e,`DuplexStreamingCall`,{enumerable:!0,get:function(){return c.DuplexStreamingCall}});var l=mD();Object.defineProperty(e,`ClientStreamingCall`,{enumerable:!0,get:function(){return l.ClientStreamingCall}});var u=pD();Object.defineProperty(e,`ServerStreamingCall`,{enumerable:!0,get:function(){return u.ServerStreamingCall}});var d=fD();Object.defineProperty(e,`UnaryCall`,{enumerable:!0,get:function(){return d.UnaryCall}});var f=_D();Object.defineProperty(e,`stackIntercept`,{enumerable:!0,get:function(){return f.stackIntercept}}),Object.defineProperty(e,`stackDuplexStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackDuplexStreamingInterceptors}}),Object.defineProperty(e,`stackClientStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackClientStreamingInterceptors}}),Object.defineProperty(e,`stackServerStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackServerStreamingInterceptors}}),Object.defineProperty(e,`stackUnaryInterceptors`,{enumerable:!0,get:function(){return f.stackUnaryInterceptors}});var p=vD();Object.defineProperty(e,`ServerCallContextController`,{enumerable:!0,get:function(){return p.ServerCallContextController}})})),$=aD();const bD=new class extends $.MessageType{constructor(){super(`github.actions.results.entities.v1.CacheScope`,[{no:1,name:`scope`,kind:`scalar`,T:9},{no:2,name:`permission`,kind:`scalar`,T:3}])}create(e){let t={scope:``,permission:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posbD}])}create(e){let t={repositoryId:`0`,scope:[]};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posxD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posxD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`size_bytes`,kind:`scalar`,T:3},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,sizeBytes:`0`,version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posxD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`restore_keys`,kind:`scalar`,repeat:2,T:9},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,restoreKeys:[],version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.poswD.fromJson(e,{ignoreUnknownFields:!0}))}FinalizeCacheEntryUpload(e){let t=TD.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`FinalizeCacheEntryUpload`,`application/json`,t).then(e=>ED.fromJson(e,{ignoreUnknownFields:!0}))}GetCacheEntryDownloadURL(e){let t=DD.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`GetCacheEntryDownloadURL`,`application/json`,t).then(e=>OD.fromJson(e,{ignoreUnknownFields:!0}))}};function AD(e){if(e)try{let t=new URL(e).searchParams.get(`sig`);t&&(Cr(t),Cr(encodeURIComponent(t)))}catch(t){G(`Failed to parse URL: ${e} ${t instanceof Error?t.message:String(t)}`)}}function jD(e){if(typeof e!=`object`||!e){G(`body is not an object or is null`);return}`signed_upload_url`in e&&typeof e.signed_upload_url==`string`&&AD(e.signed_upload_url),`signed_download_url`in e&&typeof e.signed_download_url==`string`&&AD(e.signed_download_url)}var MD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},ND=class{constructor(e,t,n,r){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let i=cc();this.baseUrl=mE(),t&&(this.maxAttempts=t),n&&(this.baseRetryIntervalMilliseconds=n),r&&(this.retryMultiplier=r),this.httpClient=new On(e,[new jn(i)])}request(e,t,n,r){return MD(this,void 0,void 0,function*(){let i=new URL(`/twirp/${e}/${t}`,this.baseUrl).href;G(`[Request] ${t} ${i}`);let a={"Content-Type":n};try{let{body:e}=yield this.retryableRequest(()=>MD(this,void 0,void 0,function*(){return this.httpClient.post(i,JSON.stringify(r),a)}));return e}catch(e){throw Error(`Failed to ${t}: ${e.message}`)}})}retryableRequest(e){return MD(this,void 0,void 0,function*(){let t=0,n=``,r=``;for(;t0&&Ar(`You've hit a rate limit, your rate limit will reset in ${t} seconds`)}throw new UT(`Rate limited: ${n}`)}}catch(e){if(e instanceof SyntaxError&&G(`Raw Body: ${r}`),e instanceof HT||e instanceof UT)throw e;if(VT.isNetworkErrorCode(e?.code))throw new VT(e?.code);i=!0,n=e.message}if(!i)throw Error(`Received non-retryable error: ${n}`);if(t+1===this.maxAttempts)throw Error(`Failed to make request after ${this.maxAttempts} attempts: ${n}`);let a=this.getExponentialRetryTimeMilliseconds(t);jr(`Attempt ${t+1} of ${this.maxAttempts} failed with error: ${n}. Retrying request in ${a} ms...`),yield this.sleep(a),t++}throw Error(`Request failed`)})}isSuccessStatusCode(e){return e?e>=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[bn.BadGateway,bn.GatewayTimeout,bn.InternalServerError,bn.ServiceUnavailable].includes(e):!1}sleep(e){return MD(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw Error(`attempt should be a positive integer`);if(e===0)return this.baseRetryIntervalMilliseconds;let t=this.baseRetryIntervalMilliseconds*this.retryMultiplier**+e,n=t*this.retryMultiplier;return Math.trunc(Math.random()*(n-t)+t)}};function PD(e){return new kD(new ND(_E(),e?.maxAttempts,e?.retryIntervalMs,e?.retryMultiplier))}var FD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const ID=process.platform===`win32`;function LD(){return FD(this,void 0,void 0,function*(){switch(process.platform){case`win32`:{let e=yield ac(),t=Ks;if(e)return{path:e,type:Hs.GNU};if(c(t))return{path:t,type:Hs.BSD};break}case`darwin`:{let e=yield cr(`gtar`,!1);return e?{path:e,type:Hs.GNU}:{path:yield cr(`tar`,!0),type:Hs.BSD}}default:break}return{path:yield cr(`tar`,!0),type:Hs.GNU}})}function RD(e,t,n){return FD(this,arguments,void 0,function*(e,t,n,r=``){let i=[`"${e.path}"`],a=ic(t),o=`cache.tar`,s=BD(),c=e.type===Hs.BSD&&t!==Vs.Gzip&&ID;switch(n){case`create`:i.push(`--posix`,`-cf`,c?o:a.replace(RegExp(`\\${f.sep}`,`g`),`/`),`--exclude`,c?o:a.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${f.sep}`,`g`),`/`),`--files-from`,Js);break;case`extract`:i.push(`-xf`,c?o:r.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${f.sep}`,`g`),`/`));break;case`list`:i.push(`-tf`,c?o:r.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`);break}if(e.type===Hs.GNU)switch(process.platform){case`win32`:i.push(`--force-local`);break;case`darwin`:i.push(`--delay-directory-restore`);break}return i})}function zD(e,t){return FD(this,arguments,void 0,function*(e,t,n=``){let r,i=yield LD(),a=yield RD(i,e,t,n),o=t===`create`?yield HD(i,e):yield VD(i,e,n),s=i.type===Hs.BSD&&e!==Vs.Gzip&&ID;return r=s&&t!==`create`?[[...o].join(` `),[...a].join(` `)]:[[...a].join(` `),[...o].join(` `)],s?r:[r.join(` `)]})}function BD(){return process.env.GITHUB_WORKSPACE??process.cwd()}function VD(e,t,n){return FD(this,void 0,void 0,function*(){let r=e.type===Hs.BSD&&t!==Vs.Gzip&&ID;switch(t){case Vs.Zstd:return r?[`zstd -d --long=30 --force -o`,qs,n.replace(RegExp(`\\${f.sep}`,`g`),`/`)]:[`--use-compress-program`,ID?`"zstd -d --long=30"`:`unzstd --long=30`];case Vs.ZstdWithoutLong:return r?[`zstd -d --force -o`,qs,n.replace(RegExp(`\\${f.sep}`,`g`),`/`)]:[`--use-compress-program`,ID?`"zstd -d"`:`unzstd`];default:return[`-z`]}})}function HD(e,t){return FD(this,void 0,void 0,function*(){let n=ic(t),r=e.type===Hs.BSD&&t!==Vs.Gzip&&ID;switch(t){case Vs.Zstd:return r?[`zstd -T0 --long=30 --force -o`,n.replace(RegExp(`\\${f.sep}`,`g`),`/`),qs]:[`--use-compress-program`,ID?`"zstd -T0 --long=30"`:`zstdmt --long=30`];case Vs.ZstdWithoutLong:return r?[`zstd -T0 --force -o`,n.replace(RegExp(`\\${f.sep}`,`g`),`/`),qs]:[`--use-compress-program`,ID?`"zstd -T0"`:`zstdmt`];default:return[`-z`]}})}function UD(e,t){return FD(this,void 0,void 0,function*(){for(let n of e)try{yield yr(n,void 0,{cwd:t,env:Object.assign(Object.assign({},process.env),{MSYS:`winsymlinks:nativestrict`})})}catch(e){throw Error(`${n.split(` `)[0]} failed with error: ${e?.message}`)}})}function WD(e,t){return FD(this,void 0,void 0,function*(){yield UD(yield zD(t,`list`,e))})}function GD(e,t){return FD(this,void 0,void 0,function*(){yield sr(BD()),yield UD(yield zD(t,`extract`,e))})}function KD(e,t,n){return FD(this,void 0,void 0,function*(){d(f.join(e,Js),t.join(` -`)),yield UD(yield zD(n,`create`),e)})}var qD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},JD=class e extends Error{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}},YD=class e extends Error{constructor(t){super(t),this.name=`ReserveCacheError`,Object.setPrototypeOf(this,e.prototype)}},XD=class e extends Error{constructor(t){super(t),this.name=`FinalizeCacheError`,Object.setPrototypeOf(this,e.prototype)}};function ZD(e){if(!e||e.length===0)throw new JD(`Path Validation Error: At least one directory or file path is required`)}function QD(e){if(e.length>512)throw new JD(`Key Validation Error: ${e} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(e))throw new JD(`Key Validation Error: ${e} cannot contain commas.`)}function $D(e,t,n,r){return qD(this,arguments,void 0,function*(e,t,n,r,i=!1){let a=pE();switch(G(`Cache service version: ${a}`),ZD(e),a){case`v2`:return yield tO(e,t,n,r,i);default:return yield eO(e,t,n,r,i)}})}function eO(e,t,n,r){return qD(this,arguments,void 0,function*(e,t,n,r,i=!1){n||=[];let a=[t,...n];if(G(`Resolved Keys:`),G(JSON.stringify(a)),a.length>10)throw new JD(`Key Validation Error: Keys are limited to a maximum of 10.`);for(let e of a)QD(e);let o=yield rc(),s=``;try{let t=yield CE(a,e,{compressionMethod:o,enableCrossOsArchive:i});if(!t?.archiveLocation)return;if(r?.lookupOnly)return jr(`Lookup only - skipping download`),t.cacheKey;s=f.join(yield Qs(),ic(o)),G(`Archive Path: ${s}`),yield TE(t.archiveLocation,s,r),Or()&&(yield WD(s,o));let n=$s(s);return jr(`Cache Size: ~${Math.round(n/(1024*1024))} MB (${n} B)`),yield GD(s,o),jr(`Cache restored successfully`),t.cacheKey}catch(e){let t=e;if(t.name===JD.name)throw e;t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to restore: ${e.message}`):Ar(`Failed to restore: ${e.message}`)}finally{try{yield tc(s)}catch(e){G(`Failed to delete archive: ${e}`)}}})}function tO(e,t,n,r){return qD(this,arguments,void 0,function*(e,t,n,r,i=!1){r=Object.assign(Object.assign({},r),{useAzureSdk:!0}),n||=[];let a=[t,...n];if(G(`Resolved Keys:`),G(JSON.stringify(a)),a.length>10)throw new JD(`Key Validation Error: Keys are limited to a maximum of 10.`);for(let e of a)QD(e);let o=``;try{let s=PD(),c=yield rc(),l={key:t,restoreKeys:n,version:sc(e,c,i)},u=yield s.GetCacheEntryDownloadURL(l);if(!u.ok){G(`Cache not found for version ${l.version} of keys: ${a.join(`, `)}`);return}if(l.key===u.matchedKey?jr(`Cache hit for: ${u.matchedKey}`):jr(`Cache hit for restore-key: ${u.matchedKey}`),r?.lookupOnly)return jr(`Lookup only - skipping download`),u.matchedKey;o=f.join(yield Qs(),ic(c)),G(`Archive path: ${o}`),G(`Starting download of archive to: ${o}`),yield TE(u.signedDownloadUrl,o,r);let d=$s(o);return jr(`Cache Size: ~${Math.round(d/(1024*1024))} MB (${d} B)`),Or()&&(yield WD(o,c)),yield GD(o,c),jr(`Cache restored successfully`),u.matchedKey}catch(e){let t=e;if(t.name===JD.name)throw e;t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to restore: ${e.message}`):Ar(`Failed to restore: ${e.message}`)}finally{try{o&&(yield tc(o))}catch(e){G(`Failed to delete archive: ${e}`)}}})}function nO(e,t,n){return qD(this,arguments,void 0,function*(e,t,n,r=!1){let i=pE();switch(G(`Cache service version: ${i}`),ZD(e),QD(t),i){case`v2`:return yield iO(e,t,n,r);default:return yield rO(e,t,n,r)}})}function rO(e,t,n){return qD(this,arguments,void 0,function*(e,t,n,r=!1){let i=yield rc(),a=-1,o=yield ec(e);if(G(`Cache Paths:`),G(`${JSON.stringify(o)}`),o.length===0)throw Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);let s=yield Qs(),c=f.join(s,ic(i));G(`Archive Path: ${c}`);try{yield KD(s,o,i),Or()&&(yield WD(c,i));let l=$s(c);if(G(`File Size: ${l}`),l>10737418240&&!fE())throw Error(`Cache size of ~${Math.round(l/(1024*1024))} MB (${l} B) is over the 10GB limit, not saving cache.`);G(`Reserving Cache`);let u=yield EE(t,e,{compressionMethod:i,enableCrossOsArchive:r,cacheSize:l});if(u?.result?.cacheId)a=u?.result?.cacheId;else if(u?.statusCode===400)throw Error(u?.error?.message??`Cache size of ~${Math.round(l/(1024*1024))} MB (${l} B) is over the data cap limit, not saving cache.`);else throw new YD(`Unable to reserve cache with key ${t}, another job may be creating this cache. More details: ${u?.error?.message}`);G(`Saving Cache (ID: ${a})`),yield jE(a,c,``,n)}catch(e){let t=e;if(t.name===JD.name)throw e;t.name===YD.name?jr(`Failed to save: ${t.message}`):t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to save: ${t.message}`):Ar(`Failed to save: ${t.message}`)}finally{try{yield tc(c)}catch(e){G(`Failed to delete archive: ${e}`)}}return a})}function iO(e,t,n){return qD(this,arguments,void 0,function*(e,t,n,r=!1){n=Object.assign(Object.assign({},n),{uploadChunkSize:64*1024*1024,uploadConcurrency:8,useAzureSdk:!0});let i=yield rc(),a=PD(),o=-1,s=yield ec(e);if(G(`Cache Paths:`),G(`${JSON.stringify(s)}`),s.length===0)throw Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);let c=yield Qs(),l=f.join(c,ic(i));G(`Archive Path: ${l}`);try{yield KD(c,s,i),Or()&&(yield WD(l,i));let u=$s(l);G(`File Size: ${u}`),n.archiveSizeBytes=u,G(`Reserving Cache`);let d=sc(e,i,r),f={key:t,version:d},p;try{let e=yield a.CreateCacheEntry(f);if(!e.ok)throw e.message&&Ar(`Cache reservation failed: ${e.message}`),Error(e.message||`Response was not ok`);p=e.signedUploadUrl}catch(e){throw G(`Failed to reserve cache: ${e}`),new YD(`Unable to reserve cache with key ${t}, another job may be creating this cache.`)}G(`Attempting to upload cache located at: ${l}`),yield jE(o,l,p,n);let m={key:t,version:d,sizeBytes:`${u}`},h=yield a.FinalizeCacheEntryUpload(m);if(G(`FinalizeCacheEntryUploadResponse: ${h.ok}`),!h.ok)throw h.message?new XD(h.message):Error(`Unable to finalize cache with key ${t}, another job may be finalizing this cache.`);o=parseInt(h.entryId)}catch(e){let t=e;if(t.name===JD.name)throw e;t.name===YD.name?jr(`Failed to save: ${t.message}`):t.name===XD.name?Ar(t.message):t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to save: ${t.message}`):Ar(`Failed to save: ${t.message}`)}finally{try{yield tc(l)}catch(e){G(`Failed to delete archive: ${e}`)}}return o})}function aO(e){return e.replaceAll(`/`,`-`)}function oO(e){let{agentIdentity:t,repo:n,ref:r,os:i}=e;return`${Jr}-${t}-${aO(n)}-${r}-${i}`}function sO(e){let{agentIdentity:t,repo:n,ref:r}=e,i=aO(n);return[`${Jr}-${t}-${i}-${r}-`,`${Jr}-${t}-${i}-`]}function cO(e,t){return`${oO(e)}-${t}`}function lO(){return{agentIdentity:`github`,repo:ii(),ref:ai(),os:ri()}}function uO(){let e=t.env.XDG_DATA_HOME??F.join(I.homedir(),`.local`,`share`);return F.join(e,`opencode`,`opencode.db`)}async function dO(e){if(e!=null)return fO(e,`1.2.0`)>=0;try{return await P.access(uO()),!0}catch{return!1}}function fO(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}function pO(){return{restoreCache:async(e,t,n)=>$D(e,t,n),saveCache:async(e,t)=>nO(e,t)}}const mO=pO();async function hO(e,t,n){let r=[e];if(t!=null&&r.push(t),await dO(n??null)){let t=F.join(F.dirname(e),`opencode.db`);r.push(t)}return r}function gO(e,t){let n=F.resolve(e),r=F.resolve(t);return n.startsWith(r+F.sep)}async function _O(e,t,n){if(!gO(e,t)){n.debug(`auth.json is outside storage path - skipping deletion`,{authPath:e,storagePath:t});return}try{await P.unlink(e),n.debug(`Deleted auth.json from cache storage`)}catch(e){e.code!==`ENOENT`&&n.warning(`Failed to delete auth.json`,{error:Pr(e)})}}async function vO(e,t){try{return(await P.stat(e)).isDirectory()===!1?!0:(await P.readdir(e),!1)}catch{return t.debug(`Storage path not accessible - treating as corrupted`),!0}}async function yO(e,t){let n=F.join(e,`.version`);try{let e=await P.readFile(n,`utf8`),r=Number.parseInt(e.trim(),10);return r===1?!0:(t.info(`Storage version mismatch`,{expected:1,found:r}),!1)}catch{return t.debug(`No version file found - treating as compatible`),!0}}async function bO(e){try{await P.rm(e,{recursive:!0,force:!0}),await P.mkdir(e,{recursive:!0})}catch{}}async function xO(e){let{components:n,logger:r,storagePath:i,authPath:a,projectIdPath:o,opencodeVersion:s,cacheAdapter:c=mO}=e;if(t.env.SKIP_CACHE===`true`)return r.debug(`Skipping cache restore (SKIP_CACHE=true)`),await P.mkdir(i,{recursive:!0}),{hit:!1,key:null,restoredPath:null,corrupted:!1};let l=oO(n),u=sO(n),d=await hO(i,o,s);r.info(`Restoring cache`,{primaryKey:l,restoreKeys:[...u],paths:d});try{let e=await c.restoreCache(d,l,[...u]);return e==null?(r.info(`Cache miss - starting with fresh state`),await P.mkdir(i,{recursive:!0}),{hit:!1,key:null,restoredPath:null,corrupted:!1}):(r.info(`Cache restored`,{restoredKey:e}),await vO(i,r)===!0?(r.warning(`Cache corruption detected - proceeding with clean state`),await bO(i),{hit:!0,key:e,restoredPath:i,corrupted:!0}):await yO(i,r)===!1?(r.warning(`Storage version mismatch - proceeding with clean state`),await bO(i),{hit:!0,key:e,restoredPath:i,corrupted:!0}):(await _O(a,i,r),{hit:!0,key:e,restoredPath:i,corrupted:!1}))}catch(e){return r.warning(`Cache restore failed`,{error:Pr(e)}),{hit:!1,key:null,restoredPath:null,corrupted:!1}}}async function SO(e,t,n){let r=[e];if(t!=null&&r.push(t),await dO(n??null)){let t=F.join(F.dirname(e),`opencode.db`);r.push(t)}return r}async function CO(e,t,n){if(!gO(e,t)){n.debug(`auth.json is outside storage path - skipping deletion`,{authPath:e,storagePath:t});return}try{await P.unlink(e),n.debug(`Deleted auth.json from cache storage`)}catch(e){e.code!==`ENOENT`&&n.warning(`Failed to delete auth.json`,{error:Pr(e)})}}async function wO(e){let t=F.join(e,`.version`);await P.mkdir(e,{recursive:!0}),await P.writeFile(t,`1`,`utf8`)}async function TO(e){try{return(await P.readdir(e)).length>0}catch{return!1}}async function EO(e){let{components:n,runId:r,logger:i,storagePath:a,authPath:o,projectIdPath:s,opencodeVersion:c,cacheAdapter:l=mO}=e;if(t.env.SKIP_CACHE===`true`)return i.debug(`Skipping cache save (SKIP_CACHE=true)`),!0;let u=cO(n,r),d=await SO(a,s,c);i.info(`Saving cache`,{saveKey:u,paths:d});try{return await CO(o,a,i),await TO(a)===!1?(i.info(`No storage content to cache`),!1):(await wO(a),await l.saveCache(d,u),i.info(`Cache saved`,{saveKey:u}),!0)}catch(e){return e instanceof Error&&e.message.includes(`already exists`)?(i.info(`Cache key already exists, skipping save`),!0):(i.warning(`Cache save failed`,{error:Pr(e)}),!1)}}function DO(){return 8*1024*1024}function OO(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}function kO(){let e=process.env.ACTIONS_RESULTS_URL;if(!e)throw Error(`Unable to get the ACTIONS_RESULTS_URL env variable`);return new URL(e).origin}function AO(){let e=new URL(process.env.GITHUB_SERVER_URL||`https://github.com`).hostname.trimEnd().toUpperCase(),t=e===`GITHUB.COM`,n=e.endsWith(`.GHE.COM`),r=e.endsWith(`.LOCALHOST`);return!t&&!n&&!r}function jO(){let e=process.env.GITHUB_WORKSPACE;if(!e)throw Error(`Unable to get the GITHUB_WORKSPACE env variable`);return e}function MO(){let e=r.cpus().length,t=32;if(e>4){let n=16*e;t=n>300?300:n}let n=process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY;if(n){let e=parseInt(n);if(isNaN(e)||e<1)throw Error(`Invalid value set for ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY env variable`);return eDate.parse(`9999-12-31T23:59:59Z`))throw Error(`Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);if(e.nanos<0)throw Error(`Unable to encode invalid Timestamp to JSON. Nanos must not be negative.`);let r=`Z`;if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);r=t.substring(3)===`000000`?`.`+t.substring(0,3)+`Z`:t.substring(6)===`000`?`.`+t.substring(0,6)+`Z`:`.`+t+`Z`}return new Date(n).toISOString().replace(`.000Z`,r)}internalJsonRead(e,t,n){if(typeof e!=`string`)throw Error(`Unable to parse Timestamp from JSON `+(0,$.typeofJsonValue)(e)+`.`);let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw Error(`Unable to parse Timestamp from JSON. Invalid format.`);let i=Date.parse(r[1]+`-`+r[2]+`-`+r[3]+`T`+r[4]+`:`+r[5]+`:`+r[6]+(r[8]?r[8]:`Z`));if(Number.isNaN(i))throw Error(`Unable to parse Timestamp from JSON. Invalid value.`);if(iDate.parse(`9999-12-31T23:59:59Z`))throw new globalThis.Error(`Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);return n||=this.create(),n.seconds=$.PbLong.from(i/1e3).toString(),n.nanos=0,r[7]&&(n.nanos=parseInt(`1`+r[7]+`0`.repeat(9-r[7].length))-1e9),n}create(e){let t={seconds:`0`,nanos:0};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posFO},{no:5,name:`version`,kind:`scalar`,T:5},{no:6,name:`mime_type`,kind:`message`,T:()=>LO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,name:``,version:0};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posLO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,name:``,size:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posLO},{no:4,name:`id_filter`,kind:`message`,T:()=>IO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posWO}])}create(e){let t={artifacts:[]};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posFO},{no:7,name:`digest`,kind:`message`,T:()=>LO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,databaseId:`0`,name:``,size:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.poszO.fromJson(e,{ignoreUnknownFields:!0}))}FinalizeArtifact(e){let t=BO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`FinalizeArtifact`,`application/json`,t).then(e=>VO.fromJson(e,{ignoreUnknownFields:!0}))}ListArtifacts(e){let t=HO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`ListArtifacts`,`application/json`,t).then(e=>UO.fromJson(e,{ignoreUnknownFields:!0}))}GetSignedArtifactURL(e){let t=GO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`GetSignedArtifactURL`,`application/json`,t).then(e=>KO.fromJson(e,{ignoreUnknownFields:!0}))}DeleteArtifact(e){let t=qO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`DeleteArtifact`,`application/json`,t).then(e=>JO.fromJson(e,{ignoreUnknownFields:!0}))}};function XO(e){if(!e)return;let t=ZO();t&&t`,` Greater than >`],[`|`,` Vertical bar |`],[`*`,` Asterisk *`],[`?`,` Question mark ?`],[`\r`,` Carriage return \\r`],[` -`,` Line feed \\n`]]),$O=new Map([...QO,[`\\`,` Backslash \\`],[`/`,` Forward slash /`]]);function ek(e){if(!e)throw Error(`Provided artifact name input during validation is empty`);for(let[t,n]of $O)if(e.includes(t))throw Error(`The artifact name is not valid: ${e}. Contains the following character: ${n} +`+r(t)+i(t),o=A(`sha256`,e.accountKey).update(a,`utf8`).digest(`base64`);t.headers.set(kh.AUTHORIZATION,`SharedKey ${e.accountName}:${o}`)}function n(e,t){let n=e.headers.get(t);return!n||t===kh.CONTENT_LENGTH&&n===`0`?``:n}function r(e){let t=[];for(let[n,r]of e.headers)n.toLowerCase().startsWith(kh.PREFIX_FOR_STORAGE)&&t.push({name:n,value:r});t.sort((e,t)=>Wh(e.name.toLowerCase(),t.name.toLowerCase())),t=t.filter((e,t,n)=>!(t>0&&e.name.toLowerCase()===n[t-1].name.toLowerCase()));let n=``;return t.forEach(e=>{n+=`${e.name.toLowerCase().trimRight()}:${e.value.trimLeft()}\n`}),n}function i(t){let n=Mh(t.url)||`/`,r=``;r+=`/${e.accountName}${n}`;let i=Nh(t.url),a={};if(i){let e=[];for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let n=t.toLowerCase();a[n]=i[t],e.push(n)}e.sort();for(let t of e)r+=`\n${t}:${decodeURIComponent(a[t])}`}return r}return{name:`storageSharedKeyCredentialPolicy`,async sendRequest(e,n){return t(e),n(e)}}}function sg(){return{name:`storageRequestFailureDetailsParserPolicy`,async sendRequest(e,t){try{return await t(e)}catch(e){throw typeof e==`object`&&e&&e.response&&e.response.parsedBody&&e.response.parsedBody.code===`InvalidHeaderValue`&&e.response.parsedBody.HeaderName===`x-ms-version`&&(e.message=`The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information. +`),e}}}}var cg=class{accountName;userDelegationKey;key;constructor(e,t){this.accountName=e,this.userDelegationKey=t,this.key=Buffer.from(t.value,`base64`)}computeHMACSHA256(e){return A(`sha256`,this.key).update(e,`utf8`).digest(`base64`)}};const lg=`12.31.0`,ug=`2026-02-06`,dg=5e4,fg=4*1024*1024,pg={Parameters:{FORCE_BROWSER_NO_CACHE:`_`,SIGNATURE:`sig`,SNAPSHOT:`snapshot`,VERSIONID:`versionid`,TIMEOUT:`timeout`}},mg=`Access-Control-Allow-Origin.Cache-Control.Content-Length.Content-Type.Date.Request-Id.traceparent.Transfer-Encoding.User-Agent.x-ms-client-request-id.x-ms-date.x-ms-error-code.x-ms-request-id.x-ms-return-client-request-id.x-ms-version.Accept-Ranges.Content-Disposition.Content-Encoding.Content-Language.Content-MD5.Content-Range.ETag.Last-Modified.Server.Vary.x-ms-content-crc64.x-ms-copy-action.x-ms-copy-completion-time.x-ms-copy-id.x-ms-copy-progress.x-ms-copy-status.x-ms-has-immutability-policy.x-ms-has-legal-hold.x-ms-lease-state.x-ms-lease-status.x-ms-range.x-ms-request-server-encrypted.x-ms-server-encrypted.x-ms-snapshot.x-ms-source-range.If-Match.If-Modified-Since.If-None-Match.If-Unmodified-Since.x-ms-access-tier.x-ms-access-tier-change-time.x-ms-access-tier-inferred.x-ms-account-kind.x-ms-archive-status.x-ms-blob-append-offset.x-ms-blob-cache-control.x-ms-blob-committed-block-count.x-ms-blob-condition-appendpos.x-ms-blob-condition-maxsize.x-ms-blob-content-disposition.x-ms-blob-content-encoding.x-ms-blob-content-language.x-ms-blob-content-length.x-ms-blob-content-md5.x-ms-blob-content-type.x-ms-blob-public-access.x-ms-blob-sequence-number.x-ms-blob-type.x-ms-copy-destination-snapshot.x-ms-creation-time.x-ms-default-encryption-scope.x-ms-delete-snapshots.x-ms-delete-type-permanent.x-ms-deny-encryption-scope-override.x-ms-encryption-algorithm.x-ms-if-sequence-number-eq.x-ms-if-sequence-number-le.x-ms-if-sequence-number-lt.x-ms-incremental-copy.x-ms-lease-action.x-ms-lease-break-period.x-ms-lease-duration.x-ms-lease-id.x-ms-lease-time.x-ms-page-write.x-ms-proposed-lease-id.x-ms-range-get-content-md5.x-ms-rehydrate-priority.x-ms-sequence-number-action.x-ms-sku-name.x-ms-source-content-md5.x-ms-source-if-match.x-ms-source-if-modified-since.x-ms-source-if-none-match.x-ms-source-if-unmodified-since.x-ms-tag-count.x-ms-encryption-key-sha256.x-ms-copy-source-error-code.x-ms-copy-source-status-code.x-ms-if-tags.x-ms-source-if-tags`.split(`.`),hg=`comp.maxresults.rscc.rscd.rsce.rscl.rsct.se.si.sip.sp.spr.sr.srt.ss.st.sv.include.marker.prefix.copyid.restype.blockid.blocklisttype.delimiter.prevsnapshot.ske.skoid.sks.skt.sktid.skv.snapshot`.split(`.`),gg=[`10000`,`10001`,`10002`,`10003`,`10004`,`10100`,`10101`,`10102`,`10103`,`10104`,`11000`,`11001`,`11002`,`11003`,`11004`,`11100`,`11101`,`11102`,`11103`,`11104`];function _g(e){if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.factories)&&typeof t.options==`object`&&typeof t.toServiceClientOptions==`function`}var vg=class{factories;options;constructor(e,t={}){this.factories=e,this.options=t}toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}}};function yg(e,t={}){e||=new Bh;let n=new vg([],t);return n._credential=e,n}function bg(e){let t=[wg,Cg,Tg,Eg,Dg,Og,Ag];if(e.factories.length){let n=e.factories.filter(e=>!t.some(t=>t(e)));if(n.length){let e=n.some(e=>kg(e));return{wrappedPolicies:kp(n),afterRetry:e}}}}function xg(e){let{httpClient:t,...n}=e.options,r=e._coreHttpClient;r||(r=t?Ap(t):Eh(),e._coreHttpClient=r);let i=e._corePipeline;if(!i){let t=`azsdk-js-azure-storage-blob/${lg}`,r=n.userAgentOptions&&n.userAgentOptions.userAgentPrefix?`${n.userAgentOptions.userAgentPrefix} ${t}`:`${t}`;i=Kf({...n,loggingOptions:{additionalAllowedHeaderNames:mg,additionalAllowedQueryParameters:hg,logger:bh.info},userAgentOptions:{userAgentPrefix:r},serializationOptions:{stringifyXML:vh,serializerOptions:{xml:{xmlCharKey:`#`}}},deserializationOptions:{parseXML:yh,serializerOptions:{xml:{xmlCharKey:`#`}}}}),i.removePolicy({phase:`Retry`}),i.removePolicy({name:`decompressResponsePolicy`}),i.addPolicy(tg()),i.addPolicy(ag(n.retryOptions),{phase:`Retry`}),i.addPolicy(sg()),i.addPolicy(eg());let a=bg(e);a&&i.addPolicy(a.wrappedPolicies,a.afterRetry?{afterPhase:`Retry`}:void 0);let o=Sg(e);Fd(o)?i.addPolicy(Md({credential:o,scopes:n.audience??`https://storage.azure.com/.default`,challengeCallbacks:{authorizeRequestOnChallenge:up}}),{phase:`Sign`}):o instanceof qh&&i.addPolicy(og({accountName:o.accountName,accountKey:o.accountKey}),{phase:`Sign`}),e._corePipeline=i}return{...n,allowInsecureConnection:!0,httpClient:r,pipeline:i}}function Sg(e){if(e._credential)return e._credential;let t=new Bh;for(let n of e.factories)if(Fd(n.credential))t=n.credential;else if(Cg(n))return n;return t}function Cg(e){return e instanceof qh?!0:e.constructor.name===`StorageSharedKeyCredential`}function wg(e){return e instanceof Bh?!0:e.constructor.name===`AnonymousCredential`}function Tg(e){return Fd(e.credential)}function Eg(e){return e instanceof Ih?!0:e.constructor.name===`StorageBrowserPolicyFactory`}function Dg(e){return e instanceof $h?!0:e.constructor.name===`StorageRetryPolicyFactory`}function Og(e){return e.constructor.name===`TelemetryPolicyFactory`}function kg(e){return e.constructor.name===`InjectorPolicyFactory`}function Ag(e){let t=[`GenerateClientRequestIdPolicy`,`TracingPolicy`,`LogPolicy`,`ProxyPolicy`,`DisableResponseDecompressionPolicy`,`KeepAlivePolicy`,`DeserializationPolicy`],n=e.create({sendRequest:async e=>({request:e,headers:e.headers.clone(),status:500})},{log(e,t){},shouldLog(e){return!1}}).constructor.name;return t.some(e=>n.startsWith(e))}var jg=de({AccessPolicy:()=>Xg,AppendBlobAppendBlockExceptionHeaders:()=>jy,AppendBlobAppendBlockFromUrlExceptionHeaders:()=>Ny,AppendBlobAppendBlockFromUrlHeaders:()=>My,AppendBlobAppendBlockHeaders:()=>Ay,AppendBlobCreateExceptionHeaders:()=>ky,AppendBlobCreateHeaders:()=>Oy,AppendBlobSealExceptionHeaders:()=>Fy,AppendBlobSealHeaders:()=>Py,ArrowConfiguration:()=>g_,ArrowField:()=>__,BlobAbortCopyFromURLExceptionHeaders:()=>$v,BlobAbortCopyFromURLHeaders:()=>Qv,BlobAcquireLeaseExceptionHeaders:()=>Lv,BlobAcquireLeaseHeaders:()=>Iv,BlobBreakLeaseExceptionHeaders:()=>Gv,BlobBreakLeaseHeaders:()=>Wv,BlobChangeLeaseExceptionHeaders:()=>Uv,BlobChangeLeaseHeaders:()=>Hv,BlobCopyFromURLExceptionHeaders:()=>Zv,BlobCopyFromURLHeaders:()=>Xv,BlobCreateSnapshotExceptionHeaders:()=>qv,BlobCreateSnapshotHeaders:()=>Kv,BlobDeleteExceptionHeaders:()=>xv,BlobDeleteHeaders:()=>bv,BlobDeleteImmutabilityPolicyExceptionHeaders:()=>jv,BlobDeleteImmutabilityPolicyHeaders:()=>Av,BlobDownloadExceptionHeaders:()=>_v,BlobDownloadHeaders:()=>gv,BlobFlatListSegment:()=>Qg,BlobGetAccountInfoExceptionHeaders:()=>ry,BlobGetAccountInfoHeaders:()=>ny,BlobGetPropertiesExceptionHeaders:()=>yv,BlobGetPropertiesHeaders:()=>vv,BlobGetTagsExceptionHeaders:()=>sy,BlobGetTagsHeaders:()=>oy,BlobHierarchyListSegment:()=>r_,BlobItemInternal:()=>$g,BlobName:()=>e_,BlobPrefix:()=>i_,BlobPropertiesInternal:()=>t_,BlobQueryExceptionHeaders:()=>ay,BlobQueryHeaders:()=>iy,BlobReleaseLeaseExceptionHeaders:()=>zv,BlobReleaseLeaseHeaders:()=>Rv,BlobRenewLeaseExceptionHeaders:()=>Vv,BlobRenewLeaseHeaders:()=>Bv,BlobServiceProperties:()=>Mg,BlobServiceStatistics:()=>Rg,BlobSetExpiryExceptionHeaders:()=>Tv,BlobSetExpiryHeaders:()=>wv,BlobSetHttpHeadersExceptionHeaders:()=>Dv,BlobSetHttpHeadersHeaders:()=>Ev,BlobSetImmutabilityPolicyExceptionHeaders:()=>kv,BlobSetImmutabilityPolicyHeaders:()=>Ov,BlobSetLegalHoldExceptionHeaders:()=>Nv,BlobSetLegalHoldHeaders:()=>Mv,BlobSetMetadataExceptionHeaders:()=>Fv,BlobSetMetadataHeaders:()=>Pv,BlobSetTagsExceptionHeaders:()=>ly,BlobSetTagsHeaders:()=>cy,BlobSetTierExceptionHeaders:()=>ty,BlobSetTierHeaders:()=>ey,BlobStartCopyFromURLExceptionHeaders:()=>Yv,BlobStartCopyFromURLHeaders:()=>Jv,BlobTag:()=>Jg,BlobTags:()=>qg,BlobUndeleteExceptionHeaders:()=>Cv,BlobUndeleteHeaders:()=>Sv,Block:()=>s_,BlockBlobCommitBlockListExceptionHeaders:()=>Gy,BlockBlobCommitBlockListHeaders:()=>Wy,BlockBlobGetBlockListExceptionHeaders:()=>qy,BlockBlobGetBlockListHeaders:()=>Ky,BlockBlobPutBlobFromUrlExceptionHeaders:()=>zy,BlockBlobPutBlobFromUrlHeaders:()=>Ry,BlockBlobStageBlockExceptionHeaders:()=>Vy,BlockBlobStageBlockFromURLExceptionHeaders:()=>Uy,BlockBlobStageBlockFromURLHeaders:()=>Hy,BlockBlobStageBlockHeaders:()=>By,BlockBlobUploadExceptionHeaders:()=>Ly,BlockBlobUploadHeaders:()=>Iy,BlockList:()=>o_,BlockLookupList:()=>a_,ClearRange:()=>u_,ContainerAcquireLeaseExceptionHeaders:()=>tv,ContainerAcquireLeaseHeaders:()=>ev,ContainerBreakLeaseExceptionHeaders:()=>sv,ContainerBreakLeaseHeaders:()=>ov,ContainerChangeLeaseExceptionHeaders:()=>lv,ContainerChangeLeaseHeaders:()=>cv,ContainerCreateExceptionHeaders:()=>F_,ContainerCreateHeaders:()=>P_,ContainerDeleteExceptionHeaders:()=>z_,ContainerDeleteHeaders:()=>R_,ContainerFilterBlobsExceptionHeaders:()=>$_,ContainerFilterBlobsHeaders:()=>Q_,ContainerGetAccessPolicyExceptionHeaders:()=>U_,ContainerGetAccessPolicyHeaders:()=>H_,ContainerGetAccountInfoExceptionHeaders:()=>hv,ContainerGetAccountInfoHeaders:()=>mv,ContainerGetPropertiesExceptionHeaders:()=>L_,ContainerGetPropertiesHeaders:()=>I_,ContainerItem:()=>Vg,ContainerListBlobFlatSegmentExceptionHeaders:()=>dv,ContainerListBlobFlatSegmentHeaders:()=>uv,ContainerListBlobHierarchySegmentExceptionHeaders:()=>pv,ContainerListBlobHierarchySegmentHeaders:()=>fv,ContainerProperties:()=>Hg,ContainerReleaseLeaseExceptionHeaders:()=>rv,ContainerReleaseLeaseHeaders:()=>nv,ContainerRenameExceptionHeaders:()=>Y_,ContainerRenameHeaders:()=>J_,ContainerRenewLeaseExceptionHeaders:()=>av,ContainerRenewLeaseHeaders:()=>iv,ContainerRestoreExceptionHeaders:()=>q_,ContainerRestoreHeaders:()=>K_,ContainerSetAccessPolicyExceptionHeaders:()=>G_,ContainerSetAccessPolicyHeaders:()=>W_,ContainerSetMetadataExceptionHeaders:()=>V_,ContainerSetMetadataHeaders:()=>B_,ContainerSubmitBatchExceptionHeaders:()=>Z_,ContainerSubmitBatchHeaders:()=>X_,CorsRule:()=>Ig,DelimitedTextConfiguration:()=>m_,FilterBlobItem:()=>Kg,FilterBlobSegment:()=>Gg,GeoReplication:()=>zg,JsonTextConfiguration:()=>h_,KeyInfo:()=>Ug,ListBlobsFlatSegmentResponse:()=>Zg,ListBlobsHierarchySegmentResponse:()=>n_,ListContainersSegmentResponse:()=>Bg,Logging:()=>Ng,Metrics:()=>Fg,PageBlobClearPagesExceptionHeaders:()=>hy,PageBlobClearPagesHeaders:()=>my,PageBlobCopyIncrementalExceptionHeaders:()=>Dy,PageBlobCopyIncrementalHeaders:()=>Ey,PageBlobCreateExceptionHeaders:()=>dy,PageBlobCreateHeaders:()=>uy,PageBlobGetPageRangesDiffExceptionHeaders:()=>xy,PageBlobGetPageRangesDiffHeaders:()=>by,PageBlobGetPageRangesExceptionHeaders:()=>yy,PageBlobGetPageRangesHeaders:()=>vy,PageBlobResizeExceptionHeaders:()=>Cy,PageBlobResizeHeaders:()=>Sy,PageBlobUpdateSequenceNumberExceptionHeaders:()=>Ty,PageBlobUpdateSequenceNumberHeaders:()=>wy,PageBlobUploadPagesExceptionHeaders:()=>py,PageBlobUploadPagesFromURLExceptionHeaders:()=>_y,PageBlobUploadPagesFromURLHeaders:()=>gy,PageBlobUploadPagesHeaders:()=>fy,PageList:()=>c_,PageRange:()=>l_,QueryFormat:()=>p_,QueryRequest:()=>d_,QuerySerialization:()=>f_,RetentionPolicy:()=>Pg,ServiceFilterBlobsExceptionHeaders:()=>N_,ServiceFilterBlobsHeaders:()=>M_,ServiceGetAccountInfoExceptionHeaders:()=>k_,ServiceGetAccountInfoHeaders:()=>O_,ServiceGetPropertiesExceptionHeaders:()=>x_,ServiceGetPropertiesHeaders:()=>b_,ServiceGetStatisticsExceptionHeaders:()=>C_,ServiceGetStatisticsHeaders:()=>S_,ServiceGetUserDelegationKeyExceptionHeaders:()=>D_,ServiceGetUserDelegationKeyHeaders:()=>E_,ServiceListContainersSegmentExceptionHeaders:()=>T_,ServiceListContainersSegmentHeaders:()=>w_,ServiceSetPropertiesExceptionHeaders:()=>y_,ServiceSetPropertiesHeaders:()=>v_,ServiceSubmitBatchExceptionHeaders:()=>j_,ServiceSubmitBatchHeaders:()=>A_,SignedIdentifier:()=>Yg,StaticWebsite:()=>Lg,StorageError:()=>K,UserDelegationKey:()=>Wg});const Mg={serializedName:`BlobServiceProperties`,xmlName:`StorageServiceProperties`,type:{name:`Composite`,className:`BlobServiceProperties`,modelProperties:{blobAnalyticsLogging:{serializedName:`Logging`,xmlName:`Logging`,type:{name:`Composite`,className:`Logging`}},hourMetrics:{serializedName:`HourMetrics`,xmlName:`HourMetrics`,type:{name:`Composite`,className:`Metrics`}},minuteMetrics:{serializedName:`MinuteMetrics`,xmlName:`MinuteMetrics`,type:{name:`Composite`,className:`Metrics`}},cors:{serializedName:`Cors`,xmlName:`Cors`,xmlIsWrapped:!0,xmlElementName:`CorsRule`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`CorsRule`}}}},defaultServiceVersion:{serializedName:`DefaultServiceVersion`,xmlName:`DefaultServiceVersion`,type:{name:`String`}},deleteRetentionPolicy:{serializedName:`DeleteRetentionPolicy`,xmlName:`DeleteRetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}},staticWebsite:{serializedName:`StaticWebsite`,xmlName:`StaticWebsite`,type:{name:`Composite`,className:`StaticWebsite`}}}}},Ng={serializedName:`Logging`,type:{name:`Composite`,className:`Logging`,modelProperties:{version:{serializedName:`Version`,required:!0,xmlName:`Version`,type:{name:`String`}},deleteProperty:{serializedName:`Delete`,required:!0,xmlName:`Delete`,type:{name:`Boolean`}},read:{serializedName:`Read`,required:!0,xmlName:`Read`,type:{name:`Boolean`}},write:{serializedName:`Write`,required:!0,xmlName:`Write`,type:{name:`Boolean`}},retentionPolicy:{serializedName:`RetentionPolicy`,xmlName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}}}}},Pg={serializedName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`,modelProperties:{enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},days:{constraints:{InclusiveMinimum:1},serializedName:`Days`,xmlName:`Days`,type:{name:`Number`}}}}},Fg={serializedName:`Metrics`,type:{name:`Composite`,className:`Metrics`,modelProperties:{version:{serializedName:`Version`,xmlName:`Version`,type:{name:`String`}},enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},includeAPIs:{serializedName:`IncludeAPIs`,xmlName:`IncludeAPIs`,type:{name:`Boolean`}},retentionPolicy:{serializedName:`RetentionPolicy`,xmlName:`RetentionPolicy`,type:{name:`Composite`,className:`RetentionPolicy`}}}}},Ig={serializedName:`CorsRule`,type:{name:`Composite`,className:`CorsRule`,modelProperties:{allowedOrigins:{serializedName:`AllowedOrigins`,required:!0,xmlName:`AllowedOrigins`,type:{name:`String`}},allowedMethods:{serializedName:`AllowedMethods`,required:!0,xmlName:`AllowedMethods`,type:{name:`String`}},allowedHeaders:{serializedName:`AllowedHeaders`,required:!0,xmlName:`AllowedHeaders`,type:{name:`String`}},exposedHeaders:{serializedName:`ExposedHeaders`,required:!0,xmlName:`ExposedHeaders`,type:{name:`String`}},maxAgeInSeconds:{constraints:{InclusiveMinimum:0},serializedName:`MaxAgeInSeconds`,required:!0,xmlName:`MaxAgeInSeconds`,type:{name:`Number`}}}}},Lg={serializedName:`StaticWebsite`,type:{name:`Composite`,className:`StaticWebsite`,modelProperties:{enabled:{serializedName:`Enabled`,required:!0,xmlName:`Enabled`,type:{name:`Boolean`}},indexDocument:{serializedName:`IndexDocument`,xmlName:`IndexDocument`,type:{name:`String`}},errorDocument404Path:{serializedName:`ErrorDocument404Path`,xmlName:`ErrorDocument404Path`,type:{name:`String`}},defaultIndexDocumentPath:{serializedName:`DefaultIndexDocumentPath`,xmlName:`DefaultIndexDocumentPath`,type:{name:`String`}}}}},K={serializedName:`StorageError`,type:{name:`Composite`,className:`StorageError`,modelProperties:{message:{serializedName:`Message`,xmlName:`Message`,type:{name:`String`}},copySourceStatusCode:{serializedName:`CopySourceStatusCode`,xmlName:`CopySourceStatusCode`,type:{name:`Number`}},copySourceErrorCode:{serializedName:`CopySourceErrorCode`,xmlName:`CopySourceErrorCode`,type:{name:`String`}},copySourceErrorMessage:{serializedName:`CopySourceErrorMessage`,xmlName:`CopySourceErrorMessage`,type:{name:`String`}},code:{serializedName:`Code`,xmlName:`Code`,type:{name:`String`}},authenticationErrorDetail:{serializedName:`AuthenticationErrorDetail`,xmlName:`AuthenticationErrorDetail`,type:{name:`String`}}}}},Rg={serializedName:`BlobServiceStatistics`,xmlName:`StorageServiceStats`,type:{name:`Composite`,className:`BlobServiceStatistics`,modelProperties:{geoReplication:{serializedName:`GeoReplication`,xmlName:`GeoReplication`,type:{name:`Composite`,className:`GeoReplication`}}}}},zg={serializedName:`GeoReplication`,type:{name:`Composite`,className:`GeoReplication`,modelProperties:{status:{serializedName:`Status`,required:!0,xmlName:`Status`,type:{name:`Enum`,allowedValues:[`live`,`bootstrap`,`unavailable`]}},lastSyncOn:{serializedName:`LastSyncTime`,required:!0,xmlName:`LastSyncTime`,type:{name:`DateTimeRfc1123`}}}}},Bg={serializedName:`ListContainersSegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListContainersSegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},containerItems:{serializedName:`ContainerItems`,required:!0,xmlName:`Containers`,xmlIsWrapped:!0,xmlElementName:`Container`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ContainerItem`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},Vg={serializedName:`ContainerItem`,xmlName:`Container`,type:{name:`Composite`,className:`ContainerItem`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},deleted:{serializedName:`Deleted`,xmlName:`Deleted`,type:{name:`Boolean`}},version:{serializedName:`Version`,xmlName:`Version`,type:{name:`String`}},properties:{serializedName:`Properties`,xmlName:`Properties`,type:{name:`Composite`,className:`ContainerProperties`}},metadata:{serializedName:`Metadata`,xmlName:`Metadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}}}}},Hg={serializedName:`ContainerProperties`,type:{name:`Composite`,className:`ContainerProperties`,modelProperties:{lastModified:{serializedName:`Last-Modified`,required:!0,xmlName:`Last-Modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`Etag`,required:!0,xmlName:`Etag`,type:{name:`String`}},leaseStatus:{serializedName:`LeaseStatus`,xmlName:`LeaseStatus`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},leaseState:{serializedName:`LeaseState`,xmlName:`LeaseState`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseDuration:{serializedName:`LeaseDuration`,xmlName:`LeaseDuration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},publicAccess:{serializedName:`PublicAccess`,xmlName:`PublicAccess`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},hasImmutabilityPolicy:{serializedName:`HasImmutabilityPolicy`,xmlName:`HasImmutabilityPolicy`,type:{name:`Boolean`}},hasLegalHold:{serializedName:`HasLegalHold`,xmlName:`HasLegalHold`,type:{name:`Boolean`}},defaultEncryptionScope:{serializedName:`DefaultEncryptionScope`,xmlName:`DefaultEncryptionScope`,type:{name:`String`}},preventEncryptionScopeOverride:{serializedName:`DenyEncryptionScopeOverride`,xmlName:`DenyEncryptionScopeOverride`,type:{name:`Boolean`}},deletedOn:{serializedName:`DeletedTime`,xmlName:`DeletedTime`,type:{name:`DateTimeRfc1123`}},remainingRetentionDays:{serializedName:`RemainingRetentionDays`,xmlName:`RemainingRetentionDays`,type:{name:`Number`}},isImmutableStorageWithVersioningEnabled:{serializedName:`ImmutableStorageWithVersioningEnabled`,xmlName:`ImmutableStorageWithVersioningEnabled`,type:{name:`Boolean`}}}}},Ug={serializedName:`KeyInfo`,type:{name:`Composite`,className:`KeyInfo`,modelProperties:{startsOn:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`String`}},expiresOn:{serializedName:`Expiry`,required:!0,xmlName:`Expiry`,type:{name:`String`}}}}},Wg={serializedName:`UserDelegationKey`,type:{name:`Composite`,className:`UserDelegationKey`,modelProperties:{signedObjectId:{serializedName:`SignedOid`,required:!0,xmlName:`SignedOid`,type:{name:`String`}},signedTenantId:{serializedName:`SignedTid`,required:!0,xmlName:`SignedTid`,type:{name:`String`}},signedStartsOn:{serializedName:`SignedStart`,required:!0,xmlName:`SignedStart`,type:{name:`String`}},signedExpiresOn:{serializedName:`SignedExpiry`,required:!0,xmlName:`SignedExpiry`,type:{name:`String`}},signedService:{serializedName:`SignedService`,required:!0,xmlName:`SignedService`,type:{name:`String`}},signedVersion:{serializedName:`SignedVersion`,required:!0,xmlName:`SignedVersion`,type:{name:`String`}},value:{serializedName:`Value`,required:!0,xmlName:`Value`,type:{name:`String`}}}}},Gg={serializedName:`FilterBlobSegment`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`FilterBlobSegment`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},where:{serializedName:`Where`,required:!0,xmlName:`Where`,type:{name:`String`}},blobs:{serializedName:`Blobs`,required:!0,xmlName:`Blobs`,xmlIsWrapped:!0,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`FilterBlobItem`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},Kg={serializedName:`FilterBlobItem`,xmlName:`Blob`,type:{name:`Composite`,className:`FilterBlobItem`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,type:{name:`String`}},tags:{serializedName:`Tags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`}}}}},qg={serializedName:`BlobTags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`,modelProperties:{blobTagSet:{serializedName:`BlobTagSet`,required:!0,xmlName:`TagSet`,xmlIsWrapped:!0,xmlElementName:`Tag`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobTag`}}}}}}},Jg={serializedName:`BlobTag`,xmlName:`Tag`,type:{name:`Composite`,className:`BlobTag`,modelProperties:{key:{serializedName:`Key`,required:!0,xmlName:`Key`,type:{name:`String`}},value:{serializedName:`Value`,required:!0,xmlName:`Value`,type:{name:`String`}}}}},Yg={serializedName:`SignedIdentifier`,xmlName:`SignedIdentifier`,type:{name:`Composite`,className:`SignedIdentifier`,modelProperties:{id:{serializedName:`Id`,required:!0,xmlName:`Id`,type:{name:`String`}},accessPolicy:{serializedName:`AccessPolicy`,xmlName:`AccessPolicy`,type:{name:`Composite`,className:`AccessPolicy`}}}}},Xg={serializedName:`AccessPolicy`,type:{name:`Composite`,className:`AccessPolicy`,modelProperties:{startsOn:{serializedName:`Start`,xmlName:`Start`,type:{name:`String`}},expiresOn:{serializedName:`Expiry`,xmlName:`Expiry`,type:{name:`String`}},permissions:{serializedName:`Permission`,xmlName:`Permission`,type:{name:`String`}}}}},Zg={serializedName:`ListBlobsFlatSegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListBlobsFlatSegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},segment:{serializedName:`Segment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobFlatListSegment`}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},Qg={serializedName:`BlobFlatListSegment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobFlatListSegment`,modelProperties:{blobItems:{serializedName:`BlobItems`,required:!0,xmlName:`BlobItems`,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobItemInternal`}}}}}}},$g={serializedName:`BlobItemInternal`,xmlName:`Blob`,type:{name:`Composite`,className:`BlobItemInternal`,modelProperties:{name:{serializedName:`Name`,xmlName:`Name`,type:{name:`Composite`,className:`BlobName`}},deleted:{serializedName:`Deleted`,required:!0,xmlName:`Deleted`,type:{name:`Boolean`}},snapshot:{serializedName:`Snapshot`,required:!0,xmlName:`Snapshot`,type:{name:`String`}},versionId:{serializedName:`VersionId`,xmlName:`VersionId`,type:{name:`String`}},isCurrentVersion:{serializedName:`IsCurrentVersion`,xmlName:`IsCurrentVersion`,type:{name:`Boolean`}},properties:{serializedName:`Properties`,xmlName:`Properties`,type:{name:`Composite`,className:`BlobPropertiesInternal`}},metadata:{serializedName:`Metadata`,xmlName:`Metadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},blobTags:{serializedName:`BlobTags`,xmlName:`Tags`,type:{name:`Composite`,className:`BlobTags`}},objectReplicationMetadata:{serializedName:`ObjectReplicationMetadata`,xmlName:`OrMetadata`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},hasVersionsOnly:{serializedName:`HasVersionsOnly`,xmlName:`HasVersionsOnly`,type:{name:`Boolean`}}}}},e_={serializedName:`BlobName`,type:{name:`Composite`,className:`BlobName`,modelProperties:{encoded:{serializedName:`Encoded`,xmlName:`Encoded`,xmlIsAttribute:!0,type:{name:`Boolean`}},content:{serializedName:`content`,xmlName:`content`,xmlIsMsText:!0,type:{name:`String`}}}}},t_={serializedName:`BlobPropertiesInternal`,xmlName:`Properties`,type:{name:`Composite`,className:`BlobPropertiesInternal`,modelProperties:{createdOn:{serializedName:`Creation-Time`,xmlName:`Creation-Time`,type:{name:`DateTimeRfc1123`}},lastModified:{serializedName:`Last-Modified`,required:!0,xmlName:`Last-Modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`Etag`,required:!0,xmlName:`Etag`,type:{name:`String`}},contentLength:{serializedName:`Content-Length`,xmlName:`Content-Length`,type:{name:`Number`}},contentType:{serializedName:`Content-Type`,xmlName:`Content-Type`,type:{name:`String`}},contentEncoding:{serializedName:`Content-Encoding`,xmlName:`Content-Encoding`,type:{name:`String`}},contentLanguage:{serializedName:`Content-Language`,xmlName:`Content-Language`,type:{name:`String`}},contentMD5:{serializedName:`Content-MD5`,xmlName:`Content-MD5`,type:{name:`ByteArray`}},contentDisposition:{serializedName:`Content-Disposition`,xmlName:`Content-Disposition`,type:{name:`String`}},cacheControl:{serializedName:`Cache-Control`,xmlName:`Cache-Control`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`BlobType`,xmlName:`BlobType`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},leaseStatus:{serializedName:`LeaseStatus`,xmlName:`LeaseStatus`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},leaseState:{serializedName:`LeaseState`,xmlName:`LeaseState`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseDuration:{serializedName:`LeaseDuration`,xmlName:`LeaseDuration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},copyId:{serializedName:`CopyId`,xmlName:`CopyId`,type:{name:`String`}},copyStatus:{serializedName:`CopyStatus`,xmlName:`CopyStatus`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},copySource:{serializedName:`CopySource`,xmlName:`CopySource`,type:{name:`String`}},copyProgress:{serializedName:`CopyProgress`,xmlName:`CopyProgress`,type:{name:`String`}},copyCompletedOn:{serializedName:`CopyCompletionTime`,xmlName:`CopyCompletionTime`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`CopyStatusDescription`,xmlName:`CopyStatusDescription`,type:{name:`String`}},serverEncrypted:{serializedName:`ServerEncrypted`,xmlName:`ServerEncrypted`,type:{name:`Boolean`}},incrementalCopy:{serializedName:`IncrementalCopy`,xmlName:`IncrementalCopy`,type:{name:`Boolean`}},destinationSnapshot:{serializedName:`DestinationSnapshot`,xmlName:`DestinationSnapshot`,type:{name:`String`}},deletedOn:{serializedName:`DeletedTime`,xmlName:`DeletedTime`,type:{name:`DateTimeRfc1123`}},remainingRetentionDays:{serializedName:`RemainingRetentionDays`,xmlName:`RemainingRetentionDays`,type:{name:`Number`}},accessTier:{serializedName:`AccessTier`,xmlName:`AccessTier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}},accessTierInferred:{serializedName:`AccessTierInferred`,xmlName:`AccessTierInferred`,type:{name:`Boolean`}},archiveStatus:{serializedName:`ArchiveStatus`,xmlName:`ArchiveStatus`,type:{name:`Enum`,allowedValues:[`rehydrate-pending-to-hot`,`rehydrate-pending-to-cool`,`rehydrate-pending-to-cold`]}},customerProvidedKeySha256:{serializedName:`CustomerProvidedKeySha256`,xmlName:`CustomerProvidedKeySha256`,type:{name:`String`}},encryptionScope:{serializedName:`EncryptionScope`,xmlName:`EncryptionScope`,type:{name:`String`}},accessTierChangedOn:{serializedName:`AccessTierChangeTime`,xmlName:`AccessTierChangeTime`,type:{name:`DateTimeRfc1123`}},tagCount:{serializedName:`TagCount`,xmlName:`TagCount`,type:{name:`Number`}},expiresOn:{serializedName:`Expiry-Time`,xmlName:`Expiry-Time`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`Sealed`,xmlName:`Sealed`,type:{name:`Boolean`}},rehydratePriority:{serializedName:`RehydratePriority`,xmlName:`RehydratePriority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}},lastAccessedOn:{serializedName:`LastAccessTime`,xmlName:`LastAccessTime`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`ImmutabilityPolicyUntilDate`,xmlName:`ImmutabilityPolicyUntilDate`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`ImmutabilityPolicyMode`,xmlName:`ImmutabilityPolicyMode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`LegalHold`,xmlName:`LegalHold`,type:{name:`Boolean`}}}}},n_={serializedName:`ListBlobsHierarchySegmentResponse`,xmlName:`EnumerationResults`,type:{name:`Composite`,className:`ListBlobsHierarchySegmentResponse`,modelProperties:{serviceEndpoint:{serializedName:`ServiceEndpoint`,required:!0,xmlName:`ServiceEndpoint`,xmlIsAttribute:!0,type:{name:`String`}},containerName:{serializedName:`ContainerName`,required:!0,xmlName:`ContainerName`,xmlIsAttribute:!0,type:{name:`String`}},prefix:{serializedName:`Prefix`,xmlName:`Prefix`,type:{name:`String`}},marker:{serializedName:`Marker`,xmlName:`Marker`,type:{name:`String`}},maxPageSize:{serializedName:`MaxResults`,xmlName:`MaxResults`,type:{name:`Number`}},delimiter:{serializedName:`Delimiter`,xmlName:`Delimiter`,type:{name:`String`}},segment:{serializedName:`Segment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobHierarchyListSegment`}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},r_={serializedName:`BlobHierarchyListSegment`,xmlName:`Blobs`,type:{name:`Composite`,className:`BlobHierarchyListSegment`,modelProperties:{blobPrefixes:{serializedName:`BlobPrefixes`,xmlName:`BlobPrefixes`,xmlElementName:`BlobPrefix`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobPrefix`}}}},blobItems:{serializedName:`BlobItems`,required:!0,xmlName:`BlobItems`,xmlElementName:`Blob`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`BlobItemInternal`}}}}}}},i_={serializedName:`BlobPrefix`,type:{name:`Composite`,className:`BlobPrefix`,modelProperties:{name:{serializedName:`Name`,xmlName:`Name`,type:{name:`Composite`,className:`BlobName`}}}}},a_={serializedName:`BlockLookupList`,xmlName:`BlockList`,type:{name:`Composite`,className:`BlockLookupList`,modelProperties:{committed:{serializedName:`Committed`,xmlName:`Committed`,xmlElementName:`Committed`,type:{name:`Sequence`,element:{type:{name:`String`}}}},uncommitted:{serializedName:`Uncommitted`,xmlName:`Uncommitted`,xmlElementName:`Uncommitted`,type:{name:`Sequence`,element:{type:{name:`String`}}}},latest:{serializedName:`Latest`,xmlName:`Latest`,xmlElementName:`Latest`,type:{name:`Sequence`,element:{type:{name:`String`}}}}}}},o_={serializedName:`BlockList`,type:{name:`Composite`,className:`BlockList`,modelProperties:{committedBlocks:{serializedName:`CommittedBlocks`,xmlName:`CommittedBlocks`,xmlIsWrapped:!0,xmlElementName:`Block`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`Block`}}}},uncommittedBlocks:{serializedName:`UncommittedBlocks`,xmlName:`UncommittedBlocks`,xmlIsWrapped:!0,xmlElementName:`Block`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`Block`}}}}}}},s_={serializedName:`Block`,type:{name:`Composite`,className:`Block`,modelProperties:{name:{serializedName:`Name`,required:!0,xmlName:`Name`,type:{name:`String`}},size:{serializedName:`Size`,required:!0,xmlName:`Size`,type:{name:`Number`}}}}},c_={serializedName:`PageList`,type:{name:`Composite`,className:`PageList`,modelProperties:{pageRange:{serializedName:`PageRange`,xmlName:`PageRange`,xmlElementName:`PageRange`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`PageRange`}}}},clearRange:{serializedName:`ClearRange`,xmlName:`ClearRange`,xmlElementName:`ClearRange`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ClearRange`}}}},continuationToken:{serializedName:`NextMarker`,xmlName:`NextMarker`,type:{name:`String`}}}}},l_={serializedName:`PageRange`,xmlName:`PageRange`,type:{name:`Composite`,className:`PageRange`,modelProperties:{start:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`Number`}},end:{serializedName:`End`,required:!0,xmlName:`End`,type:{name:`Number`}}}}},u_={serializedName:`ClearRange`,xmlName:`ClearRange`,type:{name:`Composite`,className:`ClearRange`,modelProperties:{start:{serializedName:`Start`,required:!0,xmlName:`Start`,type:{name:`Number`}},end:{serializedName:`End`,required:!0,xmlName:`End`,type:{name:`Number`}}}}},d_={serializedName:`QueryRequest`,xmlName:`QueryRequest`,type:{name:`Composite`,className:`QueryRequest`,modelProperties:{queryType:{serializedName:`QueryType`,required:!0,xmlName:`QueryType`,type:{name:`String`}},expression:{serializedName:`Expression`,required:!0,xmlName:`Expression`,type:{name:`String`}},inputSerialization:{serializedName:`InputSerialization`,xmlName:`InputSerialization`,type:{name:`Composite`,className:`QuerySerialization`}},outputSerialization:{serializedName:`OutputSerialization`,xmlName:`OutputSerialization`,type:{name:`Composite`,className:`QuerySerialization`}}}}},f_={serializedName:`QuerySerialization`,type:{name:`Composite`,className:`QuerySerialization`,modelProperties:{format:{serializedName:`Format`,xmlName:`Format`,type:{name:`Composite`,className:`QueryFormat`}}}}},p_={serializedName:`QueryFormat`,type:{name:`Composite`,className:`QueryFormat`,modelProperties:{type:{serializedName:`Type`,required:!0,xmlName:`Type`,type:{name:`Enum`,allowedValues:[`delimited`,`json`,`arrow`,`parquet`]}},delimitedTextConfiguration:{serializedName:`DelimitedTextConfiguration`,xmlName:`DelimitedTextConfiguration`,type:{name:`Composite`,className:`DelimitedTextConfiguration`}},jsonTextConfiguration:{serializedName:`JsonTextConfiguration`,xmlName:`JsonTextConfiguration`,type:{name:`Composite`,className:`JsonTextConfiguration`}},arrowConfiguration:{serializedName:`ArrowConfiguration`,xmlName:`ArrowConfiguration`,type:{name:`Composite`,className:`ArrowConfiguration`}},parquetTextConfiguration:{serializedName:`ParquetTextConfiguration`,xmlName:`ParquetTextConfiguration`,type:{name:`Dictionary`,value:{type:{name:`any`}}}}}}},m_={serializedName:`DelimitedTextConfiguration`,xmlName:`DelimitedTextConfiguration`,type:{name:`Composite`,className:`DelimitedTextConfiguration`,modelProperties:{columnSeparator:{serializedName:`ColumnSeparator`,xmlName:`ColumnSeparator`,type:{name:`String`}},fieldQuote:{serializedName:`FieldQuote`,xmlName:`FieldQuote`,type:{name:`String`}},recordSeparator:{serializedName:`RecordSeparator`,xmlName:`RecordSeparator`,type:{name:`String`}},escapeChar:{serializedName:`EscapeChar`,xmlName:`EscapeChar`,type:{name:`String`}},headersPresent:{serializedName:`HeadersPresent`,xmlName:`HasHeaders`,type:{name:`Boolean`}}}}},h_={serializedName:`JsonTextConfiguration`,xmlName:`JsonTextConfiguration`,type:{name:`Composite`,className:`JsonTextConfiguration`,modelProperties:{recordSeparator:{serializedName:`RecordSeparator`,xmlName:`RecordSeparator`,type:{name:`String`}}}}},g_={serializedName:`ArrowConfiguration`,xmlName:`ArrowConfiguration`,type:{name:`Composite`,className:`ArrowConfiguration`,modelProperties:{schema:{serializedName:`Schema`,required:!0,xmlName:`Schema`,xmlIsWrapped:!0,xmlElementName:`Field`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`ArrowField`}}}}}}},__={serializedName:`ArrowField`,xmlName:`Field`,type:{name:`Composite`,className:`ArrowField`,modelProperties:{type:{serializedName:`Type`,required:!0,xmlName:`Type`,type:{name:`String`}},name:{serializedName:`Name`,xmlName:`Name`,type:{name:`String`}},precision:{serializedName:`Precision`,xmlName:`Precision`,type:{name:`Number`}},scale:{serializedName:`Scale`,xmlName:`Scale`,type:{name:`Number`}}}}},v_={serializedName:`Service_setPropertiesHeaders`,type:{name:`Composite`,className:`ServiceSetPropertiesHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},y_={serializedName:`Service_setPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ServiceSetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},b_={serializedName:`Service_getPropertiesHeaders`,type:{name:`Composite`,className:`ServiceGetPropertiesHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},x_={serializedName:`Service_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},S_={serializedName:`Service_getStatisticsHeaders`,type:{name:`Composite`,className:`ServiceGetStatisticsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},C_={serializedName:`Service_getStatisticsExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetStatisticsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},w_={serializedName:`Service_listContainersSegmentHeaders`,type:{name:`Composite`,className:`ServiceListContainersSegmentHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},T_={serializedName:`Service_listContainersSegmentExceptionHeaders`,type:{name:`Composite`,className:`ServiceListContainersSegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},E_={serializedName:`Service_getUserDelegationKeyHeaders`,type:{name:`Composite`,className:`ServiceGetUserDelegationKeyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},D_={serializedName:`Service_getUserDelegationKeyExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetUserDelegationKeyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},O_={serializedName:`Service_getAccountInfoHeaders`,type:{name:`Composite`,className:`ServiceGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},k_={serializedName:`Service_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`ServiceGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},A_={serializedName:`Service_submitBatchHeaders`,type:{name:`Composite`,className:`ServiceSubmitBatchHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},j_={serializedName:`Service_submitBatchExceptionHeaders`,type:{name:`Composite`,className:`ServiceSubmitBatchExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},M_={serializedName:`Service_filterBlobsHeaders`,type:{name:`Composite`,className:`ServiceFilterBlobsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},N_={serializedName:`Service_filterBlobsExceptionHeaders`,type:{name:`Composite`,className:`ServiceFilterBlobsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},P_={serializedName:`Container_createHeaders`,type:{name:`Composite`,className:`ContainerCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},F_={serializedName:`Container_createExceptionHeaders`,type:{name:`Composite`,className:`ContainerCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},I_={serializedName:`Container_getPropertiesHeaders`,type:{name:`Composite`,className:`ContainerGetPropertiesHeaders`,modelProperties:{metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobPublicAccess:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},hasImmutabilityPolicy:{serializedName:`x-ms-has-immutability-policy`,xmlName:`x-ms-has-immutability-policy`,type:{name:`Boolean`}},hasLegalHold:{serializedName:`x-ms-has-legal-hold`,xmlName:`x-ms-has-legal-hold`,type:{name:`Boolean`}},defaultEncryptionScope:{serializedName:`x-ms-default-encryption-scope`,xmlName:`x-ms-default-encryption-scope`,type:{name:`String`}},denyEncryptionScopeOverride:{serializedName:`x-ms-deny-encryption-scope-override`,xmlName:`x-ms-deny-encryption-scope-override`,type:{name:`Boolean`}},isImmutableStorageWithVersioningEnabled:{serializedName:`x-ms-immutable-storage-with-versioning-enabled`,xmlName:`x-ms-immutable-storage-with-versioning-enabled`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},L_={serializedName:`Container_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},R_={serializedName:`Container_deleteHeaders`,type:{name:`Composite`,className:`ContainerDeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},z_={serializedName:`Container_deleteExceptionHeaders`,type:{name:`Composite`,className:`ContainerDeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},B_={serializedName:`Container_setMetadataHeaders`,type:{name:`Composite`,className:`ContainerSetMetadataHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},V_={serializedName:`Container_setMetadataExceptionHeaders`,type:{name:`Composite`,className:`ContainerSetMetadataExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},H_={serializedName:`Container_getAccessPolicyHeaders`,type:{name:`Composite`,className:`ContainerGetAccessPolicyHeaders`,modelProperties:{blobPublicAccess:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},U_={serializedName:`Container_getAccessPolicyExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetAccessPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},W_={serializedName:`Container_setAccessPolicyHeaders`,type:{name:`Composite`,className:`ContainerSetAccessPolicyHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},G_={serializedName:`Container_setAccessPolicyExceptionHeaders`,type:{name:`Composite`,className:`ContainerSetAccessPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},K_={serializedName:`Container_restoreHeaders`,type:{name:`Composite`,className:`ContainerRestoreHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},q_={serializedName:`Container_restoreExceptionHeaders`,type:{name:`Composite`,className:`ContainerRestoreExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},J_={serializedName:`Container_renameHeaders`,type:{name:`Composite`,className:`ContainerRenameHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Y_={serializedName:`Container_renameExceptionHeaders`,type:{name:`Composite`,className:`ContainerRenameExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},X_={serializedName:`Container_submitBatchHeaders`,type:{name:`Composite`,className:`ContainerSubmitBatchHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}}}}},Z_={serializedName:`Container_submitBatchExceptionHeaders`,type:{name:`Composite`,className:`ContainerSubmitBatchExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Q_={serializedName:`Container_filterBlobsHeaders`,type:{name:`Composite`,className:`ContainerFilterBlobsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},$_={serializedName:`Container_filterBlobsExceptionHeaders`,type:{name:`Composite`,className:`ContainerFilterBlobsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ev={serializedName:`Container_acquireLeaseHeaders`,type:{name:`Composite`,className:`ContainerAcquireLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},tv={serializedName:`Container_acquireLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerAcquireLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},nv={serializedName:`Container_releaseLeaseHeaders`,type:{name:`Composite`,className:`ContainerReleaseLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},rv={serializedName:`Container_releaseLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerReleaseLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},iv={serializedName:`Container_renewLeaseHeaders`,type:{name:`Composite`,className:`ContainerRenewLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},av={serializedName:`Container_renewLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerRenewLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ov={serializedName:`Container_breakLeaseHeaders`,type:{name:`Composite`,className:`ContainerBreakLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseTime:{serializedName:`x-ms-lease-time`,xmlName:`x-ms-lease-time`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},sv={serializedName:`Container_breakLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerBreakLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},cv={serializedName:`Container_changeLeaseHeaders`,type:{name:`Composite`,className:`ContainerChangeLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},lv={serializedName:`Container_changeLeaseExceptionHeaders`,type:{name:`Composite`,className:`ContainerChangeLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},uv={serializedName:`Container_listBlobFlatSegmentHeaders`,type:{name:`Composite`,className:`ContainerListBlobFlatSegmentHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},dv={serializedName:`Container_listBlobFlatSegmentExceptionHeaders`,type:{name:`Composite`,className:`ContainerListBlobFlatSegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},fv={serializedName:`Container_listBlobHierarchySegmentHeaders`,type:{name:`Composite`,className:`ContainerListBlobHierarchySegmentHeaders`,modelProperties:{contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},pv={serializedName:`Container_listBlobHierarchySegmentExceptionHeaders`,type:{name:`Composite`,className:`ContainerListBlobHierarchySegmentExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},mv={serializedName:`Container_getAccountInfoHeaders`,type:{name:`Composite`,className:`ContainerGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}}}}},hv={serializedName:`Container_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`ContainerGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},gv={serializedName:`Blob_downloadHeaders`,type:{name:`Composite`,className:`BlobDownloadHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},createdOn:{serializedName:`x-ms-creation-time`,xmlName:`x-ms-creation-time`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},objectReplicationPolicyId:{serializedName:`x-ms-or-policy-id`,xmlName:`x-ms-or-policy-id`,type:{name:`String`}},objectReplicationRules:{serializedName:`x-ms-or`,headerCollectionPrefix:`x-ms-or-`,xmlName:`x-ms-or`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},contentRange:{serializedName:`content-range`,xmlName:`content-range`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletedOn:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},isCurrentVersion:{serializedName:`x-ms-is-current-version`,xmlName:`x-ms-is-current-version`,type:{name:`Boolean`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},blobContentMD5:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}},tagCount:{serializedName:`x-ms-tag-count`,xmlName:`x-ms-tag-count`,type:{name:`Number`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}},lastAccessed:{serializedName:`x-ms-last-access-time`,xmlName:`x-ms-last-access-time`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},contentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}}}},_v={serializedName:`Blob_downloadExceptionHeaders`,type:{name:`Composite`,className:`BlobDownloadExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},vv={serializedName:`Blob_getPropertiesHeaders`,type:{name:`Composite`,className:`BlobGetPropertiesHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},createdOn:{serializedName:`x-ms-creation-time`,xmlName:`x-ms-creation-time`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},objectReplicationPolicyId:{serializedName:`x-ms-or-policy-id`,xmlName:`x-ms-or-policy-id`,type:{name:`String`}},objectReplicationRules:{serializedName:`x-ms-or`,headerCollectionPrefix:`x-ms-or-`,xmlName:`x-ms-or`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletedOn:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},isIncrementalCopy:{serializedName:`x-ms-incremental-copy`,xmlName:`x-ms-incremental-copy`,type:{name:`Boolean`}},destinationSnapshot:{serializedName:`x-ms-copy-destination-snapshot`,xmlName:`x-ms-copy-destination-snapshot`,type:{name:`String`}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},accessTier:{serializedName:`x-ms-access-tier`,xmlName:`x-ms-access-tier`,type:{name:`String`}},accessTierInferred:{serializedName:`x-ms-access-tier-inferred`,xmlName:`x-ms-access-tier-inferred`,type:{name:`Boolean`}},archiveStatus:{serializedName:`x-ms-archive-status`,xmlName:`x-ms-archive-status`,type:{name:`String`}},accessTierChangedOn:{serializedName:`x-ms-access-tier-change-time`,xmlName:`x-ms-access-tier-change-time`,type:{name:`DateTimeRfc1123`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},isCurrentVersion:{serializedName:`x-ms-is-current-version`,xmlName:`x-ms-is-current-version`,type:{name:`Boolean`}},tagCount:{serializedName:`x-ms-tag-count`,xmlName:`x-ms-tag-count`,type:{name:`Number`}},expiresOn:{serializedName:`x-ms-expiry-time`,xmlName:`x-ms-expiry-time`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}},rehydratePriority:{serializedName:`x-ms-rehydrate-priority`,xmlName:`x-ms-rehydrate-priority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}},lastAccessed:{serializedName:`x-ms-last-access-time`,xmlName:`x-ms-last-access-time`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiresOn:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},yv={serializedName:`Blob_getPropertiesExceptionHeaders`,type:{name:`Composite`,className:`BlobGetPropertiesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},bv={serializedName:`Blob_deleteHeaders`,type:{name:`Composite`,className:`BlobDeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},xv={serializedName:`Blob_deleteExceptionHeaders`,type:{name:`Composite`,className:`BlobDeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Sv={serializedName:`Blob_undeleteHeaders`,type:{name:`Composite`,className:`BlobUndeleteHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Cv={serializedName:`Blob_undeleteExceptionHeaders`,type:{name:`Composite`,className:`BlobUndeleteExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},wv={serializedName:`Blob_setExpiryHeaders`,type:{name:`Composite`,className:`BlobSetExpiryHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Tv={serializedName:`Blob_setExpiryExceptionHeaders`,type:{name:`Composite`,className:`BlobSetExpiryExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ev={serializedName:`Blob_setHttpHeadersHeaders`,type:{name:`Composite`,className:`BlobSetHttpHeadersHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Dv={serializedName:`Blob_setHttpHeadersExceptionHeaders`,type:{name:`Composite`,className:`BlobSetHttpHeadersExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ov={serializedName:`Blob_setImmutabilityPolicyHeaders`,type:{name:`Composite`,className:`BlobSetImmutabilityPolicyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyExpiry:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}},immutabilityPolicyMode:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}}}}},kv={serializedName:`Blob_setImmutabilityPolicyExceptionHeaders`,type:{name:`Composite`,className:`BlobSetImmutabilityPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Av={serializedName:`Blob_deleteImmutabilityPolicyHeaders`,type:{name:`Composite`,className:`BlobDeleteImmutabilityPolicyHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},jv={serializedName:`Blob_deleteImmutabilityPolicyExceptionHeaders`,type:{name:`Composite`,className:`BlobDeleteImmutabilityPolicyExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Mv={serializedName:`Blob_setLegalHoldHeaders`,type:{name:`Composite`,className:`BlobSetLegalHoldHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},legalHold:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}}}},Nv={serializedName:`Blob_setLegalHoldExceptionHeaders`,type:{name:`Composite`,className:`BlobSetLegalHoldExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Pv={serializedName:`Blob_setMetadataHeaders`,type:{name:`Composite`,className:`BlobSetMetadataHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Fv={serializedName:`Blob_setMetadataExceptionHeaders`,type:{name:`Composite`,className:`BlobSetMetadataExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Iv={serializedName:`Blob_acquireLeaseHeaders`,type:{name:`Composite`,className:`BlobAcquireLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Lv={serializedName:`Blob_acquireLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobAcquireLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Rv={serializedName:`Blob_releaseLeaseHeaders`,type:{name:`Composite`,className:`BlobReleaseLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},zv={serializedName:`Blob_releaseLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobReleaseLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Bv={serializedName:`Blob_renewLeaseHeaders`,type:{name:`Composite`,className:`BlobRenewLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Vv={serializedName:`Blob_renewLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobRenewLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Hv={serializedName:`Blob_changeLeaseHeaders`,type:{name:`Composite`,className:`BlobChangeLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},leaseId:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Uv={serializedName:`Blob_changeLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobChangeLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Wv={serializedName:`Blob_breakLeaseHeaders`,type:{name:`Composite`,className:`BlobBreakLeaseHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},leaseTime:{serializedName:`x-ms-lease-time`,xmlName:`x-ms-lease-time`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}}}}},Gv={serializedName:`Blob_breakLeaseExceptionHeaders`,type:{name:`Composite`,className:`BlobBreakLeaseExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Kv={serializedName:`Blob_createSnapshotHeaders`,type:{name:`Composite`,className:`BlobCreateSnapshotHeaders`,modelProperties:{snapshot:{serializedName:`x-ms-snapshot`,xmlName:`x-ms-snapshot`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},qv={serializedName:`Blob_createSnapshotExceptionHeaders`,type:{name:`Composite`,className:`BlobCreateSnapshotExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Jv={serializedName:`Blob_startCopyFromURLHeaders`,type:{name:`Composite`,className:`BlobStartCopyFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Yv={serializedName:`Blob_startCopyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobStartCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Xv={serializedName:`Blob_copyFromURLHeaders`,type:{name:`Composite`,className:`BlobCopyFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{defaultValue:`success`,isConstant:!0,serializedName:`x-ms-copy-status`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Zv={serializedName:`Blob_copyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Qv={serializedName:`Blob_abortCopyFromURLHeaders`,type:{name:`Composite`,className:`BlobAbortCopyFromURLHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},$v={serializedName:`Blob_abortCopyFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlobAbortCopyFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ey={serializedName:`Blob_setTierHeaders`,type:{name:`Composite`,className:`BlobSetTierHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ty={serializedName:`Blob_setTierExceptionHeaders`,type:{name:`Composite`,className:`BlobSetTierExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ny={serializedName:`Blob_getAccountInfoHeaders`,type:{name:`Composite`,className:`BlobGetAccountInfoHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},skuName:{serializedName:`x-ms-sku-name`,xmlName:`x-ms-sku-name`,type:{name:`Enum`,allowedValues:[`Standard_LRS`,`Standard_GRS`,`Standard_RAGRS`,`Standard_ZRS`,`Premium_LRS`]}},accountKind:{serializedName:`x-ms-account-kind`,xmlName:`x-ms-account-kind`,type:{name:`Enum`,allowedValues:[`Storage`,`BlobStorage`,`StorageV2`,`FileStorage`,`BlockBlobStorage`]}},isHierarchicalNamespaceEnabled:{serializedName:`x-ms-is-hns-enabled`,xmlName:`x-ms-is-hns-enabled`,type:{name:`Boolean`}}}}},ry={serializedName:`Blob_getAccountInfoExceptionHeaders`,type:{name:`Composite`,className:`BlobGetAccountInfoExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},iy={serializedName:`Blob_queryHeaders`,type:{name:`Composite`,className:`BlobQueryHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},metadata:{serializedName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,xmlName:`x-ms-meta`,type:{name:`Dictionary`,value:{type:{name:`String`}}}},contentLength:{serializedName:`content-length`,xmlName:`content-length`,type:{name:`Number`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},contentRange:{serializedName:`content-range`,xmlName:`content-range`,type:{name:`String`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},contentEncoding:{serializedName:`content-encoding`,xmlName:`content-encoding`,type:{name:`String`}},cacheControl:{serializedName:`cache-control`,xmlName:`cache-control`,type:{name:`String`}},contentDisposition:{serializedName:`content-disposition`,xmlName:`content-disposition`,type:{name:`String`}},contentLanguage:{serializedName:`content-language`,xmlName:`content-language`,type:{name:`String`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},blobType:{serializedName:`x-ms-blob-type`,xmlName:`x-ms-blob-type`,type:{name:`Enum`,allowedValues:[`BlockBlob`,`PageBlob`,`AppendBlob`]}},copyCompletionTime:{serializedName:`x-ms-copy-completion-time`,xmlName:`x-ms-copy-completion-time`,type:{name:`DateTimeRfc1123`}},copyStatusDescription:{serializedName:`x-ms-copy-status-description`,xmlName:`x-ms-copy-status-description`,type:{name:`String`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyProgress:{serializedName:`x-ms-copy-progress`,xmlName:`x-ms-copy-progress`,type:{name:`String`}},copySource:{serializedName:`x-ms-copy-source`,xmlName:`x-ms-copy-source`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},leaseDuration:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Enum`,allowedValues:[`infinite`,`fixed`]}},leaseState:{serializedName:`x-ms-lease-state`,xmlName:`x-ms-lease-state`,type:{name:`Enum`,allowedValues:[`available`,`leased`,`expired`,`breaking`,`broken`]}},leaseStatus:{serializedName:`x-ms-lease-status`,xmlName:`x-ms-lease-status`,type:{name:`Enum`,allowedValues:[`locked`,`unlocked`]}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},acceptRanges:{serializedName:`accept-ranges`,xmlName:`accept-ranges`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-server-encrypted`,xmlName:`x-ms-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},blobContentMD5:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},contentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}}}},ay={serializedName:`Blob_queryExceptionHeaders`,type:{name:`Composite`,className:`BlobQueryExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},oy={serializedName:`Blob_getTagsHeaders`,type:{name:`Composite`,className:`BlobGetTagsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},sy={serializedName:`Blob_getTagsExceptionHeaders`,type:{name:`Composite`,className:`BlobGetTagsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},cy={serializedName:`Blob_setTagsHeaders`,type:{name:`Composite`,className:`BlobSetTagsHeaders`,modelProperties:{clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ly={serializedName:`Blob_setTagsExceptionHeaders`,type:{name:`Composite`,className:`BlobSetTagsExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},uy={serializedName:`PageBlob_createHeaders`,type:{name:`Composite`,className:`PageBlobCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},dy={serializedName:`PageBlob_createExceptionHeaders`,type:{name:`Composite`,className:`PageBlobCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},fy={serializedName:`PageBlob_uploadPagesHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},py={serializedName:`PageBlob_uploadPagesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},my={serializedName:`PageBlob_clearPagesHeaders`,type:{name:`Composite`,className:`PageBlobClearPagesHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},hy={serializedName:`PageBlob_clearPagesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobClearPagesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},gy={serializedName:`PageBlob_uploadPagesFromURLHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesFromURLHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},_y={serializedName:`PageBlob_uploadPagesFromURLExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUploadPagesFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},vy={serializedName:`PageBlob_getPageRangesHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},yy={serializedName:`PageBlob_getPageRangesExceptionHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},by={serializedName:`PageBlob_getPageRangesDiffHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesDiffHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},xy={serializedName:`PageBlob_getPageRangesDiffExceptionHeaders`,type:{name:`Composite`,className:`PageBlobGetPageRangesDiffExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Sy={serializedName:`PageBlob_resizeHeaders`,type:{name:`Composite`,className:`PageBlobResizeHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Cy={serializedName:`PageBlob_resizeExceptionHeaders`,type:{name:`Composite`,className:`PageBlobResizeExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},wy={serializedName:`PageBlob_updateSequenceNumberHeaders`,type:{name:`Composite`,className:`PageBlobUpdateSequenceNumberHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},blobSequenceNumber:{serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ty={serializedName:`PageBlob_updateSequenceNumberExceptionHeaders`,type:{name:`Composite`,className:`PageBlobUpdateSequenceNumberExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ey={serializedName:`PageBlob_copyIncrementalHeaders`,type:{name:`Composite`,className:`PageBlobCopyIncrementalHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},copyId:{serializedName:`x-ms-copy-id`,xmlName:`x-ms-copy-id`,type:{name:`String`}},copyStatus:{serializedName:`x-ms-copy-status`,xmlName:`x-ms-copy-status`,type:{name:`Enum`,allowedValues:[`pending`,`success`,`aborted`,`failed`]}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Dy={serializedName:`PageBlob_copyIncrementalExceptionHeaders`,type:{name:`Composite`,className:`PageBlobCopyIncrementalExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Oy={serializedName:`AppendBlob_createHeaders`,type:{name:`Composite`,className:`AppendBlobCreateHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},ky={serializedName:`AppendBlob_createExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobCreateExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ay={serializedName:`AppendBlob_appendBlockHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobAppendOffset:{serializedName:`x-ms-blob-append-offset`,xmlName:`x-ms-blob-append-offset`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},jy={serializedName:`AppendBlob_appendBlockExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},My={serializedName:`AppendBlob_appendBlockFromUrlHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockFromUrlHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},blobAppendOffset:{serializedName:`x-ms-blob-append-offset`,xmlName:`x-ms-blob-append-offset`,type:{name:`String`}},blobCommittedBlockCount:{serializedName:`x-ms-blob-committed-block-count`,xmlName:`x-ms-blob-committed-block-count`,type:{name:`Number`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ny={serializedName:`AppendBlob_appendBlockFromUrlExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobAppendBlockFromUrlExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Py={serializedName:`AppendBlob_sealHeaders`,type:{name:`Composite`,className:`AppendBlobSealHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isSealed:{serializedName:`x-ms-blob-sealed`,xmlName:`x-ms-blob-sealed`,type:{name:`Boolean`}}}}},Fy={serializedName:`AppendBlob_sealExceptionHeaders`,type:{name:`Composite`,className:`AppendBlobSealExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Iy={serializedName:`BlockBlob_uploadHeaders`,type:{name:`Composite`,className:`BlockBlobUploadHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ly={serializedName:`BlockBlob_uploadExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobUploadExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ry={serializedName:`BlockBlob_putBlobFromUrlHeaders`,type:{name:`Composite`,className:`BlockBlobPutBlobFromUrlHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},zy={serializedName:`BlockBlob_putBlobFromUrlExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobPutBlobFromUrlExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},By={serializedName:`BlockBlob_stageBlockHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockHeaders`,modelProperties:{contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Vy={serializedName:`BlockBlob_stageBlockExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Hy={serializedName:`BlockBlob_stageBlockFromURLHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockFromURLHeaders`,modelProperties:{contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Uy={serializedName:`BlockBlob_stageBlockFromURLExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobStageBlockFromURLExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}},copySourceErrorCode:{serializedName:`x-ms-copy-source-error-code`,xmlName:`x-ms-copy-source-error-code`,type:{name:`String`}},copySourceStatusCode:{serializedName:`x-ms-copy-source-status-code`,xmlName:`x-ms-copy-source-status-code`,type:{name:`Number`}}}}},Wy={serializedName:`BlockBlob_commitBlockListHeaders`,type:{name:`Composite`,className:`BlockBlobCommitBlockListHeaders`,modelProperties:{etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},contentMD5:{serializedName:`content-md5`,xmlName:`content-md5`,type:{name:`ByteArray`}},xMsContentCrc64:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},versionId:{serializedName:`x-ms-version-id`,xmlName:`x-ms-version-id`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},isServerEncrypted:{serializedName:`x-ms-request-server-encrypted`,xmlName:`x-ms-request-server-encrypted`,type:{name:`Boolean`}},encryptionKeySha256:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}},encryptionScope:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Gy={serializedName:`BlockBlob_commitBlockListExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobCommitBlockListExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Ky={serializedName:`BlockBlob_getBlockListHeaders`,type:{name:`Composite`,className:`BlockBlobGetBlockListHeaders`,modelProperties:{lastModified:{serializedName:`last-modified`,xmlName:`last-modified`,type:{name:`DateTimeRfc1123`}},etag:{serializedName:`etag`,xmlName:`etag`,type:{name:`String`}},contentType:{serializedName:`content-type`,xmlName:`content-type`,type:{name:`String`}},blobContentLength:{serializedName:`x-ms-blob-content-length`,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}},clientRequestId:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}},requestId:{serializedName:`x-ms-request-id`,xmlName:`x-ms-request-id`,type:{name:`String`}},version:{serializedName:`x-ms-version`,xmlName:`x-ms-version`,type:{name:`String`}},date:{serializedName:`date`,xmlName:`date`,type:{name:`DateTimeRfc1123`}},errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},qy={serializedName:`BlockBlob_getBlockListExceptionHeaders`,type:{name:`Composite`,className:`BlockBlobGetBlockListExceptionHeaders`,modelProperties:{errorCode:{serializedName:`x-ms-error-code`,xmlName:`x-ms-error-code`,type:{name:`String`}}}}},Jy={parameterPath:[`options`,`contentType`],mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Content-Type`,type:{name:`String`}}},Yy={parameterPath:`blobServiceProperties`,mapper:Mg},Xy={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},q={parameterPath:`url`,mapper:{serializedName:`url`,required:!0,xmlName:`url`,type:{name:`String`}},skipEncoding:!0},Zy={parameterPath:`restype`,mapper:{defaultValue:`service`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},Qy={parameterPath:`comp`,mapper:{defaultValue:`properties`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},J={parameterPath:[`options`,`timeoutInSeconds`],mapper:{constraints:{InclusiveMinimum:0},serializedName:`timeout`,xmlName:`timeout`,type:{name:`Number`}}},Y={parameterPath:`version`,mapper:{defaultValue:`2026-02-06`,isConstant:!0,serializedName:`x-ms-version`,type:{name:`String`}}},X={parameterPath:[`options`,`requestId`],mapper:{serializedName:`x-ms-client-request-id`,xmlName:`x-ms-client-request-id`,type:{name:`String`}}},Z={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},$y={parameterPath:`comp`,mapper:{defaultValue:`stats`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},eb={parameterPath:`comp`,mapper:{defaultValue:`list`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},tb={parameterPath:[`options`,`prefix`],mapper:{serializedName:`prefix`,xmlName:`prefix`,type:{name:`String`}}},nb={parameterPath:[`options`,`marker`],mapper:{serializedName:`marker`,xmlName:`marker`,type:{name:`String`}}},rb={parameterPath:[`options`,`maxPageSize`],mapper:{constraints:{InclusiveMinimum:1},serializedName:`maxresults`,xmlName:`maxresults`,type:{name:`Number`}}},ib={parameterPath:[`options`,`include`],mapper:{serializedName:`include`,xmlName:`include`,xmlElementName:`ListContainersIncludeType`,type:{name:`Sequence`,element:{type:{name:`Enum`,allowedValues:[`metadata`,`deleted`,`system`]}}}},collectionFormat:`CSV`},ab={parameterPath:`keyInfo`,mapper:Ug},ob={parameterPath:`comp`,mapper:{defaultValue:`userdelegationkey`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},sb={parameterPath:`restype`,mapper:{defaultValue:`account`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},cb={parameterPath:`body`,mapper:{serializedName:`body`,required:!0,xmlName:`body`,type:{name:`Stream`}}},lb={parameterPath:`comp`,mapper:{defaultValue:`batch`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},ub={parameterPath:`contentLength`,mapper:{serializedName:`Content-Length`,required:!0,xmlName:`Content-Length`,type:{name:`Number`}}},db={parameterPath:`multipartContentType`,mapper:{serializedName:`Content-Type`,required:!0,xmlName:`Content-Type`,type:{name:`String`}}},fb={parameterPath:`comp`,mapper:{defaultValue:`blobs`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},pb={parameterPath:[`options`,`where`],mapper:{serializedName:`where`,xmlName:`where`,type:{name:`String`}}},mb={parameterPath:`restype`,mapper:{defaultValue:`container`,isConstant:!0,serializedName:`restype`,type:{name:`String`}}},hb={parameterPath:[`options`,`metadata`],mapper:{serializedName:`x-ms-meta`,xmlName:`x-ms-meta`,headerCollectionPrefix:`x-ms-meta-`,type:{name:`Dictionary`,value:{type:{name:`String`}}}}},gb={parameterPath:[`options`,`access`],mapper:{serializedName:`x-ms-blob-public-access`,xmlName:`x-ms-blob-public-access`,type:{name:`Enum`,allowedValues:[`container`,`blob`]}}},_b={parameterPath:[`options`,`containerEncryptionScope`,`defaultEncryptionScope`],mapper:{serializedName:`x-ms-default-encryption-scope`,xmlName:`x-ms-default-encryption-scope`,type:{name:`String`}}},vb={parameterPath:[`options`,`containerEncryptionScope`,`preventEncryptionScopeOverride`],mapper:{serializedName:`x-ms-deny-encryption-scope-override`,xmlName:`x-ms-deny-encryption-scope-override`,type:{name:`Boolean`}}},yb={parameterPath:[`options`,`leaseAccessConditions`,`leaseId`],mapper:{serializedName:`x-ms-lease-id`,xmlName:`x-ms-lease-id`,type:{name:`String`}}},bb={parameterPath:[`options`,`modifiedAccessConditions`,`ifModifiedSince`],mapper:{serializedName:`If-Modified-Since`,xmlName:`If-Modified-Since`,type:{name:`DateTimeRfc1123`}}},xb={parameterPath:[`options`,`modifiedAccessConditions`,`ifUnmodifiedSince`],mapper:{serializedName:`If-Unmodified-Since`,xmlName:`If-Unmodified-Since`,type:{name:`DateTimeRfc1123`}}},Sb={parameterPath:`comp`,mapper:{defaultValue:`metadata`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Cb={parameterPath:`comp`,mapper:{defaultValue:`acl`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},wb={parameterPath:[`options`,`containerAcl`],mapper:{serializedName:`containerAcl`,xmlName:`SignedIdentifiers`,xmlIsWrapped:!0,xmlElementName:`SignedIdentifier`,type:{name:`Sequence`,element:{type:{name:`Composite`,className:`SignedIdentifier`}}}}},Tb={parameterPath:`comp`,mapper:{defaultValue:`undelete`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Eb={parameterPath:[`options`,`deletedContainerName`],mapper:{serializedName:`x-ms-deleted-container-name`,xmlName:`x-ms-deleted-container-name`,type:{name:`String`}}},Db={parameterPath:[`options`,`deletedContainerVersion`],mapper:{serializedName:`x-ms-deleted-container-version`,xmlName:`x-ms-deleted-container-version`,type:{name:`String`}}},Ob={parameterPath:`comp`,mapper:{defaultValue:`rename`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},kb={parameterPath:`sourceContainerName`,mapper:{serializedName:`x-ms-source-container-name`,required:!0,xmlName:`x-ms-source-container-name`,type:{name:`String`}}},Ab={parameterPath:[`options`,`sourceLeaseId`],mapper:{serializedName:`x-ms-source-lease-id`,xmlName:`x-ms-source-lease-id`,type:{name:`String`}}},jb={parameterPath:`comp`,mapper:{defaultValue:`lease`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Mb={parameterPath:`action`,mapper:{defaultValue:`acquire`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Nb={parameterPath:[`options`,`duration`],mapper:{serializedName:`x-ms-lease-duration`,xmlName:`x-ms-lease-duration`,type:{name:`Number`}}},Pb={parameterPath:[`options`,`proposedLeaseId`],mapper:{serializedName:`x-ms-proposed-lease-id`,xmlName:`x-ms-proposed-lease-id`,type:{name:`String`}}},Fb={parameterPath:`action`,mapper:{defaultValue:`release`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Ib={parameterPath:`leaseId`,mapper:{serializedName:`x-ms-lease-id`,required:!0,xmlName:`x-ms-lease-id`,type:{name:`String`}}},Lb={parameterPath:`action`,mapper:{defaultValue:`renew`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Rb={parameterPath:`action`,mapper:{defaultValue:`break`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},zb={parameterPath:[`options`,`breakPeriod`],mapper:{serializedName:`x-ms-lease-break-period`,xmlName:`x-ms-lease-break-period`,type:{name:`Number`}}},Bb={parameterPath:`action`,mapper:{defaultValue:`change`,isConstant:!0,serializedName:`x-ms-lease-action`,type:{name:`String`}}},Vb={parameterPath:`proposedLeaseId`,mapper:{serializedName:`x-ms-proposed-lease-id`,required:!0,xmlName:`x-ms-proposed-lease-id`,type:{name:`String`}}},Hb={parameterPath:[`options`,`include`],mapper:{serializedName:`include`,xmlName:`include`,xmlElementName:`ListBlobsIncludeItem`,type:{name:`Sequence`,element:{type:{name:`Enum`,allowedValues:[`copy`,`deleted`,`metadata`,`snapshots`,`uncommittedblobs`,`versions`,`tags`,`immutabilitypolicy`,`legalhold`,`deletedwithversions`]}}}},collectionFormat:`CSV`},Ub={parameterPath:[`options`,`startFrom`],mapper:{serializedName:`startFrom`,xmlName:`startFrom`,type:{name:`String`}}},Wb={parameterPath:`delimiter`,mapper:{serializedName:`delimiter`,required:!0,xmlName:`delimiter`,type:{name:`String`}}},Gb={parameterPath:[`options`,`snapshot`],mapper:{serializedName:`snapshot`,xmlName:`snapshot`,type:{name:`String`}}},Kb={parameterPath:[`options`,`versionId`],mapper:{serializedName:`versionid`,xmlName:`versionid`,type:{name:`String`}}},qb={parameterPath:[`options`,`range`],mapper:{serializedName:`x-ms-range`,xmlName:`x-ms-range`,type:{name:`String`}}},Jb={parameterPath:[`options`,`rangeGetContentMD5`],mapper:{serializedName:`x-ms-range-get-content-md5`,xmlName:`x-ms-range-get-content-md5`,type:{name:`Boolean`}}},Yb={parameterPath:[`options`,`rangeGetContentCRC64`],mapper:{serializedName:`x-ms-range-get-content-crc64`,xmlName:`x-ms-range-get-content-crc64`,type:{name:`Boolean`}}},Xb={parameterPath:[`options`,`cpkInfo`,`encryptionKey`],mapper:{serializedName:`x-ms-encryption-key`,xmlName:`x-ms-encryption-key`,type:{name:`String`}}},Zb={parameterPath:[`options`,`cpkInfo`,`encryptionKeySha256`],mapper:{serializedName:`x-ms-encryption-key-sha256`,xmlName:`x-ms-encryption-key-sha256`,type:{name:`String`}}},Qb={parameterPath:[`options`,`cpkInfo`,`encryptionAlgorithm`],mapper:{serializedName:`x-ms-encryption-algorithm`,xmlName:`x-ms-encryption-algorithm`,type:{name:`String`}}},$b={parameterPath:[`options`,`modifiedAccessConditions`,`ifMatch`],mapper:{serializedName:`If-Match`,xmlName:`If-Match`,type:{name:`String`}}},ex={parameterPath:[`options`,`modifiedAccessConditions`,`ifNoneMatch`],mapper:{serializedName:`If-None-Match`,xmlName:`If-None-Match`,type:{name:`String`}}},tx={parameterPath:[`options`,`modifiedAccessConditions`,`ifTags`],mapper:{serializedName:`x-ms-if-tags`,xmlName:`x-ms-if-tags`,type:{name:`String`}}},nx={parameterPath:[`options`,`deleteSnapshots`],mapper:{serializedName:`x-ms-delete-snapshots`,xmlName:`x-ms-delete-snapshots`,type:{name:`Enum`,allowedValues:[`include`,`only`]}}},rx={parameterPath:[`options`,`blobDeleteType`],mapper:{serializedName:`deletetype`,xmlName:`deletetype`,type:{name:`String`}}},ix={parameterPath:`comp`,mapper:{defaultValue:`expiry`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},ax={parameterPath:`expiryOptions`,mapper:{serializedName:`x-ms-expiry-option`,required:!0,xmlName:`x-ms-expiry-option`,type:{name:`String`}}},ox={parameterPath:[`options`,`expiresOn`],mapper:{serializedName:`x-ms-expiry-time`,xmlName:`x-ms-expiry-time`,type:{name:`String`}}},sx={parameterPath:[`options`,`blobHttpHeaders`,`blobCacheControl`],mapper:{serializedName:`x-ms-blob-cache-control`,xmlName:`x-ms-blob-cache-control`,type:{name:`String`}}},cx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentType`],mapper:{serializedName:`x-ms-blob-content-type`,xmlName:`x-ms-blob-content-type`,type:{name:`String`}}},lx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentMD5`],mapper:{serializedName:`x-ms-blob-content-md5`,xmlName:`x-ms-blob-content-md5`,type:{name:`ByteArray`}}},ux={parameterPath:[`options`,`blobHttpHeaders`,`blobContentEncoding`],mapper:{serializedName:`x-ms-blob-content-encoding`,xmlName:`x-ms-blob-content-encoding`,type:{name:`String`}}},dx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentLanguage`],mapper:{serializedName:`x-ms-blob-content-language`,xmlName:`x-ms-blob-content-language`,type:{name:`String`}}},fx={parameterPath:[`options`,`blobHttpHeaders`,`blobContentDisposition`],mapper:{serializedName:`x-ms-blob-content-disposition`,xmlName:`x-ms-blob-content-disposition`,type:{name:`String`}}},px={parameterPath:`comp`,mapper:{defaultValue:`immutabilityPolicies`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},mx={parameterPath:[`options`,`immutabilityPolicyExpiry`],mapper:{serializedName:`x-ms-immutability-policy-until-date`,xmlName:`x-ms-immutability-policy-until-date`,type:{name:`DateTimeRfc1123`}}},hx={parameterPath:[`options`,`immutabilityPolicyMode`],mapper:{serializedName:`x-ms-immutability-policy-mode`,xmlName:`x-ms-immutability-policy-mode`,type:{name:`Enum`,allowedValues:[`Mutable`,`Unlocked`,`Locked`]}}},gx={parameterPath:`comp`,mapper:{defaultValue:`legalhold`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},_x={parameterPath:`legalHold`,mapper:{serializedName:`x-ms-legal-hold`,required:!0,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}},vx={parameterPath:[`options`,`encryptionScope`],mapper:{serializedName:`x-ms-encryption-scope`,xmlName:`x-ms-encryption-scope`,type:{name:`String`}}},yx={parameterPath:`comp`,mapper:{defaultValue:`snapshot`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},bx={parameterPath:[`options`,`tier`],mapper:{serializedName:`x-ms-access-tier`,xmlName:`x-ms-access-tier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}}},xx={parameterPath:[`options`,`rehydratePriority`],mapper:{serializedName:`x-ms-rehydrate-priority`,xmlName:`x-ms-rehydrate-priority`,type:{name:`Enum`,allowedValues:[`High`,`Standard`]}}},Sx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfModifiedSince`],mapper:{serializedName:`x-ms-source-if-modified-since`,xmlName:`x-ms-source-if-modified-since`,type:{name:`DateTimeRfc1123`}}},Cx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfUnmodifiedSince`],mapper:{serializedName:`x-ms-source-if-unmodified-since`,xmlName:`x-ms-source-if-unmodified-since`,type:{name:`DateTimeRfc1123`}}},wx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfMatch`],mapper:{serializedName:`x-ms-source-if-match`,xmlName:`x-ms-source-if-match`,type:{name:`String`}}},Tx={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfNoneMatch`],mapper:{serializedName:`x-ms-source-if-none-match`,xmlName:`x-ms-source-if-none-match`,type:{name:`String`}}},Ex={parameterPath:[`options`,`sourceModifiedAccessConditions`,`sourceIfTags`],mapper:{serializedName:`x-ms-source-if-tags`,xmlName:`x-ms-source-if-tags`,type:{name:`String`}}},Dx={parameterPath:`copySource`,mapper:{serializedName:`x-ms-copy-source`,required:!0,xmlName:`x-ms-copy-source`,type:{name:`String`}}},Ox={parameterPath:[`options`,`blobTagsString`],mapper:{serializedName:`x-ms-tags`,xmlName:`x-ms-tags`,type:{name:`String`}}},kx={parameterPath:[`options`,`sealBlob`],mapper:{serializedName:`x-ms-seal-blob`,xmlName:`x-ms-seal-blob`,type:{name:`Boolean`}}},Ax={parameterPath:[`options`,`legalHold`],mapper:{serializedName:`x-ms-legal-hold`,xmlName:`x-ms-legal-hold`,type:{name:`Boolean`}}},jx={parameterPath:`xMsRequiresSync`,mapper:{defaultValue:`true`,isConstant:!0,serializedName:`x-ms-requires-sync`,type:{name:`String`}}},Mx={parameterPath:[`options`,`sourceContentMD5`],mapper:{serializedName:`x-ms-source-content-md5`,xmlName:`x-ms-source-content-md5`,type:{name:`ByteArray`}}},Nx={parameterPath:[`options`,`copySourceAuthorization`],mapper:{serializedName:`x-ms-copy-source-authorization`,xmlName:`x-ms-copy-source-authorization`,type:{name:`String`}}},Px={parameterPath:[`options`,`copySourceTags`],mapper:{serializedName:`x-ms-copy-source-tag-option`,xmlName:`x-ms-copy-source-tag-option`,type:{name:`Enum`,allowedValues:[`REPLACE`,`COPY`]}}},Fx={parameterPath:[`options`,`fileRequestIntent`],mapper:{serializedName:`x-ms-file-request-intent`,xmlName:`x-ms-file-request-intent`,type:{name:`String`}}},Ix={parameterPath:`comp`,mapper:{defaultValue:`copy`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Lx={parameterPath:`copyActionAbortConstant`,mapper:{defaultValue:`abort`,isConstant:!0,serializedName:`x-ms-copy-action`,type:{name:`String`}}},Rx={parameterPath:`copyId`,mapper:{serializedName:`copyid`,required:!0,xmlName:`copyid`,type:{name:`String`}}},zx={parameterPath:`comp`,mapper:{defaultValue:`tier`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Bx={parameterPath:`tier`,mapper:{serializedName:`x-ms-access-tier`,required:!0,xmlName:`x-ms-access-tier`,type:{name:`Enum`,allowedValues:[`P4`,`P6`,`P10`,`P15`,`P20`,`P30`,`P40`,`P50`,`P60`,`P70`,`P80`,`Hot`,`Cool`,`Archive`,`Cold`]}}},Vx={parameterPath:[`options`,`queryRequest`],mapper:d_},Hx={parameterPath:`comp`,mapper:{defaultValue:`query`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Ux={parameterPath:`comp`,mapper:{defaultValue:`tags`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},Wx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifModifiedSince`],mapper:{serializedName:`x-ms-blob-if-modified-since`,xmlName:`x-ms-blob-if-modified-since`,type:{name:`DateTimeRfc1123`}}},Gx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifUnmodifiedSince`],mapper:{serializedName:`x-ms-blob-if-unmodified-since`,xmlName:`x-ms-blob-if-unmodified-since`,type:{name:`DateTimeRfc1123`}}},Kx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifMatch`],mapper:{serializedName:`x-ms-blob-if-match`,xmlName:`x-ms-blob-if-match`,type:{name:`String`}}},qx={parameterPath:[`options`,`blobModifiedAccessConditions`,`ifNoneMatch`],mapper:{serializedName:`x-ms-blob-if-none-match`,xmlName:`x-ms-blob-if-none-match`,type:{name:`String`}}},Jx={parameterPath:[`options`,`tags`],mapper:qg},Yx={parameterPath:[`options`,`transactionalContentMD5`],mapper:{serializedName:`Content-MD5`,xmlName:`Content-MD5`,type:{name:`ByteArray`}}},Xx={parameterPath:[`options`,`transactionalContentCrc64`],mapper:{serializedName:`x-ms-content-crc64`,xmlName:`x-ms-content-crc64`,type:{name:`ByteArray`}}},Zx={parameterPath:`blobType`,mapper:{defaultValue:`PageBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},Qx={parameterPath:`blobContentLength`,mapper:{serializedName:`x-ms-blob-content-length`,required:!0,xmlName:`x-ms-blob-content-length`,type:{name:`Number`}}},$x={parameterPath:[`options`,`blobSequenceNumber`],mapper:{defaultValue:0,serializedName:`x-ms-blob-sequence-number`,xmlName:`x-ms-blob-sequence-number`,type:{name:`Number`}}},eS={parameterPath:[`options`,`contentType`],mapper:{defaultValue:`application/octet-stream`,isConstant:!0,serializedName:`Content-Type`,type:{name:`String`}}},tS={parameterPath:`body`,mapper:{serializedName:`body`,required:!0,xmlName:`body`,type:{name:`Stream`}}},nS={parameterPath:`accept`,mapper:{defaultValue:`application/xml`,isConstant:!0,serializedName:`Accept`,type:{name:`String`}}},rS={parameterPath:`comp`,mapper:{defaultValue:`page`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},iS={parameterPath:`pageWrite`,mapper:{defaultValue:`update`,isConstant:!0,serializedName:`x-ms-page-write`,type:{name:`String`}}},aS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberLessThanOrEqualTo`],mapper:{serializedName:`x-ms-if-sequence-number-le`,xmlName:`x-ms-if-sequence-number-le`,type:{name:`Number`}}},oS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberLessThan`],mapper:{serializedName:`x-ms-if-sequence-number-lt`,xmlName:`x-ms-if-sequence-number-lt`,type:{name:`Number`}}},sS={parameterPath:[`options`,`sequenceNumberAccessConditions`,`ifSequenceNumberEqualTo`],mapper:{serializedName:`x-ms-if-sequence-number-eq`,xmlName:`x-ms-if-sequence-number-eq`,type:{name:`Number`}}},cS={parameterPath:`pageWrite`,mapper:{defaultValue:`clear`,isConstant:!0,serializedName:`x-ms-page-write`,type:{name:`String`}}},lS={parameterPath:`sourceUrl`,mapper:{serializedName:`x-ms-copy-source`,required:!0,xmlName:`x-ms-copy-source`,type:{name:`String`}}},uS={parameterPath:`sourceRange`,mapper:{serializedName:`x-ms-source-range`,required:!0,xmlName:`x-ms-source-range`,type:{name:`String`}}},dS={parameterPath:[`options`,`sourceContentCrc64`],mapper:{serializedName:`x-ms-source-content-crc64`,xmlName:`x-ms-source-content-crc64`,type:{name:`ByteArray`}}},fS={parameterPath:`range`,mapper:{serializedName:`x-ms-range`,required:!0,xmlName:`x-ms-range`,type:{name:`String`}}},pS={parameterPath:`comp`,mapper:{defaultValue:`pagelist`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},mS={parameterPath:[`options`,`prevsnapshot`],mapper:{serializedName:`prevsnapshot`,xmlName:`prevsnapshot`,type:{name:`String`}}},hS={parameterPath:[`options`,`prevSnapshotUrl`],mapper:{serializedName:`x-ms-previous-snapshot-url`,xmlName:`x-ms-previous-snapshot-url`,type:{name:`String`}}},gS={parameterPath:`sequenceNumberAction`,mapper:{serializedName:`x-ms-sequence-number-action`,required:!0,xmlName:`x-ms-sequence-number-action`,type:{name:`Enum`,allowedValues:[`max`,`update`,`increment`]}}},_S={parameterPath:`comp`,mapper:{defaultValue:`incrementalcopy`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},vS={parameterPath:`blobType`,mapper:{defaultValue:`AppendBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},yS={parameterPath:`comp`,mapper:{defaultValue:`appendblock`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},bS={parameterPath:[`options`,`appendPositionAccessConditions`,`maxSize`],mapper:{serializedName:`x-ms-blob-condition-maxsize`,xmlName:`x-ms-blob-condition-maxsize`,type:{name:`Number`}}},xS={parameterPath:[`options`,`appendPositionAccessConditions`,`appendPosition`],mapper:{serializedName:`x-ms-blob-condition-appendpos`,xmlName:`x-ms-blob-condition-appendpos`,type:{name:`Number`}}},SS={parameterPath:[`options`,`sourceRange`],mapper:{serializedName:`x-ms-source-range`,xmlName:`x-ms-source-range`,type:{name:`String`}}},CS={parameterPath:`comp`,mapper:{defaultValue:`seal`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},wS={parameterPath:`blobType`,mapper:{defaultValue:`BlockBlob`,isConstant:!0,serializedName:`x-ms-blob-type`,type:{name:`String`}}},TS={parameterPath:[`options`,`copySourceBlobProperties`],mapper:{serializedName:`x-ms-copy-source-blob-properties`,xmlName:`x-ms-copy-source-blob-properties`,type:{name:`Boolean`}}},ES={parameterPath:`comp`,mapper:{defaultValue:`block`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},DS={parameterPath:`blockId`,mapper:{serializedName:`blockid`,required:!0,xmlName:`blockid`,type:{name:`String`}}},OS={parameterPath:`blocks`,mapper:a_},kS={parameterPath:`comp`,mapper:{defaultValue:`blocklist`,isConstant:!0,serializedName:`comp`,type:{name:`String`}}},AS={parameterPath:`listType`,mapper:{defaultValue:`committed`,serializedName:`blocklisttype`,required:!0,xmlName:`blocklisttype`,type:{name:`Enum`,allowedValues:[`committed`,`uncommitted`,`all`]}}};var jS=class{client;constructor(e){this.client=e}setProperties(e,t){return this.client.sendOperationRequest({blobServiceProperties:e,options:t},NS)}getProperties(e){return this.client.sendOperationRequest({options:e},PS)}getStatistics(e){return this.client.sendOperationRequest({options:e},FS)}listContainersSegment(e){return this.client.sendOperationRequest({options:e},IS)}getUserDelegationKey(e,t){return this.client.sendOperationRequest({keyInfo:e,options:t},LS)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},RS)}submitBatch(e,t,n,r){return this.client.sendOperationRequest({contentLength:e,multipartContentType:t,body:n,options:r},zS)}filterBlobs(e){return this.client.sendOperationRequest({options:e},BS)}};const MS=Yd(jg,!0),NS={path:`/`,httpMethod:`PUT`,responses:{202:{headersMapper:v_},default:{bodyMapper:K,headersMapper:y_}},requestBody:Yy,queryParameters:[Zy,Qy,J],urlParameters:[q],headerParameters:[Jy,Xy,Y,X],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:MS},PS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Mg,headersMapper:b_},default:{bodyMapper:K,headersMapper:x_}},queryParameters:[Zy,Qy,J],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:MS},FS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Rg,headersMapper:S_},default:{bodyMapper:K,headersMapper:C_}},queryParameters:[Zy,J,$y],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:MS},IS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Bg,headersMapper:w_},default:{bodyMapper:K,headersMapper:T_}},queryParameters:[J,eb,tb,nb,rb,ib],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:MS},LS={path:`/`,httpMethod:`POST`,responses:{200:{bodyMapper:Wg,headersMapper:E_},default:{bodyMapper:K,headersMapper:D_}},requestBody:ab,queryParameters:[Zy,J,ob],urlParameters:[q],headerParameters:[Jy,Xy,Y,X],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:MS},RS={path:`/`,httpMethod:`GET`,responses:{200:{headersMapper:O_},default:{bodyMapper:K,headersMapper:k_}},queryParameters:[Qy,J,sb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:MS},zS={path:`/`,httpMethod:`POST`,responses:{202:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:A_},default:{bodyMapper:K,headersMapper:j_}},requestBody:cb,queryParameters:[J,lb],urlParameters:[q],headerParameters:[Xy,Y,X,ub,db],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:MS},BS={path:`/`,httpMethod:`GET`,responses:{200:{bodyMapper:Gg,headersMapper:M_},default:{bodyMapper:K,headersMapper:N_}},queryParameters:[J,nb,rb,fb,pb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:MS};var VS=class{client;constructor(e){this.client=e}create(e){return this.client.sendOperationRequest({options:e},US)}getProperties(e){return this.client.sendOperationRequest({options:e},WS)}delete(e){return this.client.sendOperationRequest({options:e},GS)}setMetadata(e){return this.client.sendOperationRequest({options:e},KS)}getAccessPolicy(e){return this.client.sendOperationRequest({options:e},qS)}setAccessPolicy(e){return this.client.sendOperationRequest({options:e},JS)}restore(e){return this.client.sendOperationRequest({options:e},YS)}rename(e,t){return this.client.sendOperationRequest({sourceContainerName:e,options:t},XS)}submitBatch(e,t,n,r){return this.client.sendOperationRequest({contentLength:e,multipartContentType:t,body:n,options:r},ZS)}filterBlobs(e){return this.client.sendOperationRequest({options:e},QS)}acquireLease(e){return this.client.sendOperationRequest({options:e},$S)}releaseLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},eC)}renewLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},tC)}breakLease(e){return this.client.sendOperationRequest({options:e},nC)}changeLease(e,t,n){return this.client.sendOperationRequest({leaseId:e,proposedLeaseId:t,options:n},rC)}listBlobFlatSegment(e){return this.client.sendOperationRequest({options:e},iC)}listBlobHierarchySegment(e,t){return this.client.sendOperationRequest({delimiter:e,options:t},aC)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},oC)}};const HS=Yd(jg,!0),US={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:P_},default:{bodyMapper:K,headersMapper:F_}},queryParameters:[J,mb],urlParameters:[q],headerParameters:[Y,X,Z,hb,gb,_b,vb],isXML:!0,serializer:HS},WS={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{headersMapper:I_},default:{bodyMapper:K,headersMapper:L_}},queryParameters:[J,mb],urlParameters:[q],headerParameters:[Y,X,Z,yb],isXML:!0,serializer:HS},GS={path:`/{containerName}`,httpMethod:`DELETE`,responses:{202:{headersMapper:R_},default:{bodyMapper:K,headersMapper:z_}},queryParameters:[J,mb],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb],isXML:!0,serializer:HS},KS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:B_},default:{bodyMapper:K,headersMapper:V_}},queryParameters:[J,mb,Sb],urlParameters:[q],headerParameters:[Y,X,Z,hb,yb,bb],isXML:!0,serializer:HS},qS={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:{type:{name:`Sequence`,element:{type:{name:`Composite`,className:`SignedIdentifier`}}},serializedName:`SignedIdentifiers`,xmlName:`SignedIdentifiers`,xmlIsWrapped:!0,xmlElementName:`SignedIdentifier`},headersMapper:H_},default:{bodyMapper:K,headersMapper:U_}},queryParameters:[J,mb,Cb],urlParameters:[q],headerParameters:[Y,X,Z,yb],isXML:!0,serializer:HS},JS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:W_},default:{bodyMapper:K,headersMapper:G_}},requestBody:wb,queryParameters:[J,mb,Cb],urlParameters:[q],headerParameters:[Jy,Xy,Y,X,gb,yb,bb,xb],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:HS},YS={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:K_},default:{bodyMapper:K,headersMapper:q_}},queryParameters:[J,mb,Tb],urlParameters:[q],headerParameters:[Y,X,Z,Eb,Db],isXML:!0,serializer:HS},XS={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:J_},default:{bodyMapper:K,headersMapper:Y_}},queryParameters:[J,mb,Ob],urlParameters:[q],headerParameters:[Y,X,Z,kb,Ab],isXML:!0,serializer:HS},ZS={path:`/{containerName}`,httpMethod:`POST`,responses:{202:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:X_},default:{bodyMapper:K,headersMapper:Z_}},requestBody:cb,queryParameters:[J,lb,mb],urlParameters:[q],headerParameters:[Xy,Y,X,ub,db],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:HS},QS={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:Gg,headersMapper:Q_},default:{bodyMapper:K,headersMapper:$_}},queryParameters:[J,nb,rb,fb,pb,mb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:HS},$S={path:`/{containerName}`,httpMethod:`PUT`,responses:{201:{headersMapper:ev},default:{bodyMapper:K,headersMapper:tv}},queryParameters:[J,mb,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Mb,Nb,Pb],isXML:!0,serializer:HS},eC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:nv},default:{bodyMapper:K,headersMapper:rv}},queryParameters:[J,mb,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Fb,Ib],isXML:!0,serializer:HS},tC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:iv},default:{bodyMapper:K,headersMapper:av}},queryParameters:[J,mb,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Ib,Lb],isXML:!0,serializer:HS},nC={path:`/{containerName}`,httpMethod:`PUT`,responses:{202:{headersMapper:ov},default:{bodyMapper:K,headersMapper:sv}},queryParameters:[J,mb,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Rb,zb],isXML:!0,serializer:HS},rC={path:`/{containerName}`,httpMethod:`PUT`,responses:{200:{headersMapper:cv},default:{bodyMapper:K,headersMapper:lv}},queryParameters:[J,mb,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Ib,Bb,Vb],isXML:!0,serializer:HS},iC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:Zg,headersMapper:uv},default:{bodyMapper:K,headersMapper:dv}},queryParameters:[J,eb,tb,nb,rb,mb,Hb,Ub],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:HS},aC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{bodyMapper:n_,headersMapper:fv},default:{bodyMapper:K,headersMapper:pv}},queryParameters:[J,eb,tb,nb,rb,mb,Hb,Ub,Wb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:HS},oC={path:`/{containerName}`,httpMethod:`GET`,responses:{200:{headersMapper:mv},default:{bodyMapper:K,headersMapper:hv}},queryParameters:[Qy,J,sb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:HS};var sC=class{client;constructor(e){this.client=e}download(e){return this.client.sendOperationRequest({options:e},lC)}getProperties(e){return this.client.sendOperationRequest({options:e},uC)}delete(e){return this.client.sendOperationRequest({options:e},dC)}undelete(e){return this.client.sendOperationRequest({options:e},fC)}setExpiry(e,t){return this.client.sendOperationRequest({expiryOptions:e,options:t},pC)}setHttpHeaders(e){return this.client.sendOperationRequest({options:e},mC)}setImmutabilityPolicy(e){return this.client.sendOperationRequest({options:e},hC)}deleteImmutabilityPolicy(e){return this.client.sendOperationRequest({options:e},gC)}setLegalHold(e,t){return this.client.sendOperationRequest({legalHold:e,options:t},_C)}setMetadata(e){return this.client.sendOperationRequest({options:e},vC)}acquireLease(e){return this.client.sendOperationRequest({options:e},yC)}releaseLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},bC)}renewLease(e,t){return this.client.sendOperationRequest({leaseId:e,options:t},xC)}changeLease(e,t,n){return this.client.sendOperationRequest({leaseId:e,proposedLeaseId:t,options:n},SC)}breakLease(e){return this.client.sendOperationRequest({options:e},CC)}createSnapshot(e){return this.client.sendOperationRequest({options:e},wC)}startCopyFromURL(e,t){return this.client.sendOperationRequest({copySource:e,options:t},TC)}copyFromURL(e,t){return this.client.sendOperationRequest({copySource:e,options:t},EC)}abortCopyFromURL(e,t){return this.client.sendOperationRequest({copyId:e,options:t},DC)}setTier(e,t){return this.client.sendOperationRequest({tier:e,options:t},OC)}getAccountInfo(e){return this.client.sendOperationRequest({options:e},kC)}query(e){return this.client.sendOperationRequest({options:e},AC)}getTags(e){return this.client.sendOperationRequest({options:e},jC)}setTags(e){return this.client.sendOperationRequest({options:e},MC)}};const cC=Yd(jg,!0),lC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:gv},206:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:gv},default:{bodyMapper:K,headersMapper:_v}},queryParameters:[J,Gb,Kb],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx],isXML:!0,serializer:cC},uC={path:`/{containerName}/{blob}`,httpMethod:`HEAD`,responses:{200:{headersMapper:vv},default:{bodyMapper:K,headersMapper:yv}},queryParameters:[J,Gb,Kb],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx],isXML:!0,serializer:cC},dC={path:`/{containerName}/{blob}`,httpMethod:`DELETE`,responses:{202:{headersMapper:bv},default:{bodyMapper:K,headersMapper:xv}},queryParameters:[J,Gb,Kb,rx],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,$b,ex,tx,nx],isXML:!0,serializer:cC},fC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Sv},default:{bodyMapper:K,headersMapper:Cv}},queryParameters:[J,Tb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:cC},pC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:wv},default:{bodyMapper:K,headersMapper:Tv}},queryParameters:[J,ix],urlParameters:[q],headerParameters:[Y,X,Z,ax,ox],isXML:!0,serializer:cC},mC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Ev},default:{bodyMapper:K,headersMapper:Dv}},queryParameters:[Qy,J],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,$b,ex,tx,sx,cx,lx,ux,dx,fx],isXML:!0,serializer:cC},hC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Ov},default:{bodyMapper:K,headersMapper:kv}},queryParameters:[J,Gb,Kb,px],urlParameters:[q],headerParameters:[Y,X,Z,xb,mx,hx],isXML:!0,serializer:cC},gC={path:`/{containerName}/{blob}`,httpMethod:`DELETE`,responses:{200:{headersMapper:Av},default:{bodyMapper:K,headersMapper:jv}},queryParameters:[J,Gb,Kb,px],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:cC},_C={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Mv},default:{bodyMapper:K,headersMapper:Nv}},queryParameters:[J,Gb,Kb,gx],urlParameters:[q],headerParameters:[Y,X,Z,_x],isXML:!0,serializer:cC},vC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Pv},default:{bodyMapper:K,headersMapper:Fv}},queryParameters:[J,Sb],urlParameters:[q],headerParameters:[Y,X,Z,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx],isXML:!0,serializer:cC},yC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Iv},default:{bodyMapper:K,headersMapper:Lv}},queryParameters:[J,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Mb,Nb,Pb,$b,ex,tx],isXML:!0,serializer:cC},bC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Rv},default:{bodyMapper:K,headersMapper:zv}},queryParameters:[J,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Fb,Ib,$b,ex,tx],isXML:!0,serializer:cC},xC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Bv},default:{bodyMapper:K,headersMapper:Vv}},queryParameters:[J,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Ib,Lb,$b,ex,tx],isXML:!0,serializer:cC},SC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Hv},default:{bodyMapper:K,headersMapper:Uv}},queryParameters:[J,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Ib,Bb,Vb,$b,ex,tx],isXML:!0,serializer:cC},CC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Wv},default:{bodyMapper:K,headersMapper:Gv}},queryParameters:[J,jb],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,Rb,zb,$b,ex,tx],isXML:!0,serializer:cC},wC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Kv},default:{bodyMapper:K,headersMapper:qv}},queryParameters:[J,yx],urlParameters:[q],headerParameters:[Y,X,Z,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx],isXML:!0,serializer:cC},TC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Jv},default:{bodyMapper:K,headersMapper:Yv}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,hb,yb,bb,xb,$b,ex,tx,mx,hx,bx,xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax],isXML:!0,serializer:cC},EC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Xv},default:{bodyMapper:K,headersMapper:Zv}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,hb,yb,bb,xb,$b,ex,tx,mx,hx,vx,bx,Sx,Cx,wx,Tx,Dx,Ox,Ax,jx,Mx,Nx,Px,Fx],isXML:!0,serializer:cC},DC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{204:{headersMapper:Qv},default:{bodyMapper:K,headersMapper:$v}},queryParameters:[J,Ix,Rx],urlParameters:[q],headerParameters:[Y,X,Z,yb,Lx],isXML:!0,serializer:cC},OC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:ey},202:{headersMapper:ey},default:{bodyMapper:K,headersMapper:ty}},queryParameters:[J,Gb,Kb,zx],urlParameters:[q],headerParameters:[Y,X,Z,yb,tx,xx,Bx],isXML:!0,serializer:cC},kC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{headersMapper:ny},default:{bodyMapper:K,headersMapper:ry}},queryParameters:[Qy,J,sb],urlParameters:[q],headerParameters:[Y,X,Z],isXML:!0,serializer:cC},AC={path:`/{containerName}/{blob}`,httpMethod:`POST`,responses:{200:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:iy},206:{bodyMapper:{type:{name:`Stream`},serializedName:`parsedResponse`},headersMapper:iy},default:{bodyMapper:K,headersMapper:ay}},requestBody:Vx,queryParameters:[J,Gb,Hx],urlParameters:[q],headerParameters:[Jy,Xy,Y,X,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:cC},jC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:qg,headersMapper:oy},default:{bodyMapper:K,headersMapper:sy}},queryParameters:[J,Gb,Kb,Ux],urlParameters:[q],headerParameters:[Y,X,Z,yb,tx,Wx,Gx,Kx,qx],isXML:!0,serializer:cC},MC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{204:{headersMapper:cy},default:{bodyMapper:K,headersMapper:ly}},requestBody:Jx,queryParameters:[J,Kb,Ux],urlParameters:[q],headerParameters:[Jy,Xy,Y,X,yb,tx,Wx,Gx,Kx,qx,Yx,Xx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:cC};var NC=class{client;constructor(e){this.client=e}create(e,t,n){return this.client.sendOperationRequest({contentLength:e,blobContentLength:t,options:n},FC)}uploadPages(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},IC)}clearPages(e,t){return this.client.sendOperationRequest({contentLength:e,options:t},LC)}uploadPagesFromURL(e,t,n,r,i){return this.client.sendOperationRequest({sourceUrl:e,sourceRange:t,contentLength:n,range:r,options:i},RC)}getPageRanges(e){return this.client.sendOperationRequest({options:e},zC)}getPageRangesDiff(e){return this.client.sendOperationRequest({options:e},BC)}resize(e,t){return this.client.sendOperationRequest({blobContentLength:e,options:t},VC)}updateSequenceNumber(e,t){return this.client.sendOperationRequest({sequenceNumberAction:e,options:t},HC)}copyIncremental(e,t){return this.client.sendOperationRequest({copySource:e,options:t},UC)}};const PC=Yd(jg,!0),FC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:uy},default:{bodyMapper:K,headersMapper:dy}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,ub,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,sx,cx,lx,ux,dx,fx,mx,hx,vx,bx,Ox,Ax,Zx,Qx,$x],isXML:!0,serializer:PC},IC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:fy},default:{bodyMapper:K,headersMapper:py}},requestBody:tS,queryParameters:[J,rS],urlParameters:[q],headerParameters:[Y,X,ub,yb,bb,xb,qb,Xb,Zb,Qb,$b,ex,tx,vx,Yx,Xx,eS,nS,iS,aS,oS,sS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:PC},LC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:my},default:{bodyMapper:K,headersMapper:hy}},queryParameters:[J,rS],urlParameters:[q],headerParameters:[Y,X,Z,ub,yb,bb,xb,qb,Xb,Zb,Qb,$b,ex,tx,vx,aS,oS,sS,cS],isXML:!0,serializer:PC},RC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:gy},default:{bodyMapper:K,headersMapper:_y}},queryParameters:[J,rS],urlParameters:[q],headerParameters:[Y,X,Z,ub,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx,Sx,Cx,wx,Tx,Mx,Nx,Fx,iS,aS,oS,sS,lS,uS,dS,fS],isXML:!0,serializer:PC},zC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:c_,headersMapper:vy},default:{bodyMapper:K,headersMapper:yy}},queryParameters:[J,nb,rb,Gb,pS],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,qb,$b,ex,tx],isXML:!0,serializer:PC},BC={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:c_,headersMapper:by},default:{bodyMapper:K,headersMapper:xy}},queryParameters:[J,nb,rb,Gb,pS,mS],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,qb,$b,ex,tx,hS],isXML:!0,serializer:PC},VC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Sy},default:{bodyMapper:K,headersMapper:Cy}},queryParameters:[Qy,J],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx,Qx],isXML:!0,serializer:PC},HC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:wy},default:{bodyMapper:K,headersMapper:Ty}},queryParameters:[Qy,J],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,$b,ex,tx,$x,gS],isXML:!0,serializer:PC},UC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{202:{headersMapper:Ey},default:{bodyMapper:K,headersMapper:Dy}},queryParameters:[J,_S],urlParameters:[q],headerParameters:[Y,X,Z,bb,xb,$b,ex,tx,Dx],isXML:!0,serializer:PC};var WC=class{client;constructor(e){this.client=e}create(e,t){return this.client.sendOperationRequest({contentLength:e,options:t},KC)}appendBlock(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},qC)}appendBlockFromUrl(e,t,n){return this.client.sendOperationRequest({sourceUrl:e,contentLength:t,options:n},JC)}seal(e){return this.client.sendOperationRequest({options:e},YC)}};const GC=Yd(jg,!0),KC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Oy},default:{bodyMapper:K,headersMapper:ky}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,ub,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,sx,cx,lx,ux,dx,fx,mx,hx,vx,Ox,Ax,vS],isXML:!0,serializer:GC},qC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Ay},default:{bodyMapper:K,headersMapper:jy}},requestBody:tS,queryParameters:[J,yS],urlParameters:[q],headerParameters:[Y,X,ub,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx,Yx,Xx,eS,nS,bS,xS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:GC},JC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:My},default:{bodyMapper:K,headersMapper:Ny}},queryParameters:[J,yS],urlParameters:[q],headerParameters:[Y,X,Z,ub,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,vx,Sx,Cx,wx,Tx,Mx,Nx,Fx,Yx,lS,dS,bS,xS,SS],isXML:!0,serializer:GC},YC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{200:{headersMapper:Py},default:{bodyMapper:K,headersMapper:Fy}},queryParameters:[J,CS],urlParameters:[q],headerParameters:[Y,X,Z,yb,bb,xb,$b,ex,xS],isXML:!0,serializer:GC};var XC=class{client;constructor(e){this.client=e}upload(e,t,n){return this.client.sendOperationRequest({contentLength:e,body:t,options:n},QC)}putBlobFromUrl(e,t,n){return this.client.sendOperationRequest({contentLength:e,copySource:t,options:n},$C)}stageBlock(e,t,n,r){return this.client.sendOperationRequest({blockId:e,contentLength:t,body:n,options:r},ew)}stageBlockFromURL(e,t,n,r){return this.client.sendOperationRequest({blockId:e,contentLength:t,sourceUrl:n,options:r},tw)}commitBlockList(e,t){return this.client.sendOperationRequest({blocks:e,options:t},nw)}getBlockList(e,t){return this.client.sendOperationRequest({listType:e,options:t},rw)}};const ZC=Yd(jg,!0),QC={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Iy},default:{bodyMapper:K,headersMapper:Ly}},requestBody:tS,queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,ub,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,sx,cx,lx,ux,dx,fx,mx,hx,vx,bx,Ox,Ax,Yx,Xx,eS,nS,wS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:ZC},$C={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Ry},default:{bodyMapper:K,headersMapper:zy}},queryParameters:[J],urlParameters:[q],headerParameters:[Y,X,Z,ub,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,sx,cx,lx,ux,dx,fx,vx,bx,Sx,Cx,wx,Tx,Ex,Dx,Ox,Mx,Nx,Px,Fx,Yx,wS,TS],isXML:!0,serializer:ZC},ew={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:By},default:{bodyMapper:K,headersMapper:Vy}},requestBody:tS,queryParameters:[J,ES,DS],urlParameters:[q],headerParameters:[Y,X,ub,yb,Xb,Zb,Qb,vx,Yx,Xx,eS,nS],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`binary`,serializer:ZC},tw={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Hy},default:{bodyMapper:K,headersMapper:Uy}},queryParameters:[J,ES,DS],urlParameters:[q],headerParameters:[Y,X,Z,ub,yb,Xb,Zb,Qb,vx,Sx,Cx,wx,Tx,Mx,Nx,Fx,lS,dS,SS],isXML:!0,serializer:ZC},nw={path:`/{containerName}/{blob}`,httpMethod:`PUT`,responses:{201:{headersMapper:Wy},default:{bodyMapper:K,headersMapper:Gy}},requestBody:OS,queryParameters:[J,kS],urlParameters:[q],headerParameters:[Jy,Xy,Y,X,hb,yb,bb,xb,Xb,Zb,Qb,$b,ex,tx,sx,cx,lx,ux,dx,fx,mx,hx,vx,bx,Ox,Ax,Yx,Xx],isXML:!0,contentType:`application/xml; charset=utf-8`,mediaType:`xml`,serializer:ZC},rw={path:`/{containerName}/{blob}`,httpMethod:`GET`,responses:{200:{bodyMapper:o_,headersMapper:Ky},default:{bodyMapper:K,headersMapper:qy}},queryParameters:[J,Gb,kS,AS],urlParameters:[q],headerParameters:[Y,X,Z,yb,tx],isXML:!0,serializer:ZC};var iw=class extends Ep{url;version;constructor(e,t){if(e===void 0)throw Error(`'url' cannot be null`);t||={};let n={requestContentType:`application/json; charset=utf-8`},r=`azsdk-js-azure-storage-blob/12.30.0`,i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,a={...n,...t,userAgentOptions:{userAgentPrefix:i},endpoint:t.endpoint??t.baseUri??`{url}`};super(a),this.url=e,this.version=t.version||`2026-02-06`,this.service=new jS(this),this.container=new VS(this),this.blob=new sC(this),this.pageBlob=new NC(this),this.appendBlob=new WC(this),this.blockBlob=new XC(this)}service;container;blob;pageBlob;appendBlob;blockBlob},aw=class extends iw{async sendOperationRequest(e,t){let n={...t};return(n.path===`/{containerName}`||n.path===`/{containerName}/{blob}`)&&(n.path=``),super.sendOperationRequest(e,n)}};function ow(e){let t=new URL(e),n=t.pathname;return n||=`/`,n=uw(n),t.pathname=n,t.toString()}function sw(e){let t=``;if(e.search(`DevelopmentStorageProxyUri=`)!==-1){let n=e.split(`;`);for(let e of n)e.trim().startsWith(`DevelopmentStorageProxyUri=`)&&(t=e.trim().match(`DevelopmentStorageProxyUri=(.*)`)[1])}return t}function cw(e,t){let n=e.split(`;`);for(let e of n)if(e.trim().startsWith(t))return e.trim().match(t+`=(.*)`)[1];return``}function lw(e){let t=``;e.startsWith(`UseDevelopmentStorage=true`)&&(t=sw(e),e=`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`);let n=cw(e,`BlobEndpoint`);if(n=n.endsWith(`/`)?n.slice(0,-1):n,e.search(`DefaultEndpointsProtocol=`)!==-1&&e.search(`AccountKey=`)!==-1){let r=``,i=``,a=Buffer.from(`accountKey`,`base64`),o=``;if(i=cw(e,`AccountName`),a=Buffer.from(cw(e,`AccountKey`),`base64`),!n){r=cw(e,`DefaultEndpointsProtocol`);let t=r.toLowerCase();if(t!==`https`&&t!==`http`)throw Error(`Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'`);if(o=cw(e,`EndpointSuffix`),!o)throw Error(`Invalid EndpointSuffix in the provided Connection String`);n=`${r}://${i}.blob.${o}`}if(!i)throw Error(`Invalid AccountName in the provided Connection String`);if(a.length===0)throw Error(`Invalid AccountKey in the provided Connection String`);return{kind:`AccountConnString`,url:n,accountName:i,accountKey:a,proxyUri:t}}else{let t=cw(e,`SharedAccessSignature`),r=cw(e,`AccountName`);if(r||=xw(n),!n)throw Error(`Invalid BlobEndpoint in the provided SAS Connection String`);if(!t)throw Error(`Invalid SharedAccessSignature in the provided SAS Connection String`);return t.startsWith(`?`)&&(t=t.substring(1)),{kind:`SASConnString`,url:n,accountName:r,accountSas:t}}}function uw(e){return encodeURIComponent(e).replace(/%2F/g,`/`).replace(/'/g,`%27`).replace(/\+/g,`%20`).replace(/%25/g,`%`)}function dw(e,t){let n=new URL(e),r=n.pathname;return r=r?r.endsWith(`/`)?`${r}${t}`:`${r}/${t}`:t,n.pathname=r,n.toString()}function fw(e,t,n){let r=new URL(e),i=encodeURIComponent(t),a=n?encodeURIComponent(n):void 0,o=r.search===``?`?`:r.search,s=[];for(let e of o.slice(1).split(`&`))if(e){let[t]=e.split(`=`,2);t!==i&&s.push(e)}return a&&s.push(`${i}=${a}`),r.search=s.length?`?${s.join(`&`)}`:``,r.toString()}function pw(e,t){return new URL(e).searchParams.get(t)??void 0}function mw(e){try{let t=new URL(e);return t.protocol.endsWith(`:`)?t.protocol.slice(0,-1):t.protocol}catch{return}}function hw(e,t){let n=new URL(e),r=n.search;return r?r+=`&`+t:r=t,n.search=r,n.toString()}function gw(e,t=!0){let n=e.toISOString();return t?n.substring(0,n.length-1)+`0000Z`:n.substring(0,n.length-5)+`Z`}function _w(e){return Wu?Buffer.from(e).toString(`base64`):btoa(e)}function vw(e,t){return e.length>42&&(e=e.slice(0,42)),_w(e+yw(t.toString(),48-e.length,`0`))}function yw(e,t,n=` `){return String.prototype.padStart?e.padStart(t,n):(n||=` `,e.length>t?e:(t-=e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e))}function bw(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()}function xw(e){let t=new URL(e),n;try{return n=t.hostname.split(`.`)[1]===`blob`?t.hostname.split(`.`)[0]:Sw(t)?t.pathname.split(`/`)[1]:``,n}catch{throw Error(`Unable to extract accountName with provided information.`)}}function Sw(e){let t=e.host;return/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(t)||!!e.port&&gg.includes(e.port)}function Cw(e){if(e===void 0)return;let t=[];for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];t.push(`${encodeURIComponent(n)}=${encodeURIComponent(r)}`)}return t.join(`&`)}function ww(e){if(e===void 0)return;let t={blobTagSet:[]};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];t.blobTagSet.push({key:n,value:r})}return t}function Tw(e){if(e===void 0)return;let t={};for(let n of e.blobTagSet)t[n.key]=n.value;return t}function Ew(e){if(e!==void 0)switch(e.kind){case`csv`:return{format:{type:`delimited`,delimitedTextConfiguration:{columnSeparator:e.columnSeparator||`,`,fieldQuote:e.fieldQuote||``,recordSeparator:e.recordSeparator,escapeChar:e.escapeCharacter||``,headersPresent:e.hasHeaders||!1}}};case`json`:return{format:{type:`json`,jsonTextConfiguration:{recordSeparator:e.recordSeparator}}};case`arrow`:return{format:{type:`arrow`,arrowConfiguration:{schema:e.schema}}};case`parquet`:return{format:{type:`parquet`}};default:throw Error(`Invalid BlobQueryTextConfiguration.`)}}function Dw(e){if(!e||`policy-id`in e)return;let t=[];for(let n in e){let r=n.split(`_`);r[0].startsWith(`or-`)&&(r[0]=r[0].substring(3));let i={ruleId:r[1],replicationStatus:e[n]},a=t.findIndex(e=>e.policyId===r[0]);a>-1?t[a].rules.push(i):t.push({policyId:r[0],rules:[i]})}return t}function Ow(e){return e?e.scheme+` `+e.value:void 0}function*kw(e){let t=[],n=[];e.pageRange&&(t=e.pageRange),e.clearRange&&(n=e.clearRange);let r=0,i=0;for(;r0&&n.length>0&&e.push(`${t}=${n}`))}};function Lw(e,t,n){return Rw(e,t,n).sasQueryParameters}function Rw(e,t,n){let r=e.version?e.version:ug,i=t instanceof qh?t:void 0,a;if(i===void 0&&n!==void 0&&(a=new cg(n,t)),i===void 0&&a===void 0)throw TypeError(`Invalid sharedKeyCredential, userDelegationKey or accountName.`);if(r>=`2020-12-06`)return i===void 0?r>=`2025-07-05`?Gw(e,a):Ww(e,a):Vw(e,i);if(r>=`2018-11-09`)return i===void 0?r>=`2020-02-10`?Uw(e,a):Hw(e,a):Bw(e,i);if(r>=`2015-04-05`){if(i!==void 0)return zw(e,i);throw RangeError(`'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.`)}throw RangeError(`'version' must be >= '2015-04-05'.`)}function zw(e,t){if(e=qw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`;e.blobName&&(n=`b`);let r;e.permissions&&(r=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let i=[r||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` +`),a=t.computeHMACSHA256(i);return{sasQueryParameters:new Iw(e.version,a,r,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType),stringToSign:i}}function Bw(e,t){if(e=qw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType),stringToSign:a}}function Vw(e,t){if(e=qw(e),!e.identifier&&!(e.permissions&&e.expiresOn))throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl?e.cacheControl:``,e.contentDisposition?e.contentDisposition:``,e.contentEncoding?e.contentEncoding:``,e.contentLanguage?e.contentLanguage:``,e.contentType?e.contentType:``].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,void 0,void 0,void 0,e.encryptionScope),stringToSign:a}}function Hw(e,t){if(e=qw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?gw(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?gw(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey),stringToSign:a}}function Uw(e,t){if(e=qw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?gw(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?gw(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId),stringToSign:a}}function Ww(e,t){if(e=qw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?gw(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?gw(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope),stringToSign:a}}function Gw(e,t){if(e=qw(e),!e.permissions||!e.expiresOn)throw RangeError(`Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.`);let n=`c`,r=e.snapshotTime;e.blobName&&(n=`b`,e.snapshotTime?n=`bs`:e.versionId&&(n=`bv`,r=e.versionId));let i;e.permissions&&(i=e.blobName?Mw.parse(e.permissions.toString()).toString():Nw.parse(e.permissions.toString()).toString());let a=[i||``,e.startsOn?gw(e.startsOn,!1):``,e.expiresOn?gw(e.expiresOn,!1):``,Kw(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?gw(t.userDelegationKey.signedStartsOn,!1):``,t.userDelegationKey.signedExpiresOn?gw(t.userDelegationKey.signedExpiresOn,!1):``,t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,void 0,e.delegatedUserObjectId,e.ipRange?Pw(e.ipRange):``,e.protocol?e.protocol:``,e.version,n,r,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join(` +`),o=t.computeHMACSHA256(a);return{sasQueryParameters:new Iw(e.version,o,i,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope,e.delegatedUserObjectId),stringToSign:a}}function Kw(e,t,n){let r=[`/blob/${e}/${t}`];return n&&r.push(`/${n}`),r.join(``)}function qw(e){let t=e.version?e.version:ug;if(e.snapshotTime&&t<`2018-11-09`)throw RangeError(`'version' must be >= '2018-11-09' when providing 'snapshotTime'.`);if(e.blobName===void 0&&e.snapshotTime)throw RangeError(`Must provide 'blobName' when providing 'snapshotTime'.`);if(e.versionId&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'versionId'.`);if(e.blobName===void 0&&e.versionId)throw RangeError(`Must provide 'blobName' when providing 'versionId'.`);if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<`2020-08-04`)throw RangeError(`'version' must be >= '2020-08-04' when provided 'i' permission.`);if(e.permissions&&e.permissions.deleteVersion&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'x' permission.`);if(e.permissions&&e.permissions.permanentDelete&&t<`2019-10-10`)throw RangeError(`'version' must be >= '2019-10-10' when providing 'y' permission.`);if(e.permissions&&e.permissions.tag&&t<`2019-12-12`)throw RangeError(`'version' must be >= '2019-12-12' when providing 't' permission.`);if(t<`2020-02-10`&&e.permissions&&(e.permissions.move||e.permissions.execute))throw RangeError(`'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.`);if(t<`2021-04-10`&&e.permissions&&e.permissions.filterByTags)throw RangeError(`'version' must be >= '2021-04-10' when providing the 'f' permission.`);if(t<`2020-02-10`&&(e.preauthorizedAgentObjectId||e.correlationId))throw RangeError(`'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.`);if(e.encryptionScope&&t<`2020-12-06`)throw RangeError(`'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.`);return e.version=t,e}var Jw=class{_leaseId;_url;_containerOrBlobOperation;_isContainer;get leaseId(){return this._leaseId}get url(){return this._url}constructor(e,t){let n=e.storageClientContext;this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=n.container):(this._isContainer=!1,this._containerOrBlobOperation=n.blob),t||=Uu(),this._leaseId=t}async acquireLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-acquireLease`,t,async n=>Aw(await this._containerOrBlobOperation.acquireLease({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},proposedLeaseId:this._leaseId,tracingOptions:n.tracingOptions})))}async changeLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-changeLease`,t,async n=>{let r=Aw(await this._containerOrBlobOperation.changeLease(this._leaseId,e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return this._leaseId=e,r})}async releaseLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==``||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==``||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-releaseLease`,e,async t=>Aw(await this._containerOrBlobOperation.releaseLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async renewLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==``||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==``||e.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-renewLease`,e,async t=>this._containerOrBlobOperation.renewLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions}))}async breakLease(e,t={}){if(this._isContainer&&(t.conditions?.ifMatch&&t.conditions?.ifMatch!==``||t.conditions?.ifNoneMatch&&t.conditions?.ifNoneMatch!==``||t.conditions?.tagConditions))throw RangeError(`The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.`);return Q.withSpan(`BlobLeaseClient-breakLease`,t,async n=>{let r={abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions};return Aw(await this._containerOrBlobOperation.breakLease(r))})}},Yw=class extends w{start;offset;end;getter;source;retries=0;maxRetryRequests;onProgress;options;constructor(e,t,n,r,i={}){super({highWaterMark:i.highWaterMark}),this.getter=t,this.source=e,this.start=n,this.offset=n,this.end=n+r-1,this.maxRetryRequests=i.maxRetryRequests&&i.maxRetryRequests>=0?i.maxRetryRequests:0,this.onProgress=i.onProgress,this.options=i,this.setSourceEventHandlers()}_read(){this.source.resume()}setSourceEventHandlers(){this.source.on(`data`,this.sourceDataHandler),this.source.on(`end`,this.sourceErrorOrEndHandler),this.source.on(`error`,this.sourceErrorOrEndHandler),this.source.on(`aborted`,this.sourceAbortedHandler)}removeSourceEventHandlers(){this.source.removeListener(`data`,this.sourceDataHandler),this.source.removeListener(`end`,this.sourceErrorOrEndHandler),this.source.removeListener(`error`,this.sourceErrorOrEndHandler),this.source.removeListener(`aborted`,this.sourceAbortedHandler)}sourceDataHandler=e=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=void 0,this.source.pause(),this.sourceErrorOrEndHandler(),this.source.destroy();return}this.offset+=e.length,this.onProgress&&this.onProgress({loadedBytes:this.offset-this.start}),this.push(e)||this.source.pause()};sourceAbortedHandler=()=>{let e=new Ru(`The operation was aborted.`);this.destroy(e)};sourceErrorOrEndHandler=e=>{if(e&&e.name===`AbortError`){this.destroy(e);return}this.removeSourceEventHandlers(),this.offset-1===this.end?this.push(null):this.offset<=this.end?this.retries{this.source=e,this.setSourceEventHandlers()}).catch(e=>{this.destroy(e)})):this.destroy(Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)):this.destroy(Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`))};_destroy(e,t){this.removeSourceEventHandlers(),this.source.destroy(),t(e===null?void 0:e)}},Xw=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return this.originalResponse.copyCompletedOn}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get tagCount(){return this.originalResponse.tagCount}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get lastAccessed(){return this.originalResponse.lastAccessed}get createdOn(){return this.originalResponse.createdOn}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get versionId(){return this.originalResponse.versionId}get isCurrentVersion(){return this.originalResponse.isCurrentVersion}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId}get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties}get isSealed(){return this.originalResponse.isSealed}get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn}get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode}get legalHold(){return this.originalResponse.legalHold}get contentAsBlob(){return this.originalResponse.blobBody}get readableStreamBody(){return Wu?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t,n,r,i={}){this.originalResponse=e,this.blobDownloadStream=new Yw(this.originalResponse.readableStreamBody,t,n,r,i)}};const Zw=new Uint8Array([79,98,106,1]);var Qw=class e{static async readFixedBytes(e,t,n={}){let r=await e.read(t,{abortSignal:n.abortSignal});if(r.length!==t)throw Error(`Hit stream end.`);return r}static async readByte(t,n={}){return(await e.readFixedBytes(t,1,n))[0]}static async readZigZagLong(t,n={}){let r=0,i=0,a,o,s;do a=await e.readByte(t,n),o=a&128,r|=(a&127)<2**53-1)throw Error(`Integer overflow.`);return i}return r>>1^-(r&1)}static async readLong(t,n={}){return e.readZigZagLong(t,n)}static async readInt(t,n={}){return e.readZigZagLong(t,n)}static async readNull(){return null}static async readBoolean(t,n={}){let r=await e.readByte(t,n);if(r===1)return!0;if(r===0)return!1;throw Error(`Byte was not a boolean.`)}static async readFloat(t,n={}){let r=await e.readFixedBytes(t,4,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,!0)}static async readDouble(t,n={}){let r=await e.readFixedBytes(t,8,n);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,!0)}static async readBytes(t,n={}){let r=await e.readLong(t,n);if(r<0)throw Error(`Bytes size was negative.`);return t.read(r,{abortSignal:n.abortSignal})}static async readString(t,n={}){let r=await e.readBytes(t,n);return new TextDecoder().decode(r)}static async readMapPair(t,n,r={}){return{key:await e.readString(t,r),value:await n(t,r)}}static async readMap(t,n,r={}){let i=await e.readArray(t,(t,r={})=>e.readMapPair(t,n,r),r),a={};for(let e of i)a[e.key]=e.value;return a}static async readArray(t,n,r={}){let i=[];for(let a=await e.readLong(t,r);a!==0;a=await e.readLong(t,r))for(a<0&&(await e.readLong(t,r),a=-a);a--;){let e=await n(t,r);i.push(e)}return i}},$w;(function(e){e.RECORD=`record`,e.ENUM=`enum`,e.ARRAY=`array`,e.MAP=`map`,e.UNION=`union`,e.FIXED=`fixed`})($w||={});var eT;(function(e){e.NULL=`null`,e.BOOLEAN=`boolean`,e.INT=`int`,e.LONG=`long`,e.FLOAT=`float`,e.DOUBLE=`double`,e.BYTES=`bytes`,e.STRING=`string`})(eT||={});var tT=class e{static fromSchema(t){return typeof t==`string`?e.fromStringSchema(t):Array.isArray(t)?e.fromArraySchema(t):e.fromObjectSchema(t)}static fromStringSchema(e){switch(e){case eT.NULL:case eT.BOOLEAN:case eT.INT:case eT.LONG:case eT.FLOAT:case eT.DOUBLE:case eT.BYTES:case eT.STRING:return new nT(e);default:throw Error(`Unexpected Avro type ${e}`)}}static fromArraySchema(t){return new iT(t.map(e.fromSchema))}static fromObjectSchema(t){let n=t.type;try{return e.fromStringSchema(n)}catch{}switch(n){case $w.RECORD:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.name)throw Error(`Required attribute 'name' doesn't exist on schema: ${t}`);let r={};if(!t.fields)throw Error(`Required attribute 'fields' doesn't exist on schema: ${t}`);for(let n of t.fields)r[n.name]=e.fromSchema(n.type);return new oT(r,t.name);case $w.ENUM:if(t.aliases)throw Error(`aliases currently is not supported, schema: ${t}`);if(!t.symbols)throw Error(`Required attribute 'symbols' doesn't exist on schema: ${t}`);return new rT(t.symbols);case $w.MAP:if(!t.values)throw Error(`Required attribute 'values' doesn't exist on schema: ${t}`);return new aT(e.fromSchema(t.values));case $w.ARRAY:case $w.FIXED:default:throw Error(`Unexpected Avro type ${n} in ${t}`)}}},nT=class extends tT{_primitive;constructor(e){super(),this._primitive=e}read(e,t={}){switch(this._primitive){case eT.NULL:return Qw.readNull();case eT.BOOLEAN:return Qw.readBoolean(e,t);case eT.INT:return Qw.readInt(e,t);case eT.LONG:return Qw.readLong(e,t);case eT.FLOAT:return Qw.readFloat(e,t);case eT.DOUBLE:return Qw.readDouble(e,t);case eT.BYTES:return Qw.readBytes(e,t);case eT.STRING:return Qw.readString(e,t);default:throw Error(`Unknown Avro Primitive`)}}},rT=class extends tT{_symbols;constructor(e){super(),this._symbols=e}async read(e,t={}){let n=await Qw.readInt(e,t);return this._symbols[n]}},iT=class extends tT{_types;constructor(e){super(),this._types=e}async read(e,t={}){let n=await Qw.readInt(e,t);return this._types[n].read(e,t)}},aT=class extends tT{_itemType;constructor(e){super(),this._itemType=e}read(e,t={}){return Qw.readMap(e,(e,t)=>this._itemType.read(e,t),t)}},oT=class extends tT{_name;_fields;constructor(e,t){super(),this._fields=e,this._name=t}async read(e,t={}){let n={};n.$schema=this._name;for(let r in this._fields)Object.prototype.hasOwnProperty.call(this._fields,r)&&(n[r]=await this._fields[r].read(e,t));return n}};function sT(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n0)for(let t=0;t0}async*parseObjects(e={}){for(this._initialized||await this.initialize(e);this.hasNext();){let t=await this._itemType.read(this._dataStream,{abortSignal:e.abortSignal});if(this._itemsRemainingInBlock--,this._objectIndex++,this._itemsRemainingInBlock===0){let t=await Qw.readFixedBytes(this._dataStream,16,{abortSignal:e.abortSignal});if(this._blockOffset=this._initialBlockOffset+this._dataStream.position,this._objectIndex=0,!sT(this._syncMarker,t))throw Error(`Stream is not a valid Avro file.`);try{this._itemsRemainingInBlock=await Qw.readLong(this._dataStream,{abortSignal:e.abortSignal})}catch{this._itemsRemainingInBlock=0}this._itemsRemainingInBlock>0&&await Qw.readLong(this._dataStream,{abortSignal:e.abortSignal})}yield t}}},lT=class{};const uT=new Ru(`Reading from the avro stream was aborted.`);var dT=class extends lT{_position;_readable;toUint8Array(e){return typeof e==`string`?ne.from(e):e}constructor(e){super(),this._readable=e,this._position=0}get position(){return this._position}async read(e,t={}){if(t.abortSignal?.aborted)throw uT;if(e<0)throw Error(`size parameter should be positive: ${e}`);if(e===0)return new Uint8Array;if(!this._readable.readable)throw Error(`Stream no longer readable.`);let n=this._readable.read(e);return n?(this._position+=n.length,this.toUint8Array(n)):new Promise((n,r)=>{let i=()=>{this._readable.removeListener(`readable`,a),this._readable.removeListener(`error`,o),this._readable.removeListener(`end`,o),this._readable.removeListener(`close`,o),t.abortSignal&&t.abortSignal.removeEventListener(`abort`,s)},a=()=>{let t=this._readable.read(e);t&&(this._position+=t.length,i(),n(this.toUint8Array(t)))},o=()=>{i(),r()},s=()=>{i(),r(uT)};this._readable.on(`readable`,a),this._readable.once(`error`,o),this._readable.once(`end`,o),this._readable.once(`close`,o),t.abortSignal&&t.abortSignal.addEventListener(`abort`,s)})}},fT=class extends w{source;avroReader;avroIter;avroPaused=!0;onProgress;onError;constructor(e,t={}){super(),this.source=e,this.onProgress=t.onProgress,this.onError=t.onError,this.avroReader=new cT(new dT(this.source)),this.avroIter=this.avroReader.parseObjects({abortSignal:t.abortSignal})}_read(){this.avroPaused&&this.readInternal().catch(e=>{this.emit(`error`,e)})}async readInternal(){this.avroPaused=!1;let e;do{if(e=await this.avroIter.next(),e.done)break;let t=e.value,n=t.$schema;if(typeof n!=`string`)throw Error(`Missing schema in avro record.`);switch(n){case`com.microsoft.azure.storage.queryBlobContents.resultData`:{let e=t.data;if(!(e instanceof Uint8Array))throw Error(`Invalid data in avro result record.`);this.push(Buffer.from(e))||(this.avroPaused=!0)}break;case`com.microsoft.azure.storage.queryBlobContents.progress`:{let e=t.bytesScanned;if(typeof e!=`number`)throw Error(`Invalid bytesScanned in avro progress record.`);this.onProgress&&this.onProgress({loadedBytes:e})}break;case`com.microsoft.azure.storage.queryBlobContents.end`:if(this.onProgress){let e=t.totalBytes;if(typeof e!=`number`)throw Error(`Invalid totalBytes in avro end record.`);this.onProgress({loadedBytes:e})}this.push(null);break;case`com.microsoft.azure.storage.queryBlobContents.error`:if(this.onError){let e=t.fatal;if(typeof e!=`boolean`)throw Error(`Invalid fatal in avro error record.`);let n=t.name;if(typeof n!=`string`)throw Error(`Invalid name in avro error record.`);let r=t.description;if(typeof r!=`string`)throw Error(`Invalid description in avro error record.`);let i=t.position;if(typeof i!=`number`)throw Error(`Invalid position in avro error record.`);this.onError({position:i,name:n,isFatal:e,description:r})}break;default:throw Error(`Unknown schema ${n} in avro progress record.`)}}while(!e.done&&!this.avroPaused)}},pT=class{get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get blobBody(){}get readableStreamBody(){return Wu?this.blobDownloadStream:void 0}get _response(){return this.originalResponse._response}originalResponse;blobDownloadStream;constructor(e,t={}){this.originalResponse=e,this.blobDownloadStream=new fT(this.originalResponse.readableStreamBody,t)}},mT;(function(e){e.Hot=`Hot`,e.Cool=`Cool`,e.Cold=`Cold`,e.Archive=`Archive`})(mT||={});var hT;(function(e){e.P4=`P4`,e.P6=`P6`,e.P10=`P10`,e.P15=`P15`,e.P20=`P20`,e.P30=`P30`,e.P40=`P40`,e.P50=`P50`,e.P60=`P60`,e.P70=`P70`,e.P80=`P80`})(hT||={});function gT(e){if(e!==void 0)return e}function _T(e,t){if(e&&!t)throw RangeError(`Customer-provided encryption key must be used over HTTPS.`);e&&!e.encryptionAlgorithm&&(e.encryptionAlgorithm=`AES256`)}var vT;(function(e){e.StorageOAuthScopes=`https://storage.azure.com/.default`,e.DiskComputeOAuthScopes=`https://disk.compute.azure.com/.default`})(vT||={});function yT(e){let t=(e._response.parsedBody.pageRange||[]).map(e=>({offset:e.start,count:e.end-e.start})),n=(e._response.parsedBody.clearRange||[]).map(e=>({offset:e.start,count:e.end-e.start}));return{...e,pageRange:t,clearRange:n,_response:{...e._response,parsedBody:{pageRange:t,clearRange:n}}}}var bT=class e extends Error{constructor(t){super(t),this.name=`PollerStoppedError`,Object.setPrototypeOf(this,e.prototype)}},xT=class e extends Error{constructor(t){super(t),this.name=`PollerCancelledError`,Object.setPrototypeOf(this,e.prototype)}},ST=class{constructor(e){this.resolveOnUnsuccessful=!1,this.stopped=!0,this.pollProgressCallbacks=[],this.operation=e,this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),this.promise.catch(()=>{})}async startPolling(e={}){for(this.stopped&&=!1;!this.isStopped()&&!this.isDone();)await this.poll(e),await this.delay()}async pollOnce(e={}){this.isDone()||(this.operation=await this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})),this.processUpdatedState()}fireProgress(e){for(let t of this.pollProgressCallbacks)t(e)}async cancelOnce(e={}){this.operation=await this.operation.cancel(e)}poll(e={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);let t=()=>{this.pollOncePromise=void 0};this.pollOncePromise.then(t,t).catch(this.reject)}return this.pollOncePromise}processUpdatedState(){if(this.operation.state.error&&(this.stopped=!0,!this.resolveOnUnsuccessful))throw this.reject(this.operation.state.error),this.operation.state.error;if(this.operation.state.isCancelled&&(this.stopped=!0,!this.resolveOnUnsuccessful)){let e=new xT(`Operation was canceled`);throw this.reject(e),e}this.isDone()&&this.resolve&&this.resolve(this.getResult())}async pollUntilDone(e={}){return this.stopped&&this.startPolling(e).catch(this.reject),this.processUpdatedState(),this.promise}onProgress(e){return this.pollProgressCallbacks.push(e),()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter(t=>t!==e)}}isDone(){let e=this.operation.state;return!!(e.isCompleted||e.isCancelled||e.error)}stopPolling(){this.stopped||(this.stopped=!0,this.reject&&this.reject(new bT(`This poller is already stopped`)))}isStopped(){return this.stopped}cancelOperation(e={}){if(!this.cancelPromise)this.cancelPromise=this.cancelOnce(e);else if(e.abortSignal)throw Error(`A cancel request is currently pending`);return this.cancelPromise}getOperationState(){return this.operation.state}getResult(){return this.operation.state.result}toString(){return this.operation.toString()}},CT=class extends ST{intervalInMs;constructor(e){let{blobClient:t,copySource:n,intervalInMs:r=15e3,onProgress:i,resumeFrom:a,startCopyFromURLOptions:o}=e,s;a&&(s=JSON.parse(a).state);let c=DT({...s,blobClient:t,copySource:n,startCopyFromURLOptions:o});super(c),typeof i==`function`&&this.onProgress(i),this.intervalInMs=r}delay(){return Bu(this.intervalInMs)}};const wT=async function(e={}){let t=this.state,{copyId:n}=t;return t.isCompleted?DT(t):n?(await t.blobClient.abortCopyFromURL(n,{abortSignal:e.abortSignal}),t.isCancelled=!0,DT(t)):(t.isCancelled=!0,DT(t))},TT=async function(e={}){let t=this.state,{blobClient:n,copySource:r,startCopyFromURLOptions:i}=t;if(!t.isStarted){t.isStarted=!0;let e=await n.startCopyFromURL(r,i);t.copyId=e.copyId,e.copyStatus===`success`&&(t.result=e,t.isCompleted=!0)}else if(!t.isCompleted)try{let n=await t.blobClient.getProperties({abortSignal:e.abortSignal}),{copyStatus:r,copyProgress:i}=n,a=t.copyProgress;i&&(t.copyProgress=i),r===`pending`&&i!==a&&typeof e.fireProgress==`function`?e.fireProgress(t):r===`success`?(t.result=n,t.isCompleted=!0):r===`failed`&&(t.error=Error(`Blob copy failed with reason: "${n.copyStatusDescription||`unknown`}"`),t.isCompleted=!0)}catch(e){t.error=e,t.isCompleted=!0}return DT(t)},ET=function(){return JSON.stringify({state:this.state},(e,t)=>{if(e!==`blobClient`)return t})};function DT(e){return{state:{...e},cancel:wT,toString:ET,update:TT}}function OT(e){if(e.offset<0)throw RangeError(`Range.offset cannot be smaller than 0.`);if(e.count&&e.count<=0)throw RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);return e.count?`bytes=${e.offset}-${e.offset+e.count-1}`:`bytes=${e.offset}-`}var kT;(function(e){e[e.Good=0]=`Good`,e[e.Error=1]=`Error`})(kT||={});var AT=class{concurrency;actives=0;completed=0;offset=0;operations=[];state=kT.Good;emitter;constructor(e=5){if(e<1)throw RangeError(`concurrency must be larger than 0`);this.concurrency=e,this.emitter=new y}addOperation(e){this.operations.push(async()=>{try{this.actives++,await e(),this.actives--,this.completed++,this.parallelExecute()}catch(e){this.emitter.emit(`error`,e)}})}async do(){return this.operations.length===0?Promise.resolve():(this.parallelExecute(),new Promise((e,t)=>{this.emitter.on(`finish`,e),this.emitter.on(`error`,e=>{this.state=kT.Error,t(e)})}))}nextOperation(){return this.offset=this.operations.length){this.emitter.emit(`finish`);return}for(;this.actives{let c=setTimeout(()=>s(Error(`The operation cannot be completed in timeout.`)),1e5);e.on(`readable`,()=>{if(a>=o){clearTimeout(c),r();return}let s=e.read();if(!s)return;typeof s==`string`&&(s=Buffer.from(s,i));let l=a+s.length>o?o-a:s.length;t.fill(s.slice(0,l),n+a,n+a+l),a+=l}),e.on(`end`,()=>{clearTimeout(c),a{clearTimeout(c),s(e)})})}async function MT(e,t){return new Promise((n,r)=>{let i=H.createWriteStream(t);e.on(`error`,e=>{r(e)}),i.on(`error`,e=>{r(e)}),i.on(`close`,n),e.pipe(i)})}const NT=D.promisify(H.stat),PT=H.createReadStream;var FT=class e extends jw{blobContext;_name;_containerName;_versionId;_snapshot;get name(){return this._name}get containerName(){return this._containerName}constructor(e,t,n,r){r||={};let i,a;if(_g(t))a=e,i=t;else if(Wu&&t instanceof qh||t instanceof Bh||Fd(t))a=e,r=n,i=yg(t,r);else if(!t&&typeof t!=`string`)a=e,n&&typeof n!=`string`&&(r=n),i=yg(new Bh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=lw(e);if(c.kind===`AccountConnString`)if(Wu){let e=new qh(c.accountName,c.accountKey);a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=$u(c.proxyUri),i=yg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=yg(new Bh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),{blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl(),this.blobContext=this.storageClientContext.blob,this._snapshot=pw(this.url,pg.Parameters.SNAPSHOT),this._versionId=pw(this.url,pg.Parameters.VERSIONID)}withSnapshot(t){return new e(fw(this.url,pg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}withVersion(t){return new e(fw(this.url,pg.Parameters.VERSIONID,t.length===0?void 0:t),this.pipeline)}getAppendBlobClient(){return new IT(this.url,this.pipeline)}getBlockBlobClient(){return new LT(this.url,this.pipeline)}getPageBlobClient(){return new RT(this.url,this.pipeline)}async download(e=0,t,n={}){return n.conditions=n.conditions||{},n.conditions=n.conditions||{},_T(n.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-download`,n,async r=>{let i=Aw(await this.blobContext.download({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onDownloadProgress:Wu?void 0:n.onProgress},range:e===0&&!t?void 0:OT({offset:e,count:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey,tracingOptions:r.tracingOptions})),a={...i,_response:i._response,objectReplicationDestinationPolicyId:i.objectReplicationPolicyId,objectReplicationSourceProperties:Dw(i.objectReplicationRules)};if(!Wu)return a;if((n.maxRetryRequests===void 0||n.maxRetryRequests<0)&&(n.maxRetryRequests=5),i.contentLength===void 0)throw RangeError(`File download response doesn't contain valid content length header`);if(!i.etag)throw RangeError(`File download response doesn't contain valid etag header`);return new Xw(a,async t=>{let r={leaseAccessConditions:n.conditions,modifiedAccessConditions:{ifMatch:n.conditions.ifMatch||i.etag,ifModifiedSince:n.conditions.ifModifiedSince,ifNoneMatch:n.conditions.ifNoneMatch,ifUnmodifiedSince:n.conditions.ifUnmodifiedSince,ifTags:n.conditions?.tagConditions},range:OT({count:e+i.contentLength-t,offset:t}),rangeGetContentMD5:n.rangeGetContentMD5,rangeGetContentCRC64:n.rangeGetContentCrc64,snapshot:n.snapshot,cpkInfo:n.customerProvidedKey};return(await this.blobContext.download({abortSignal:n.abortSignal,...r})).readableStreamBody},e,i.contentLength,{maxRetryRequests:n.maxRetryRequests,onProgress:n.onProgress})})}async exists(e={}){return Q.withSpan(`BlobClient-exists`,e,async t=>{try{return _T(e.customerProvidedKey,this.isHttps),await this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:t.tracingOptions}),!0}catch(e){if(e.statusCode===404)return!1;if(e.statusCode===409&&(e.details.errorCode===`BlobUsesCustomerSpecifiedEncryption`||e.details.errorCode===`BlobDoesNotUseCustomerSpecifiedEncryption`))return!0;throw e}})}async getProperties(e={}){return e.conditions=e.conditions||{},_T(e.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-getProperties`,e,async t=>{let n=Aw(await this.blobContext.getProperties({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,objectReplicationDestinationPolicyId:n.objectReplicationPolicyId,objectReplicationSourceProperties:Dw(n.objectReplicationRules)}})}async delete(e={}){return e.conditions=e.conditions||{},Q.withSpan(`BlobClient-delete`,e,async t=>Aw(await this.blobContext.delete({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async deleteIfExists(e={}){return Q.withSpan(`BlobClient-deleteIfExists`,e,async e=>{try{let t=Aw(await this.delete(e));return{succeeded:!0,...t,_response:t._response}}catch(e){if(e.details?.errorCode===`BlobNotFound`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async undelete(e={}){return Q.withSpan(`BlobClient-undelete`,e,async t=>Aw(await this.blobContext.undelete({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}async setHTTPHeaders(e,t={}){return t.conditions=t.conditions||{},_T(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-setHTTPHeaders`,t,async n=>Aw(await this.blobContext.setHttpHeaders({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}async setMetadata(e,t={}){return t.conditions=t.conditions||{},_T(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-setMetadata`,t,async n=>Aw(await this.blobContext.setMetadata({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async setTags(e,t={}){return Q.withSpan(`BlobClient-setTags`,t,async n=>Aw(await this.blobContext.setTags({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},blobModifiedAccessConditions:t.conditions,tracingOptions:n.tracingOptions,tags:ww(e)})))}async getTags(e={}){return Q.withSpan(`BlobClient-getTags`,e,async t=>{let n=Aw(await this.blobContext.getTags({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},blobModifiedAccessConditions:e.conditions,tracingOptions:t.tracingOptions}));return{...n,_response:n._response,tags:Tw({blobTagSet:n.blobTagSet})||{}}})}getBlobLeaseClient(e){return new Jw(this,e)}async createSnapshot(e={}){return e.conditions=e.conditions||{},_T(e.customerProvidedKey,this.isHttps),Q.withSpan(`BlobClient-createSnapshot`,e,async t=>Aw(await this.blobContext.createSnapshot({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,tracingOptions:t.tracingOptions})))}async beginCopyFromURL(e,t={}){let n=new CT({blobClient:{abortCopyFromURL:(...e)=>this.abortCopyFromURL(...e),getProperties:(...e)=>this.getProperties(...e),startCopyFromURL:(...e)=>this.startCopyFromURL(...e)},copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return await n.poll(),n}async abortCopyFromURL(e,t={}){return Q.withSpan(`BlobClient-abortCopyFromURL`,t,async n=>Aw(await this.blobContext.abortCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,tracingOptions:n.tracingOptions})))}async syncCopyFromURL(e,t={}){return t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},Q.withSpan(`BlobClient-syncCopyFromURL`,t,async n=>Aw(await this.blobContext.copyFromURL(e,{abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:Ow(t.sourceAuthorization),tier:gT(t.tier),blobTagsString:Cw(t.tags),immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,encryptionScope:t.encryptionScope,copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async setAccessTier(e,t={}){return Q.withSpan(`BlobClient-setAccessTier`,t,async n=>Aw(await this.blobContext.setTier(gT(e),{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},rehydratePriority:t.rehydratePriority,tracingOptions:n.tracingOptions})))}async downloadToBuffer(e,t,n,r={}){let i,a=0,o=0,s=r;e instanceof Buffer?(i=e,a=t||0,o=typeof n==`number`?n:0):(a=typeof e==`number`?e:0,o=typeof t==`number`?t:0,s=n||{});let c=s.blockSize??0;if(c<0)throw RangeError(`blockSize option must be >= 0`);if(c===0&&(c=fg),a<0)throw RangeError(`offset option must be >= 0`);if(o&&o<=0)throw RangeError(`count option must be greater than 0`);return s.conditions||={},Q.withSpan(`BlobClient-downloadToBuffer`,s,async e=>{if(!o){let t=await this.getProperties({...s,tracingOptions:e.tracingOptions});if(o=t.contentLength-a,o<0)throw RangeError(`offset ${a} shouldn't be larger than blob size ${t.contentLength}`)}if(!i)try{i=Buffer.alloc(o)}catch(e){throw Error(`Unable to allocate the buffer of size: ${o}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${e.message}`)}if(i.length{let n=a+o;r+c{let a=await this.download(t,n,{...r,tracingOptions:i.tracingOptions});return a.readableStreamBody&&await MT(a.readableStreamBody,e),a.blobDownloadStream=void 0,a})}getBlobAndContainerNamesFromUrl(){let e,t;try{let n=new URL(this.url);if(n.host.split(`.`)[1]===`blob`){let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}else if(Sw(n)){let r=n.pathname.match(`/([^/]*)/([^/]*)(/(.*))?`);e=r[2],t=r[4]}else{let r=n.pathname.match(`/([^/]*)(/(.*))?`);e=r[1],t=r[3]}if(e=decodeURIComponent(e),t=decodeURIComponent(t),t=t.replace(/\\/g,`/`),!e)throw Error(`Provided containerName is invalid.`);return{blobName:t,containerName:e}}catch{throw Error(`Unable to extract blobName and containerName with provided information.`)}}async startCopyFromURL(e,t={}){return Q.withSpan(`BlobClient-startCopyFromURL`,t,async n=>(t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{},Aw(await this.blobContext.startCopyFromURL(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:gT(t.tier),blobTagsString:Cw(t.tags),sealBlob:t.sealBlob,tracingOptions:n.tracingOptions}))))}generateSasUrl(e){return new Promise(t=>{if(!(this.credential instanceof qh))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);let n=Lw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).toString();t(hw(this.url,n))})}generateSasStringToSign(e){if(!(this.credential instanceof qh))throw RangeError(`Can only generate the SAS when the client is initialized with a shared key credential`);return Rw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},this.credential).stringToSign}generateUserDelegationSasUrl(e,t){return new Promise(n=>{let r=Lw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).toString();n(hw(this.url,r))})}generateUserDelegationSasStringToSign(e,t){return Rw({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId,...e},t,this.accountName).stringToSign}async deleteImmutabilityPolicy(e={}){return Q.withSpan(`BlobClient-deleteImmutabilityPolicy`,e,async e=>Aw(await this.blobContext.deleteImmutabilityPolicy({tracingOptions:e.tracingOptions})))}async setImmutabilityPolicy(e,t={}){return Q.withSpan(`BlobClient-setImmutabilityPolicy`,t,async t=>Aw(await this.blobContext.setImmutabilityPolicy({immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,tracingOptions:t.tracingOptions})))}async setLegalHold(e,t={}){return Q.withSpan(`BlobClient-setLegalHold`,t,async t=>Aw(await this.blobContext.setLegalHold(e,{tracingOptions:t.tracingOptions})))}async getAccountInfo(e={}){return Q.withSpan(`BlobClient-getAccountInfo`,e,async t=>Aw(await this.blobContext.getAccountInfo({abortSignal:e.abortSignal,tracingOptions:t.tracingOptions})))}},IT=class e extends FT{appendBlobContext;constructor(e,t,n,r){let i,a;if(r||={},_g(t))a=e,i=t;else if(Wu&&t instanceof qh||t instanceof Bh||Fd(t))a=e,r=n,i=yg(t,r);else if(!t&&typeof t!=`string`)a=e,i=yg(new Bh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=lw(e);if(c.kind===`AccountConnString`)if(Wu){let e=new qh(c.accountName,c.accountKey);a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=$u(c.proxyUri),i=yg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=yg(new Bh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.appendBlobContext=this.storageClientContext.appendBlob}withSnapshot(t){return new e(fw(this.url,pg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e={}){return e.conditions=e.conditions||{},_T(e.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-create`,e,async t=>Aw(await this.appendBlobContext.create(0,{abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:e.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:e.immutabilityPolicy?.policyMode,legalHold:e.legalHold,blobTagsString:Cw(e.tags),tracingOptions:t.tracingOptions})))}async createIfNotExists(e={}){let t={ifNoneMatch:`*`};return Q.withSpan(`AppendBlobClient-createIfNotExists`,e,async e=>{try{let n=Aw(await this.create({...e,conditions:t}));return{succeeded:!0,...n,_response:n._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async seal(e={}){return e.conditions=e.conditions||{},Q.withSpan(`AppendBlobClient-seal`,e,async t=>Aw(await this.appendBlobContext.seal({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:t.tracingOptions})))}async appendBlock(e,t,n={}){return n.conditions=n.conditions||{},_T(n.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-appendBlock`,n,async r=>Aw(await this.appendBlobContext.appendBlock(t,e,{abortSignal:n.abortSignal,appendPositionAccessConditions:n.conditions,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},transactionalContentMD5:n.transactionalContentMD5,transactionalContentCrc64:n.transactionalContentCrc64,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async appendBlockFromURL(e,t,n,r={}){return r.conditions=r.conditions||{},r.sourceConditions=r.sourceConditions||{},_T(r.customerProvidedKey,this.isHttps),Q.withSpan(`AppendBlobClient-appendBlockFromURL`,r,async i=>Aw(await this.appendBlobContext.appendBlockFromUrl(e,0,{abortSignal:r.abortSignal,sourceRange:OT({offset:t,count:n}),sourceContentMD5:r.sourceContentMD5,sourceContentCrc64:r.sourceContentCrc64,leaseAccessConditions:r.conditions,appendPositionAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:r.sourceConditions?.ifMatch,sourceIfModifiedSince:r.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:r.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:r.sourceConditions?.ifUnmodifiedSince},copySourceAuthorization:Ow(r.sourceAuthorization),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,fileRequestIntent:r.sourceShareTokenIntent,tracingOptions:i.tracingOptions})))}},LT=class e extends FT{_blobContext;blockBlobContext;constructor(e,t,n,r){let i,a;if(r||={},_g(t))a=e,i=t;else if(Wu&&t instanceof qh||t instanceof Bh||Fd(t))a=e,r=n,i=yg(t,r);else if(!t&&typeof t!=`string`)a=e,n&&typeof n!=`string`&&(r=n),i=yg(new Bh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=lw(e);if(c.kind===`AccountConnString`)if(Wu){let e=new qh(c.accountName,c.accountKey);a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=$u(c.proxyUri),i=yg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=yg(new Bh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.blockBlobContext=this.storageClientContext.blockBlob,this._blobContext=this.storageClientContext.blob}withSnapshot(t){return new e(fw(this.url,pg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async query(e,t={}){if(_T(t.customerProvidedKey,this.isHttps),!Wu)throw Error(`This operation currently is only supported in Node.js.`);return Q.withSpan(`BlockBlobClient-query`,t,async n=>new pT(Aw(await this._blobContext.query({abortSignal:t.abortSignal,queryRequest:{queryType:`SQL`,expression:e,inputSerialization:Ew(t.inputTextConfiguration),outputSerialization:Ew(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,tracingOptions:n.tracingOptions})),{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError}))}async upload(e,t,n={}){return n.conditions=n.conditions||{},_T(n.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-upload`,n,async r=>Aw(await this.blockBlobContext.upload(t,e,{abortSignal:n.abortSignal,blobHttpHeaders:n.blobHTTPHeaders,leaseAccessConditions:n.conditions,metadata:n.metadata,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},requestOptions:{onUploadProgress:n.onProgress},cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,immutabilityPolicyExpiry:n.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:n.immutabilityPolicy?.policyMode,legalHold:n.legalHold,tier:gT(n.tier),blobTagsString:Cw(n.tags),tracingOptions:r.tracingOptions})))}async syncUploadFromURL(e,t={}){return t.conditions=t.conditions||{},_T(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-syncUploadFromURL`,t,async n=>Aw(await this.blockBlobContext.putBlobFromUrl(0,e,{...t,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions?.ifMatch,sourceIfModifiedSince:t.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions?.ifUnmodifiedSince,sourceIfTags:t.sourceConditions?.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:Ow(t.sourceAuthorization),tier:gT(t.tier),blobTagsString:Cw(t.tags),copySourceTags:t.copySourceTags,fileRequestIntent:t.sourceShareTokenIntent,tracingOptions:n.tracingOptions})))}async stageBlock(e,t,n,r={}){return _T(r.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-stageBlock`,r,async i=>Aw(await this.blockBlobContext.stageBlock(e,n,t,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async stageBlockFromURL(e,t,n=0,r,i={}){return _T(i.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-stageBlockFromURL`,i,async a=>Aw(await this.blockBlobContext.stageBlockFromURL(e,0,t,{abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,sourceRange:n===0&&!r?void 0:OT({offset:n,count:r}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:Ow(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async commitBlockList(e,t={}){return t.conditions=t.conditions||{},_T(t.customerProvidedKey,this.isHttps),Q.withSpan(`BlockBlobClient-commitBlockList`,t,async n=>Aw(await this.blockBlobContext.commitBlockList({latest:e},{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:gT(t.tier),blobTagsString:Cw(t.tags),tracingOptions:n.tracingOptions})))}async getBlockList(e,t={}){return Q.withSpan(`BlockBlobClient-getBlockList`,t,async n=>{let r=Aw(await this.blockBlobContext.getBlockList(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return r.committedBlocks||=[],r.uncommittedBlocks||=[],r})}async uploadData(e,t={}){return Q.withSpan(`BlockBlobClient-uploadData`,t,async t=>{if(Wu){let n;return e instanceof Buffer?n=e:e instanceof ArrayBuffer?n=Buffer.from(e):(e=e,n=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.byteLength,t)}else{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)}})}async uploadBrowserData(e,t={}){return Q.withSpan(`BlockBlobClient-uploadBrowserData`,t,async t=>{let n=new Blob([e]);return this.uploadSeekableInternal((e,t)=>n.slice(e,e+t),n.size,t)})}async uploadSeekableInternal(e,t,n={}){let r=n.blockSize??0;if(r<0||r>4194304e3)throw RangeError(`blockSize option must be >= 0 and <= 4194304000`);let i=n.maxSingleShotSize??268435456;if(i<0||i>268435456)throw RangeError(`maxSingleShotSize option must be >= 0 and <= 268435456`);if(r===0){if(t>4194304e3*5e4)throw RangeError(`${t} is too larger to upload to a block blob.`);t>i&&(r=Math.ceil(t/dg),r<4194304&&(r=fg))}return n.blobHTTPHeaders||={},n.conditions||={},Q.withSpan(`BlockBlobClient-uploadSeekableInternal`,n,async a=>{if(t<=i)return Aw(await this.upload(e(0,t),t,a));let o=Math.floor((t-1)/r)+1;if(o>5e4)throw RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${dg}`);let s=[],c=Uu(),l=0,u=new AT(n.concurrency);for(let i=0;i{let u=vw(c,i),d=r*i,f=(i===o-1?t:d+r)-d;s.push(u),await this.stageBlock(u,e(d,f),f,{abortSignal:n.abortSignal,conditions:n.conditions,encryptionScope:n.encryptionScope,tracingOptions:a.tracingOptions}),l+=f,n.onProgress&&n.onProgress({loadedBytes:l})});return await u.do(),this.commitBlockList(s,a)})}async uploadFile(e,t={}){return Q.withSpan(`BlockBlobClient-uploadFile`,t,async n=>{let r=(await NT(e)).size;return this.uploadSeekableInternal((t,n)=>()=>PT(e,{autoClose:!0,end:n?t+n-1:1/0,start:t}),r,{...t,tracingOptions:n.tracingOptions})})}async uploadStream(e,t=8388608,n=5,r={}){return r.blobHTTPHeaders||={},r.conditions||={},Q.withSpan(`BlockBlobClient-uploadStream`,r,async i=>{let a=0,o=Uu(),s=0,c=[];return await new wh(e,t,n,async(e,t)=>{let n=vw(o,a);c.push(n),a++,await this.stageBlock(n,e,t,{customerProvidedKey:r.customerProvidedKey,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions}),s+=t,r.onProgress&&r.onProgress({loadedBytes:s})},Math.ceil(n/4*3)).do(),Aw(await this.commitBlockList(c,{...r,tracingOptions:i.tracingOptions}))})}},RT=class e extends FT{pageBlobContext;constructor(e,t,n,r){let i,a;if(r||={},_g(t))a=e,i=t;else if(Wu&&t instanceof qh||t instanceof Bh||Fd(t))a=e,r=n,i=yg(t,r);else if(!t&&typeof t!=`string`)a=e,i=yg(new Bh,r);else if(t&&typeof t==`string`&&n&&typeof n==`string`){let o=t,s=n,c=lw(e);if(c.kind===`AccountConnString`)if(Wu){let e=new qh(c.accountName,c.accountKey);a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s)),r.proxyOptions||=$u(c.proxyUri),i=yg(e,r)}else throw Error(`Account connection string is only supported in Node.js environment`);else if(c.kind===`SASConnString`)a=dw(dw(c.url,encodeURIComponent(o)),encodeURIComponent(s))+`?`+c.accountSas,i=yg(new Bh,r);else throw Error(`Connection string must be either an Account connection string or a SAS connection string`)}else throw Error(`Expecting non-empty strings for containerName and blobName parameters`);super(a,i),this.pageBlobContext=this.storageClientContext.pageBlob}withSnapshot(t){return new e(fw(this.url,pg.Parameters.SNAPSHOT,t.length===0?void 0:t),this.pipeline)}async create(e,t={}){return t.conditions=t.conditions||{},_T(t.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-create`,t,async n=>Aw(await this.pageBlobContext.create(0,e,{abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:t.immutabilityPolicy?.expiriesOn,immutabilityPolicyMode:t.immutabilityPolicy?.policyMode,legalHold:t.legalHold,tier:gT(t.tier),blobTagsString:Cw(t.tags),tracingOptions:n.tracingOptions})))}async createIfNotExists(e,t={}){return Q.withSpan(`PageBlobClient-createIfNotExists`,t,async n=>{try{let r={ifNoneMatch:`*`},i=Aw(await this.create(e,{...t,conditions:r,tracingOptions:n.tracingOptions}));return{succeeded:!0,...i,_response:i._response}}catch(e){if(e.details?.errorCode===`BlobAlreadyExists`)return{succeeded:!1,...e.response?.parsedHeaders,_response:e.response};throw e}})}async uploadPages(e,t,n,r={}){return r.conditions=r.conditions||{},_T(r.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-uploadPages`,r,async i=>Aw(await this.pageBlobContext.uploadPages(n,e,{abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},requestOptions:{onUploadProgress:r.onProgress},range:OT({offset:t,count:n}),sequenceNumberAccessConditions:r.conditions,transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})))}async uploadPagesFromURL(e,t,n,r,i={}){return i.conditions=i.conditions||{},i.sourceConditions=i.sourceConditions||{},_T(i.customerProvidedKey,this.isHttps),Q.withSpan(`PageBlobClient-uploadPagesFromURL`,i,async a=>Aw(await this.pageBlobContext.uploadPagesFromURL(e,OT({offset:t,count:r}),0,OT({offset:n,count:r}),{abortSignal:i.abortSignal,sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,leaseAccessConditions:i.conditions,sequenceNumberAccessConditions:i.conditions,modifiedAccessConditions:{...i.conditions,ifTags:i.conditions?.tagConditions},sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions?.ifMatch,sourceIfModifiedSince:i.sourceConditions?.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions?.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions?.ifUnmodifiedSince},cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,copySourceAuthorization:Ow(i.sourceAuthorization),fileRequestIntent:i.sourceShareTokenIntent,tracingOptions:a.tracingOptions})))}async clearPages(e=0,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-clearPages`,n,async r=>Aw(await this.pageBlobContext.clearPages(0,{abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:OT({offset:e,count:t}),sequenceNumberAccessConditions:n.conditions,cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,tracingOptions:r.tracingOptions})))}async getPageRanges(e=0,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-getPageRanges`,n,async r=>yT(Aw(await this.pageBlobContext.getPageRanges({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},range:OT({offset:e,count:t}),tracingOptions:r.tracingOptions}))))}async listPageRangesSegment(e=0,t,n,r={}){return Q.withSpan(`PageBlobClient-getPageRangesSegment`,r,async i=>Aw(await this.pageBlobContext.getPageRanges({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},range:OT({offset:e,count:t}),marker:n,maxPageSize:r.maxPageSize,tracingOptions:i.tracingOptions})))}async*listPageRangeItemSegments(e=0,t,n,r={}){let i;if(n||n===void 0)do i=await this.listPageRangesSegment(e,t,n,r),n=i.continuationToken,yield await i;while(n)}async*listPageRangeItems(e=0,t,n={}){for await(let r of this.listPageRangeItemSegments(e,t,void 0,n))yield*kw(r)}listPageRanges(e=0,t,n={}){n.conditions=n.conditions||{};let r=this.listPageRangeItems(e,t,n);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listPageRangeItemSegments(e,t,r.continuationToken,{maxPageSize:r.maxPageSize,...n})}}async getPageRangesDiff(e,t,n,r={}){return r.conditions=r.conditions||{},Q.withSpan(`PageBlobClient-getPageRangesDiff`,r,async i=>yT(Aw(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevsnapshot:n,range:OT({offset:e,count:t}),tracingOptions:i.tracingOptions}))))}async listPageRangesDiffSegment(e,t,n,r,i={}){return Q.withSpan(`PageBlobClient-getPageRangesDiffSegment`,i,async a=>Aw(await this.pageBlobContext.getPageRangesDiff({abortSignal:i?.abortSignal,leaseAccessConditions:i?.conditions,modifiedAccessConditions:{...i?.conditions,ifTags:i?.conditions?.tagConditions},prevsnapshot:n,range:OT({offset:e,count:t}),marker:r,maxPageSize:i?.maxPageSize,tracingOptions:a.tracingOptions})))}async*listPageRangeDiffItemSegments(e,t,n,r,i){let a;if(r||r===void 0)do a=await this.listPageRangesDiffSegment(e,t,n,r,i),r=a.continuationToken,yield await a;while(r)}async*listPageRangeDiffItems(e,t,n,r){for await(let i of this.listPageRangeDiffItemSegments(e,t,n,void 0,r))yield*kw(i)}listPageRangesDiff(e,t,n,r={}){r.conditions=r.conditions||{};let i=this.listPageRangeDiffItems(e,t,n,{...r});return{next(){return i.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.listPageRangeDiffItemSegments(e,t,n,i.continuationToken,{maxPageSize:i.maxPageSize,...r})}}async getPageRangesDiffForManagedDisks(e,t,n,r={}){return r.conditions=r.conditions||{},Q.withSpan(`PageBlobClient-GetPageRangesDiffForManagedDisks`,r,async i=>yT(Aw(await this.pageBlobContext.getPageRangesDiff({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},prevSnapshotUrl:n,range:OT({offset:e,count:t}),tracingOptions:i.tracingOptions}))))}async resize(e,t={}){return t.conditions=t.conditions||{},Q.withSpan(`PageBlobClient-resize`,t,async n=>Aw(await this.pageBlobContext.resize(e,{abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},encryptionScope:t.encryptionScope,tracingOptions:n.tracingOptions})))}async updateSequenceNumber(e,t,n={}){return n.conditions=n.conditions||{},Q.withSpan(`PageBlobClient-updateSequenceNumber`,n,async r=>Aw(await this.pageBlobContext.updateSequenceNumber(e,{abortSignal:n.abortSignal,blobSequenceNumber:t,leaseAccessConditions:n.conditions,modifiedAccessConditions:{...n.conditions,ifTags:n.conditions?.tagConditions},tracingOptions:r.tracingOptions})))}async startCopyIncremental(e,t={}){return Q.withSpan(`PageBlobClient-startCopyIncremental`,t,async n=>Aw(await this.pageBlobContext.copyIncremental(e,{abortSignal:t.abortSignal,modifiedAccessConditions:{...t.conditions,ifTags:t.conditions?.tagConditions},tracingOptions:n.tracingOptions})))}},zT=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},BT=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};BT.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var VT=class extends Error{constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries. Usage is recalculated every 6-12 hours. +More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name=`UsageError`}};VT.isUsageErrorMessage=e=>e?e.includes(`insufficient usage`):!1;var HT=class extends Error{constructor(e){super(e),this.name=`RateLimitError`}},UT=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},WT=class{constructor(e){this.contentLength=e,this.sentBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}setSentBytes(e){this.sentBytes=e}getTransferredBytes(){return this.sentBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.sentBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);jr(`Sent ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setSentBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};function GT(e,t,n){return UT(this,void 0,void 0,function*(){let r=new FT(e),i=r.getBlockBlobClient(),a=new WT(n?.archiveSizeBytes??0),o={blockSize:n?.uploadChunkSize,concurrency:n?.uploadConcurrency,maxSingleShotSize:128*1024*1024,onProgress:a.onProgress()};try{a.startDisplayTimer(),G(`BlobClient: ${r.name}:${r.accountName}:${r.containerName}`);let e=yield i.uploadFile(t,o);if(e._response.status>=400)throw new zT(`uploadCacheArchiveSDK: upload failed with status code ${e._response.status}`);return e}catch(e){throw Ar(`uploadCacheArchiveSDK: internal error uploading cache archive: ${e.message}`),e}finally{a.stopDisplayTimer()}})}var KT=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function qT(e){return e?e>=200&&e<300:!1}function JT(e){return e?e>=500:!0}function YT(e){return e?[bn.BadGateway,bn.ServiceUnavailable,bn.GatewayTimeout].includes(e):!1}function XT(e){return KT(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}function ZT(e,t,n){return KT(this,arguments,void 0,function*(e,t,n,r=2,i=Hs,a=void 0){let o=``,s=1;for(;s<=r;){let c,l,u=!1;try{c=yield t()}catch(e){a&&(c=a(e)),u=!0,o=e.message}if(c&&(l=n(c),!JT(l)))return c;if(l&&(u=YT(l),o=`Cache service responded with ${l}`),G(`${e} - Attempt ${s} of ${r} failed with error: ${o}`),!u){G(`${e} - Error is not retryable`);break}yield XT(i),s++}throw Error(`${e} failed: ${o}`)})}function QT(e,t){return KT(this,arguments,void 0,function*(e,t,n=2,r=Hs){return yield ZT(e,t,e=>e.statusCode,n,r,e=>{if(e instanceof En)return{statusCode:e.statusCode,result:null,headers:{},error:e}})})}function $T(e,t){return KT(this,arguments,void 0,function*(e,t,n=2,r=Hs){return yield ZT(e,t,e=>e.message.statusCode,n,r)})}var eE=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function tE(e,t){return eE(this,void 0,void 0,function*(){yield S.promisify(z.pipeline)(e.message,t)})}var nE=class{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset+=this.segmentSize,this.segmentIndex+=1,this.segmentSize=e,this.receivedBytes=0,G(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.receivedBytes=e}getTransferredBytes(){return this.segmentOffset+this.receivedBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,t=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,r=(e/(1024*1024)/(n/1e3)).toFixed(1);jr(`Received ${e} of ${this.contentLength} (${t}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e))};this.timeoutHandle=setTimeout(t,e)}stopDisplayTimer(){this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0),this.display()}};function rE(e,t){return eE(this,void 0,void 0,function*(){let n=o.createWriteStream(t),r=new On(`actions/cache`),i=yield $T(`downloadCache`,()=>eE(this,void 0,void 0,function*(){return r.get(e)}));i.message.socket.setTimeout(Us,()=>{i.message.destroy(),G(`Aborting download, socket timed out after ${Us} ms`)}),yield tE(i,n);let a=i.message.headers[`content-length`];if(a){let e=parseInt(a),n=Qs(t);if(n!==e)throw Error(`Incomplete download. Expected file size: ${e}, actual file size: ${n}`)}else G(`Unable to validate download, no Content-Length header`)})}function iE(e,t,n){return eE(this,void 0,void 0,function*(){let r=yield o.promises.open(t,`w`),i=new On(`actions/cache`,void 0,{socketTimeout:n.timeoutInMs,keepAlive:!0});try{let t=(yield $T(`downloadCacheMetadata`,()=>eE(this,void 0,void 0,function*(){return yield i.request(`HEAD`,e,null,{})}))).message.headers[`content-length`];if(t==null)throw Error(`Content-Length not found on blob response`);let a=parseInt(t);if(Number.isNaN(a))throw Error(`Could not interpret Content-Length: ${a}`);let o=[],s=4*1024*1024;for(let t=0;teE(this,void 0,void 0,function*(){return yield aE(i,e,t,n)})})}o.reverse();let c=0,l=0,u=new nE(a);u.startDisplayTimer();let d=u.onProgress(),f=[],p,m=()=>eE(this,void 0,void 0,function*(){let e=yield Promise.race(Object.values(f));yield r.write(e.buffer,0,e.count,e.offset),c--,delete f[e.offset],l+=e.count,d({loadedBytes:l})});for(;p=o.pop();)f[p.offset]=p.promiseGetter(),c++,c>=(n.downloadConcurrency??10)&&(yield m());for(;c>0;)yield m()}finally{i.dispose(),yield r.close()}})}function aE(e,t,n,r){return eE(this,void 0,void 0,function*(){let i=0;for(;;)try{let i=yield cE(3e4,oE(e,t,n,r));if(typeof i==`string`)throw Error(`downloadSegmentRetry failed due to timeout`);return i}catch(e){if(i>=5)throw e;i++}})}function oE(e,t,n,r){return eE(this,void 0,void 0,function*(){let i=yield $T(`downloadCachePart`,()=>eE(this,void 0,void 0,function*(){return yield e.get(t,{Range:`bytes=${n}-${n+r-1}`})}));if(!i.readBodyBuffer)throw Error(`Expected HttpClientResponse to implement readBodyBuffer`);return{offset:n,count:r,buffer:yield i.readBodyBuffer()}})}function sE(e,t,n){return eE(this,void 0,void 0,function*(){let r=new LT(e,void 0,{retryOptions:{tryTimeoutInMs:n.timeoutInMs}}),i=(yield r.getProperties()).contentLength??-1;if(i<0)G(`Unable to determine content length, downloading file with http-client...`),yield rE(e,t);else{let e=Math.min(134217728,V.constants.MAX_LENGTH),a=new nE(i),s=o.openSync(t,`w`);try{a.startDisplayTimer();let t=new AbortController,c=t.signal;for(;!a.isDone();){let l=a.segmentOffset+a.segmentSize,u=Math.min(e,i-l);a.nextSegment(u);let d=yield cE(n.segmentTimeoutInMs||36e5,r.downloadToBuffer(l,u,{abortSignal:c,concurrency:n.downloadConcurrency,onProgress:a.onProgress()}));if(d===`timeout`)throw t.abort(),Error(`Aborting cache download as the download time exceeded the timeout.`);Buffer.isBuffer(d)&&o.writeFileSync(s,d)}}finally{a.stopDisplayTimer(),o.closeSync(s)}}})}const cE=(e,t)=>eE(void 0,void 0,void 0,function*(){let n,r=new Promise(t=>{n=setTimeout(()=>t(`timeout`),e)});return Promise.race([t,r]).then(e=>(clearTimeout(n),e))});function lE(e){let t={useAzureSdk:!1,uploadConcurrency:4,uploadChunkSize:32*1024*1024};return e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.uploadConcurrency==`number`&&(t.uploadConcurrency=e.uploadConcurrency),typeof e.uploadChunkSize==`number`&&(t.uploadChunkSize=e.uploadChunkSize)),t.uploadConcurrency=isNaN(Number(process.env.CACHE_UPLOAD_CONCURRENCY))?t.uploadConcurrency:Math.min(32,Number(process.env.CACHE_UPLOAD_CONCURRENCY)),t.uploadChunkSize=isNaN(Number(process.env.CACHE_UPLOAD_CHUNK_SIZE))?t.uploadChunkSize:Math.min(128*1024*1024,Number(process.env.CACHE_UPLOAD_CHUNK_SIZE)*1024*1024),G(`Use Azure SDK: ${t.useAzureSdk}`),G(`Upload concurrency: ${t.uploadConcurrency}`),G(`Upload chunk size: ${t.uploadChunkSize}`),t}function uE(e){let t={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};e&&(typeof e.useAzureSdk==`boolean`&&(t.useAzureSdk=e.useAzureSdk),typeof e.concurrentBlobDownloads==`boolean`&&(t.concurrentBlobDownloads=e.concurrentBlobDownloads),typeof e.downloadConcurrency==`number`&&(t.downloadConcurrency=e.downloadConcurrency),typeof e.timeoutInMs==`number`&&(t.timeoutInMs=e.timeoutInMs),typeof e.segmentTimeoutInMs==`number`&&(t.segmentTimeoutInMs=e.segmentTimeoutInMs),typeof e.lookupOnly==`boolean`&&(t.lookupOnly=e.lookupOnly));let n=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return n&&!isNaN(Number(n))&&isFinite(Number(n))&&(t.segmentTimeoutInMs=Number(n)*60*1e3),G(`Use Azure SDK: ${t.useAzureSdk}`),G(`Download concurrency: ${t.downloadConcurrency}`),G(`Request timeout (ms): ${t.timeoutInMs}`),G(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),G(`Segment download timeout (ms): ${t.segmentTimeoutInMs}`),G(`Lookup only: ${t.lookupOnly}`),t}function dE(){let e=new URL(process.env.GITHUB_SERVER_URL||`https://github.com`).hostname.trimEnd().toUpperCase(),t=e===`GITHUB.COM`,n=e.endsWith(`.GHE.COM`),r=e.endsWith(`.LOCALHOST`);return!t&&!n&&!r}function fE(){return dE()?`v1`:process.env.ACTIONS_CACHE_SERVICE_V2?`v2`:`v1`}function pE(){let e=fE();switch(e){case`v1`:return process.env.ACTIONS_CACHE_URL||process.env.ACTIONS_RESULTS_URL||``;case`v2`:return process.env.ACTIONS_RESULTS_URL||``;default:throw Error(`Unsupported cache service version: ${e}`)}}var mE=U(((e,t)=>{t.exports={name:`@actions/cache`,version:`6.0.0`,description:`Actions cache lib`,keywords:[`github`,`actions`,`cache`],homepage:`https://github.com/actions/toolkit/tree/main/packages/cache`,license:`MIT`,type:`module`,main:`lib/cache.js`,types:`lib/cache.d.ts`,exports:{".":{types:`./lib/cache.d.ts`,import:`./lib/cache.js`}},directories:{lib:`lib`,test:`__tests__`},files:[`lib`,`!.DS_Store`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/actions/toolkit.git`,directory:`packages/cache`},scripts:{"audit-moderate":`npm install && npm audit --json --audit-level=moderate > audit.json`,test:`echo "Error: run tests from root" && exit 1`,tsc:`tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/`},bugs:{url:`https://github.com/actions/toolkit/issues`},dependencies:{"@actions/core":`^3.0.0`,"@actions/exec":`^3.0.0`,"@actions/glob":`^0.6.1`,"@actions/http-client":`^4.0.0`,"@actions/io":`^3.0.0`,"@azure/core-rest-pipeline":`^1.22.0`,"@azure/storage-blob":`^12.30.0`,"@protobuf-ts/runtime-rpc":`^2.11.1`,semver:`^7.7.3`},devDependencies:{"@protobuf-ts/plugin":`^2.9.4`,"@types/node":`^25.1.0`,"@types/semver":`^7.7.1`,typescript:`^5.2.2`},overrides:{"uri-js":`npm:uri-js-replace@^1.0.1`,"node-fetch":`^3.3.2`}}})),hE=U(((e,t)=>{t.exports={version:mE().version}}))();function gE(){return`@actions/cache-${hE.version}`}var _E=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function vE(e){let t=pE();if(!t)throw Error(`Cache Service Url not found, unable to restore cache.`);let n=`${t}_apis/artifactcache/${e}`;return G(`Resource Url: ${n}`),n}function yE(e,t){return`${e};api-version=${t}`}function bE(){return{headers:{Accept:yE(`application/json`,`6.0-preview.1`)}}}function xE(){let e=new jn(process.env.ACTIONS_RUNTIME_TOKEN||``);return new On(gE(),[e],bE())}function SE(e,t,n){return _E(this,void 0,void 0,function*(){let r=xE(),i=oc(t,n?.compressionMethod,n?.enableCrossOsArchive),a=`cache?keys=${encodeURIComponent(e.join(`,`))}&version=${i}`,o=yield QT(`getCacheEntry`,()=>_E(this,void 0,void 0,function*(){return r.getJson(vE(a))}));if(o.statusCode===204)return Or()&&(yield CE(e[0],r,i)),null;if(!qT(o.statusCode))throw Error(`Cache service responded with ${o.statusCode}`);let s=o.result,c=s?.archiveLocation;if(!c)throw Error(`Cache not found.`);return Cr(c),G(`Cache Result:`),G(JSON.stringify(s)),s})}function CE(e,t,n){return _E(this,void 0,void 0,function*(){let r=`caches?key=${encodeURIComponent(e)}`,i=yield QT(`listCache`,()=>_E(this,void 0,void 0,function*(){return t.getJson(vE(r))}));if(i.statusCode===200){let t=i.result,r=t?.totalCount;if(r&&r>0){G(`No matching cache found for cache key '${e}', version '${n} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key \nOther caches with similar key:`);for(let e of t?.artifactCaches||[])G(`Cache Key: ${e?.cacheKey}, Cache Version: ${e?.cacheVersion}, Cache Scope: ${e?.scope}, Cache Created: ${e?.creationTime}`)}}})}function wE(e,t,n){return _E(this,void 0,void 0,function*(){let r=new B(e),i=uE(n);r.hostname.endsWith(`.blob.core.windows.net`)?i.useAzureSdk?yield sE(e,t,i):i.concurrentBlobDownloads?yield iE(e,t,i):yield rE(e,t):yield rE(e,t)})}function TE(e,t,n){return _E(this,void 0,void 0,function*(){let r=xE(),i={key:e,version:oc(t,n?.compressionMethod,n?.enableCrossOsArchive),cacheSize:n?.cacheSize};return yield QT(`reserveCache`,()=>_E(this,void 0,void 0,function*(){return r.postJson(vE(`caches`),i)}))})}function EE(e,t){return`bytes ${e}-${t}/*`}function DE(e,t,n,r,i){return _E(this,void 0,void 0,function*(){G(`Uploading chunk of size ${i-r+1} bytes at offset ${r} with content range: ${EE(r,i)}`);let a={"Content-Type":`application/octet-stream`,"Content-Range":EE(r,i)},o=yield $T(`uploadChunk (start: ${r}, end: ${i})`,()=>_E(this,void 0,void 0,function*(){return e.sendStream(`PATCH`,t,n(),a)}));if(!qT(o.message.statusCode))throw Error(`Cache service responded with ${o.message.statusCode} during upload chunk.`)})}function OE(e,t,n,r){return _E(this,void 0,void 0,function*(){let i=Qs(n),a=vE(`caches/${t.toString()}`),s=o.openSync(n,`r`),c=lE(r),l=ac(`uploadConcurrency`,c.uploadConcurrency),u=ac(`uploadChunkSize`,c.uploadChunkSize),d=[...Array(l).keys()];G(`Awaiting all uploads`);let f=0;try{yield Promise.all(d.map(()=>_E(this,void 0,void 0,function*(){for(;fo.createReadStream(n,{fd:s,start:r,end:c,autoClose:!1}).on(`error`,e=>{throw Error(`Cache upload failed because file read failed with ${e.message}`)}),r,c)}})))}finally{o.closeSync(s)}})}function kE(e,t,n){return _E(this,void 0,void 0,function*(){let r={size:n};return yield QT(`commitCache`,()=>_E(this,void 0,void 0,function*(){return e.postJson(vE(`caches/${t.toString()}`),r)}))})}function AE(e,t,n,r){return _E(this,void 0,void 0,function*(){if(lE(r).useAzureSdk){if(!n)throw Error(`Azure Storage SDK can only be used when a signed URL is provided.`);yield GT(n,t,r)}else{let n=xE();G(`Upload cache`),yield OE(n,e,t,r),G(`Commiting cache`);let i=Qs(t);jr(`Cache Size: ~${Math.round(i/(1024*1024))} MB (${i} B)`);let a=yield kE(n,e,i);if(!qT(a.statusCode))throw Error(`Cache service responded with ${a.statusCode} during commit cache.`);jr(`Cache saved successfully`)}})}var jE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isJsonObject=e.typeofJsonValue=void 0;function t(e){let t=typeof e;if(t==`object`){if(Array.isArray(e))return`array`;if(e===null)return`null`}return t}e.typeofJsonValue=t;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}e.isJsonObject=n})),ME=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.base64encode=e.base64decode=void 0;let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),n=[];for(let e=0;e>4,s=o,a=2;break;case 2:r[i++]=(s&15)<<4|(o&60)>>2,s=o,a=3;break;case 3:r[i++]=(s&3)<<6|o,a=0;break}}if(a==1)throw Error(`invalid base64 string.`);return r.subarray(0,i)}e.base64decode=r;function i(e){let n=``,r=0,i,a=0;for(let o=0;o>2],a=(i&3)<<4,r=1;break;case 1:n+=t[a|i>>4],a=(i&15)<<2,r=2;break;case 2:n+=t[a|i>>6],n+=t[i&63],r=0;break}return r&&(n+=t[a],n+=`=`,r==1&&(n+=`=`)),n}e.base64encode=i})),NE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.utf8read=void 0;let t=e=>String.fromCharCode.apply(String,e);function n(e){if(e.length<1)return``;let n=0,r=[],i=[],a=0,o,s=e.length;for(;n191&&o<224?i[a++]=(o&31)<<6|e[n++]&63:o>239&&o<365?(o=((o&7)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,i[a++]=55296+(o>>10),i[a++]=56320+(o&1023)):i[a++]=(o&15)<<12|(e[n++]&63)<<6|e[n++]&63,a>8191&&(r.push(t(i)),a=0);return r.length?(a&&r.push(t(i.slice(0,a))),r.join(``)):t(i.slice(0,a))}e.utf8read=n})),PE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WireType=e.mergeBinaryOptions=e.UnknownFieldHandler=void 0,(function(e){e.symbol=Symbol.for(`protobuf-ts/unknown`),e.onRead=(n,r,i,a,o)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:a,data:o})},e.onWrite=(t,n,r)=>{for(let{no:t,wireType:i,data:a}of e.list(n))r.tag(t,i).raw(a)},e.list=(n,r)=>{if(t(n)){let t=n[e.symbol];return r?t.filter(e=>e.no==r):t}return[]},e.last=(t,n)=>e.list(t,n).slice(-1)[0];let t=t=>t&&Array.isArray(t[e.symbol])})(e.UnknownFieldHandler||={});function t(e,t){return Object.assign(Object.assign({},e),t)}e.mergeBinaryOptions=t,(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(e.WireType||={})})),FE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.varint32read=e.varint32write=e.int64toString=e.int64fromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;let r=65536*65536;function i(e){let t=e[0]==`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,i,a]}e.int64fromString=i;function a(e,t){if(t>>>0<=2097151)return``+(r*t+(e>>>0));let n=e&16777215,i=(e>>>24|t<<8)>>>0&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,s=i+a*8147497,c=a*2,l=1e7;o>=l&&(s+=Math.floor(o/l),o%=l),s>=l&&(c+=Math.floor(s/l),s%=l);function u(e,t){let n=e?String(e):``;return t?`0000000`.slice(n.length)+n:n}return u(c,0)+u(s,c)+u(o,1)}e.int64toString=a;function o(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=o;function s(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=s})),IE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PbLong=e.PbULong=e.detectBi=void 0;let t=FE(),n;function r(){let e=new DataView(new ArrayBuffer(8));n=globalThis.BigInt!==void 0&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`?{MIN:BigInt(`-9223372036854775808`),MAX:BigInt(`9223372036854775807`),UMIN:BigInt(`0`),UMAX:BigInt(`18446744073709551615`),C:BigInt,V:e}:void 0}e.detectBi=r,r();function i(e){if(!e)throw Error(`BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support`)}let a=/^-?[0-9]+$/,o=4294967296,s=2147483648;var c=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*o+(this.lo>>>0);if(!Number.isSafeInteger(e))throw Error(`cannot convert to safe number`);return e}},l=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.UMAX)throw Error(`ulong too large`);return n.V.setBigUint64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,s]=t.int64fromString(r);if(n)throw Error(`signed value for ulong`);return new e(i,s);case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);if(r<0)throw Error(`signed value for ulong`);return new e(r,r/o)}throw Error(`unknown value `+typeof r)}toString(){return n?this.toBigInt().toString():t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigUint64(0,!0)}};e.PbULong=l,l.ZERO=new l(0,0);var u=class e extends c{static from(r){if(n)switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r==``)throw Error(`string is no integer`);r=n.C(r);case`number`:if(r===0)return this.ZERO;r=n.C(r);case`bigint`:if(!r)return this.ZERO;if(rn.MAX)throw Error(`signed long too large`);return n.V.setBigInt64(0,r,!0),new e(n.V.getInt32(0,!0),n.V.getInt32(4,!0))}else switch(typeof r){case`string`:if(r==`0`)return this.ZERO;if(r=r.trim(),!a.test(r))throw Error(`string is no integer`);let[n,i,c]=t.int64fromString(r);if(n){if(c>s||c==s&&i!=0)throw Error(`signed long too small`)}else if(c>=s)throw Error(`signed long too large`);let l=new e(i,c);return n?l.negate():l;case`number`:if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw Error(`number is no integer`);return r>0?new e(r,r/o):new e(-r,-r/o).negate()}throw Error(`unknown value `+typeof r)}isNegative(){return(this.hi&s)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new e(n,t)}toString(){if(n)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return`-`+t.int64toString(e.lo,e.hi)}return t.int64toString(this.lo,this.hi)}toBigInt(){return i(n),n.V.setInt32(0,this.lo,!0),n.V.setInt32(4,this.hi,!0),n.V.getBigInt64(0,!0)}};e.PbLong=u,u.ZERO=new u(0,0)})),LE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryReader=e.binaryReadOptions=void 0;let t=PE(),n=IE(),r=FE(),i={readUnknownField:!0,readerFactory:e=>new o(e)};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryReadOptions=a;var o=class{constructor(e,t){this.varint64=r.varint64read,this.uint32=r.varint32read,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e){let n=this.pos;switch(e){case t.WireType.Varint:for(;this.buf[this.pos++]&128;);break;case t.WireType.Bit64:this.pos+=4;case t.WireType.Bit32:this.pos+=4;break;case t.WireType.LengthDelimited:let n=this.uint32();this.pos+=n;break;case t.WireType.StartGroup:let r;for(;(r=this.tag()[1])!==t.WireType.EndGroup;)this.skip(r);break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new n.PbLong(...this.varint64())}uint64(){return new n.PbULong(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,new n.PbLong(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new n.PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new n.PbLong(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};e.BinaryReader=o})),RE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertFloat32=e.assertUInt32=e.assertInt32=e.assertNever=e.assert=void 0;function t(e,t){if(!e)throw Error(t)}e.assert=t;function n(e,t){throw Error(t??`Unexpected object: `+e)}e.assertNever=n;function r(e){if(typeof e!=`number`)throw Error(`invalid int 32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int 32: `+e)}e.assertInt32=r;function i(e){if(typeof e!=`number`)throw Error(`invalid uint 32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint 32: `+e)}e.assertUInt32=i;function a(e){if(typeof e!=`number`)throw Error(`invalid float 32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float 32: `+e)}e.assertFloat32=a})),zE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryWriter=e.binaryWriteOptions=void 0;let t=IE(),n=FE(),r=RE(),i={writeUnknownFields:!0,writerFactory:()=>new o};function a(e){return e?Object.assign(Object.assign({},i),e):i}e.binaryWriteOptions=a;var o=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(r.assertUInt32(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return r.assertInt32(e),n.varint32write(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){r.assertFloat32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){r.assertUInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){r.assertInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return r.assertInt32(e),e=(e<<1^e>>31)>>>0,n.varint32write(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbLong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=t.PbULong.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(e){let r=t.PbLong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}sint64(e){let r=t.PbLong.from(e),i=r.hi>>31,a=r.lo<<1^i,o=(r.hi<<1|r.lo>>>31)^i;return n.varint64write(a,o,this.buf),this}uint64(e){let r=t.PbULong.from(e);return n.varint64write(r.lo,r.hi,this.buf),this}};e.BinaryWriter=o})),BE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeJsonOptions=e.jsonWriteOptions=e.jsonReadOptions=void 0;let t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},n={ignoreUnknownFields:!1};function r(e){return e?Object.assign(Object.assign({},n),e):n}e.jsonReadOptions=r;function i(e){return e?Object.assign(Object.assign({},t),e):t}e.jsonWriteOptions=i;function a(e,t){let n=Object.assign(Object.assign({},e),t);return n.typeRegistry=[...e?.typeRegistry??[],...t?.typeRegistry??[]],n}e.mergeJsonOptions=a})),VE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MESSAGE_TYPE=void 0,e.MESSAGE_TYPE=Symbol.for(`protobuf-ts/message-type`)})),HE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.lowerCamelCase=void 0;function t(e){let t=!1,n=[];for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.readMessageOption=e.readFieldOption=e.readFieldOptions=e.normalizeFieldInfo=e.RepeatType=e.LongType=e.ScalarType=void 0;let t=HE();(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(e.ScalarType||={}),(function(e){e[e.BIGINT=0]=`BIGINT`,e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`})(e.LongType||={});var n;(function(e){e[e.NO=0]=`NO`,e[e.PACKED=1]=`PACKED`,e[e.UNPACKED=2]=`UNPACKED`})(n=e.RepeatType||={});function r(e){return e.localName=e.localName??t.lowerCamelCase(e.name),e.jsonName=e.jsonName??t.lowerCamelCase(e.name),e.repeat=e.repeat??n.NO,e.opt=e.opt??(e.repeat||e.oneof?!1:e.kind==`message`),e}e.normalizeFieldInfo=r;function i(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readFieldOptions=i;function a(e,t,n,r){let i=e.fields.find((e,n)=>e.localName==t||n==t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readFieldOption=a;function o(e,t,n){let r=e.options[t];return r===void 0?r:n?n.fromJson(r):r}e.readMessageOption=o})),WE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSelectedOneofValue=e.clearOneofValue=e.setUnknownOneofValue=e.setOneofValue=e.getOneofValue=e.isOneofGroup=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(`oneofKind`))return!1;switch(typeof e.oneofKind){case`string`:return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case`undefined`:return Object.keys(e).length==1;default:return!1}}e.isOneofGroup=t;function n(e,t){return e[t]}e.getOneofValue=n;function r(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&(e[t]=n)}e.setOneofValue=r;function i(e,t,n){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=t,n!==void 0&&t!==void 0&&(e[t]=n)}e.setUnknownOneofValue=i;function a(e){e.oneofKind!==void 0&&delete e[e.oneofKind],e.oneofKind=void 0}e.clearOneofValue=a;function o(e){if(e.oneofKind!==void 0)return e[e.oneofKind]}e.getSelectedOneofValue=o})),GE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionTypeCheck=void 0;let t=UE(),n=WE();e.ReflectionTypeCheck=class{constructor(e){this.fields=e.fields??[]}prepare(){if(this.data)return;let e=[],t=[],n=[];for(let r of this.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),e.push(r.oneof),t.push(r.oneof));else switch(t.push(r.localName),r.kind){case`scalar`:case`enum`:(!r.opt||r.repeat)&&e.push(r.localName);break;case`message`:r.repeat&&e.push(r.localName);break;case`map`:e.push(r.localName);break}this.data={req:e,known:t,oneofs:Object.values(n)}}is(e,t,r=!1){if(t<0)return!0;if(typeof e!=`object`||!e)return!1;this.prepare();let i=Object.keys(e),a=this.data;if(i.length!i.includes(e))||!r&&i.some(e=>!a.known.includes(e)))return!1;if(t<1)return!0;for(let i of a.oneofs){let a=e[i];if(!n.isOneofGroup(a))return!1;if(a.oneofKind===void 0)continue;let o=this.fields.find(e=>e.localName===a.oneofKind);if(!o||!this.field(a[a.oneofKind],o,r,t))return!1}for(let n of this.fields)if(n.oneof===void 0&&!this.field(e[n.localName],n,r,t))return!1;return!0}field(e,n,r,i){let a=n.repeat;switch(n.kind){case`scalar`:return e===void 0?n.opt:a?this.scalars(e,n.T,i,n.L):this.scalar(e,n.T,n.L);case`enum`:return e===void 0?n.opt:a?this.scalars(e,t.ScalarType.INT32,i):this.scalar(e,t.ScalarType.INT32);case`message`:return e===void 0?!0:a?this.messages(e,n.T(),r,i):this.message(e,n.T(),r,i);case`map`:if(typeof e!=`object`||!e)return!1;if(i<2)return!0;if(!this.mapKeys(e,n.K,i))return!1;switch(n.V.kind){case`scalar`:return this.scalars(Object.values(e),n.V.T,i,n.V.L);case`enum`:return this.scalars(Object.values(e),t.ScalarType.INT32,i);case`message`:return this.messages(Object.values(e),n.V.T(),r,i)}break}return!0}message(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}messages(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(let n=0;nparseInt(e)),n,r);case t.ScalarType.BOOL:return this.scalars(i.slice(0,r).map(e=>e==`true`?!0:e==`false`?!1:e),n,r);default:return this.scalars(i,n,r,t.LongType.STRING)}}}})),KE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionLongConvert=void 0;let t=UE();function n(e,n){switch(n){case t.LongType.BIGINT:return e.toBigInt();case t.LongType.NUMBER:return e.toNumber();default:return e.toString()}}e.reflectionLongConvert=n})),qE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonReader=void 0;let t=jE(),n=ME(),r=UE(),i=IE(),a=RE(),o=KE();e.ReflectionJsonReader=class{constructor(e){this.info=e}prepare(){if(this.fMap===void 0){this.fMap={};let e=this.info.fields??[];for(let t of e)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(e,n,r){if(!e){let e=t.typeofJsonValue(r);throw(e==`number`||e==`boolean`)&&(e=r.toString()),Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${n}`)}}read(e,n,i){this.prepare();let a=[];for(let[o,s]of Object.entries(e)){let e=this.fMap[o];if(!e){if(!i.ignoreUnknownFields)throw Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}let c=e.localName,l;if(e.oneof){if(s===null&&(e.kind!==`enum`||e.T()[0]!==`google.protobuf.NullValue`))continue;if(a.includes(e.oneof))throw Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);a.push(e.oneof),l=n[e.oneof]={oneofKind:c}}else l=n;if(e.kind==`map`){if(s===null)continue;this.assert(t.isJsonObject(s),e.name,s);let n=l[c];for(let[t,a]of Object.entries(s)){this.assert(a!==null,e.name+` map value`,null);let o;switch(e.V.kind){case`message`:o=e.V.T().internalJsonRead(a,i);break;case`enum`:if(o=this.enum(e.V.T(),a,e.name,i.ignoreUnknownFields),o===!1)continue;break;case`scalar`:o=this.scalar(a,e.V.T,e.V.L,e.name);break}this.assert(o!==void 0,e.name+` map value`,a);let s=t;e.K==r.ScalarType.BOOL&&(s=s==`true`?!0:s==`false`?!1:s),s=this.scalar(s,e.K,r.LongType.STRING,e.name).toString(),n[s]=o}}else if(e.repeat){if(s===null)continue;this.assert(Array.isArray(s),e.name,s);let t=l[c];for(let n of s){this.assert(n!==null,e.name,null);let r;switch(e.kind){case`message`:r=e.T().internalJsonRead(n,i);break;case`enum`:if(r=this.enum(e.T(),n,e.name,i.ignoreUnknownFields),r===!1)continue;break;case`scalar`:r=this.scalar(n,e.T,e.L,e.name);break}this.assert(r!==void 0,e.name,s),t.push(r)}}else switch(e.kind){case`message`:if(s===null&&e.T().typeName!=`google.protobuf.Value`){this.assert(e.oneof===void 0,e.name+` (oneof member)`,null);continue}l[c]=e.T().internalJsonRead(s,i,l[c]);break;case`enum`:if(s===null)continue;let t=this.enum(e.T(),s,e.name,i.ignoreUnknownFields);if(t===!1)continue;l[c]=t;break;case`scalar`:if(s===null)continue;l[c]=this.scalar(s,e.T,e.L,e.name);break}}}enum(e,t,n,r){if(e[0]==`google.protobuf.NullValue`&&a.assert(t===null||t===`NULL_VALUE`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case`number`:return a.assert(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case`string`:let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let o=e[1][i];return o===void 0&&r?!1:(a.assert(typeof o==`number`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),o)}a.assert(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,s,c){let l;try{switch(t){case r.ScalarType.DOUBLE:case r.ScalarType.FLOAT:if(e===null)return 0;if(e===`NaN`)return NaN;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===``){l=`empty string`;break}if(typeof e==`string`&&e.trim().length!==e.length){l=`extra whitespace`;break}if(typeof e!=`string`&&typeof e!=`number`)break;let c=Number(e);if(Number.isNaN(c)){l=`not a number`;break}if(!Number.isFinite(c)){l=`too large or small`;break}return t==r.ScalarType.FLOAT&&a.assertFloat32(c),c;case r.ScalarType.INT32:case r.ScalarType.FIXED32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:case r.ScalarType.UINT32:if(e===null)return 0;let u;if(typeof e==`number`?u=e:e===``?l=`empty string`:typeof e==`string`&&(e.trim().length===e.length?u=Number(e):l=`extra whitespace`),u===void 0)break;return t==r.ScalarType.UINT32?a.assertUInt32(u):a.assertInt32(u),u;case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:if(e===null)return o.reflectionLongConvert(i.PbLong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbLong.from(e),s);case r.ScalarType.FIXED64:case r.ScalarType.UINT64:if(e===null)return o.reflectionLongConvert(i.PbULong.ZERO,s);if(typeof e!=`number`&&typeof e!=`string`)break;return o.reflectionLongConvert(i.PbULong.from(e),s);case r.ScalarType.BOOL:if(e===null)return!1;if(typeof e!=`boolean`)break;return e;case r.ScalarType.STRING:if(e===null)return``;if(typeof e!=`string`){l=`extra whitespace`;break}return e;case r.ScalarType.BYTES:if(e===null||e===``)return new Uint8Array;if(typeof e!=`string`)break;return n.base64decode(e)}}catch(e){l=e.message}this.assert(!1,c+(l?` - `+l:``),e)}}})),JE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionJsonWriter=void 0;let t=ME(),n=IE(),r=UE(),i=RE();e.ReflectionJsonWriter=class{constructor(e){this.fields=e.fields??[]}write(e,t){let n={},r=e;for(let e of this.fields){if(!e.oneof){let i=this.field(e,r[e.localName],t);i!==void 0&&(n[t.useProtoFieldName?e.name:e.jsonName]=i);continue}let a=r[e.oneof];if(a.oneofKind!==e.localName)continue;let o=e.kind==`scalar`||e.kind==`enum`?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,s=this.field(e,a[e.localName],o);i.assert(s!==void 0),n[t.useProtoFieldName?e.name:e.jsonName]=s}return n}field(e,t,n){let r;if(e.kind==`map`){i.assert(typeof t==`object`&&!!t);let a={};switch(e.V.kind){case`scalar`:for(let[n,r]of Object.entries(t)){let t=this.scalar(e.V.T,r,e.name,!1,!0);i.assert(t!==void 0),a[n.toString()]=t}break;case`message`:let r=e.V.T();for(let[o,s]of Object.entries(t)){let t=this.message(r,s,e.name,n);i.assert(t!==void 0),a[o.toString()]=t}break;case`enum`:let o=e.V.T();for(let[r,s]of Object.entries(t)){i.assert(s===void 0||typeof s==`number`);let t=this.enum(o,s,e.name,!1,!0,n.enumAsInteger);i.assert(t!==void 0),a[r.toString()]=t}break}(n.emitDefaultValues||Object.keys(a).length>0)&&(r=a)}else if(e.repeat){i.assert(Array.isArray(t));let a=[];switch(e.kind){case`scalar`:for(let n=0;n0||n.emitDefaultValues)&&(r=a)}else switch(e.kind){case`scalar`:r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case`enum`:r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case`message`:r=this.message(e.T(),t,e.name,n);break}return r}enum(e,t,n,r,a,o){if(e[0]==`google.protobuf.NullValue`)return!a&&!r?void 0:null;if(t===void 0){i.assert(r);return}if(!(t===0&&!a&&!r))return i.assert(typeof t==`number`),i.assert(Number.isInteger(t)),o||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,r){return t===void 0?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}scalar(e,a,o,s,c){if(a===void 0){i.assert(s);return}let l=c||s;switch(e){case r.ScalarType.INT32:case r.ScalarType.SFIXED32:case r.ScalarType.SINT32:return a===0?l?0:void 0:(i.assertInt32(a),a);case r.ScalarType.FIXED32:case r.ScalarType.UINT32:return a===0?l?0:void 0:(i.assertUInt32(a),a);case r.ScalarType.FLOAT:i.assertFloat32(a);case r.ScalarType.DOUBLE:return a===0?l?0:void 0:(i.assert(typeof a==`number`),Number.isNaN(a)?`NaN`:a===1/0?`Infinity`:a===-1/0?`-Infinity`:a);case r.ScalarType.STRING:return a===``?l?``:void 0:(i.assert(typeof a==`string`),a);case r.ScalarType.BOOL:return a===!1?l?!1:void 0:(i.assert(typeof a==`boolean`),a);case r.ScalarType.UINT64:case r.ScalarType.FIXED64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let e=n.PbULong.from(a);return e.isZero()&&!l?void 0:e.toString();case r.ScalarType.INT64:case r.ScalarType.SFIXED64:case r.ScalarType.SINT64:i.assert(typeof a==`number`||typeof a==`string`||typeof a==`bigint`);let o=n.PbLong.from(a);return o.isZero()&&!l?void 0:o.toString();case r.ScalarType.BYTES:return i.assert(a instanceof Uint8Array),a.byteLength?t.base64encode(a):l?``:void 0}}}})),YE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionScalarDefault=void 0;let t=UE(),n=KE(),r=IE();function i(e,i=t.LongType.STRING){switch(e){case t.ScalarType.BOOL:return!1;case t.ScalarType.UINT64:case t.ScalarType.FIXED64:return n.reflectionLongConvert(r.PbULong.ZERO,i);case t.ScalarType.INT64:case t.ScalarType.SFIXED64:case t.ScalarType.SINT64:return n.reflectionLongConvert(r.PbLong.ZERO,i);case t.ScalarType.DOUBLE:case t.ScalarType.FLOAT:return 0;case t.ScalarType.BYTES:return new Uint8Array;case t.ScalarType.STRING:return``;default:return 0}}e.reflectionScalarDefault=i})),XE=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryReader=void 0;let t=PE(),n=UE(),r=KE(),i=YE();e.ReflectionBinaryReader=class{constructor(e){this.info=e}prepare(){if(!this.fieldNoToField){let e=this.info.fields??[];this.fieldNoToField=new Map(e.map(e=>[e.no,e]))}}read(e,r,i,a){this.prepare();let o=a===void 0?e.len:e.pos+a;for(;e.pos{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReflectionBinaryWriter=void 0;let t=PE(),n=UE(),r=RE(),i=IE();e.ReflectionBinaryWriter=class{constructor(e){this.info=e}prepare(){this.fields||=(this.info.fields?this.info.fields.concat():[]).sort((e,t)=>e.no-t.no)}write(e,i,a){this.prepare();for(let t of this.fields){let o,s,c=t.repeat,l=t.localName;if(t.oneof){let n=e[t.oneof];if(n.oneofKind!==l)continue;o=n[l],s=!0}else o=e[l],s=!1;switch(t.kind){case`scalar`:case`enum`:let e=t.kind==`enum`?n.ScalarType.INT32:t.T;if(c)if(r.assert(Array.isArray(o)),c==n.RepeatType.PACKED)this.packed(i,e,t.no,o);else for(let n of o)this.scalar(i,e,t.no,n,!0);else o===void 0?r.assert(t.opt):this.scalar(i,e,t.no,o,s||t.opt);break;case`message`:if(c){r.assert(Array.isArray(o));for(let e of o)this.message(i,a,t.T(),t.no,e)}else this.message(i,a,t.T(),t.no,o);break;case`map`:r.assert(typeof o==`object`&&!!o);for(let[e,n]of Object.entries(o))this.mapEntry(i,a,t,e,n);break}}let o=a.writeUnknownFields;o!==!1&&(o===!0?t.UnknownFieldHandler.onWrite:o)(this.info.typeName,e,i)}mapEntry(e,i,a,o,s){e.tag(a.no,t.WireType.LengthDelimited),e.fork();let c=o;switch(a.K){case n.ScalarType.INT32:case n.ScalarType.FIXED32:case n.ScalarType.UINT32:case n.ScalarType.SFIXED32:case n.ScalarType.SINT32:c=Number.parseInt(o);break;case n.ScalarType.BOOL:r.assert(o==`true`||o==`false`),c=o==`true`;break}switch(this.scalar(e,a.K,1,c,!0),a.V.kind){case`scalar`:this.scalar(e,a.V.T,2,s,!0);break;case`enum`:this.scalar(e,n.ScalarType.INT32,2,s,!0);break;case`message`:this.message(e,i,a.V.T(),2,s);break}e.join()}message(e,n,r,i,a){a!==void 0&&(r.internalBinaryWrite(a,e.tag(i,t.WireType.LengthDelimited).fork(),n),e.join())}scalar(e,t,n,r,i){let[a,o,s]=this.scalarInfo(t,r);(!s||i)&&(e.tag(n,a),e[o](r))}packed(e,i,a,o){if(!o.length)return;r.assert(i!==n.ScalarType.BYTES&&i!==n.ScalarType.STRING),e.tag(a,t.WireType.LengthDelimited),e.fork();let[,s]=this.scalarInfo(i);for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionCreate=void 0;let t=YE(),n=VE();function r(e){let r=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},n.MESSAGE_TYPE,{value:e});for(let n of e.fields){let e=n.localName;if(!n.opt)if(n.oneof)r[n.oneof]={oneofKind:void 0};else if(n.repeat)r[e]=[];else switch(n.kind){case`scalar`:r[e]=t.reflectionScalarDefault(n.T,n.L);break;case`enum`:r[e]=0;break;case`map`:r[e]={};break}}return r}e.reflectionCreate=r})),$E=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionMergePartial=void 0;function t(e,t,n){let r,i=n,a;for(let n of e.fields){let e=n.localName;if(n.oneof){let o=i[n.oneof];if(o?.oneofKind==null)continue;if(r=o[e],a=t[n.oneof],a.oneofKind=o.oneofKind,r==null){delete a[e];continue}}else if(r=i[e],a=t,r==null)continue;switch(n.repeat&&(a[e].length=r.length),n.kind){case`scalar`:case`enum`:if(n.repeat)for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0}),e.reflectionEquals=void 0;let t=UE();function n(e,n,s){if(n===s)return!0;if(!n||!s)return!1;for(let c of e.fields){let e=c.localName,l=c.oneof?n[c.oneof][e]:n[e],u=c.oneof?s[c.oneof][e]:s[e];switch(c.kind){case`enum`:case`scalar`:let e=c.kind==`enum`?t.ScalarType.INT32:c.T;if(!(c.repeat?a(e,l,u):i(e,l,u)))return!1;break;case`map`:if(!(c.V.kind==`message`?o(c.V.T(),r(l),r(u)):a(c.V.kind==`enum`?t.ScalarType.INT32:c.V.T,r(l),r(u))))return!1;break;case`message`:let n=c.T();if(!(c.repeat?o(n,l,u):n.equals(l,u)))return!1;break}}return!0}e.reflectionEquals=n;let r=Object.values;function i(e,n,r){if(n===r)return!0;if(e!==t.ScalarType.BYTES)return!1;let i=n,a=r;if(i.length!==a.length)return!1;for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.MessageType=void 0;let t=VE(),n=UE(),r=GE(),i=qE(),a=JE(),o=XE(),s=ZE(),c=QE(),l=$E(),u=jE(),d=BE(),f=eD(),p=zE(),m=LE(),h=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),g=h[t.MESSAGE_TYPE]={};e.MessageType=class{constructor(e,t,c){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(n.normalizeFieldInfo),this.options=c??{},g.value=this,this.messagePrototype=Object.create(null,h),this.refTypeCheck=new r.ReflectionTypeCheck(this),this.refJsonReader=new i.ReflectionJsonReader(this),this.refJsonWriter=new a.ReflectionJsonWriter(this),this.refBinReader=new o.ReflectionBinaryReader(this),this.refBinWriter=new s.ReflectionBinaryWriter(this)}create(e){let t=c.reflectionCreate(this);return e!==void 0&&l.reflectionMergePartial(this,t,e),t}clone(e){let t=this.create();return l.reflectionMergePartial(this,t,e),t}equals(e,t){return f.reflectionEquals(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){l.reflectionMergePartial(this,e,t)}fromBinary(e,t){let n=m.binaryReadOptions(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}fromJson(e,t){return this.internalJsonRead(e,d.jsonReadOptions(t))}fromJsonString(e,t){let n=JSON.parse(e);return this.fromJson(n,t)}toJson(e,t){return this.internalJsonWrite(e,d.jsonWriteOptions(t))}toJsonString(e,t){let n=this.toJson(e,t);return JSON.stringify(n,null,t?.prettySpaces??0)}toBinary(e,t){let n=p.binaryWriteOptions(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}internalJsonRead(e,t,n){if(typeof e==`object`&&e&&!Array.isArray(e)){let r=n??this.create();return this.refJsonReader.read(e,r,t),r}throw Error(`Unable to parse message ${this.typeName} from JSON ${u.typeofJsonValue(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,n){return this.refBinWriter.write(e,t,n),t}internalBinaryRead(e,t,n,r){let i=r??this.create();return this.refBinReader.read(e,i,n,t),i}}})),nD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.containsMessageType=void 0;let t=VE();function n(e){return e[t.MESSAGE_TYPE]!=null}e.containsMessageType=n})),rD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.listEnumNumbers=e.listEnumNames=e.listEnumValues=e.isEnumObject=void 0;function t(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(0))return!1;for(let t of Object.keys(e)){let n=parseInt(t);if(Number.isNaN(n)){let n=e[t];if(n===void 0||typeof n!=`number`||e[n]===void 0)return!1}else{let t=e[n];if(t===void 0||e[t]!==n)return!1}}return!0}e.isEnumObject=t;function n(e){if(!t(e))throw Error(`not a typescript enum object`);let n=[];for(let[t,r]of Object.entries(e))typeof r==`number`&&n.push({name:t,number:r});return n}e.listEnumValues=n;function r(e){return n(e).map(e=>e.name)}e.listEnumNames=r;function i(e){return n(e).map(e=>e.number).filter((e,t,n)=>n.indexOf(e)==t)}e.listEnumNumbers=i})),iD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=jE();Object.defineProperty(e,`typeofJsonValue`,{enumerable:!0,get:function(){return t.typeofJsonValue}}),Object.defineProperty(e,`isJsonObject`,{enumerable:!0,get:function(){return t.isJsonObject}});var n=ME();Object.defineProperty(e,`base64decode`,{enumerable:!0,get:function(){return n.base64decode}}),Object.defineProperty(e,`base64encode`,{enumerable:!0,get:function(){return n.base64encode}});var r=NE();Object.defineProperty(e,`utf8read`,{enumerable:!0,get:function(){return r.utf8read}});var i=PE();Object.defineProperty(e,`WireType`,{enumerable:!0,get:function(){return i.WireType}}),Object.defineProperty(e,`mergeBinaryOptions`,{enumerable:!0,get:function(){return i.mergeBinaryOptions}}),Object.defineProperty(e,`UnknownFieldHandler`,{enumerable:!0,get:function(){return i.UnknownFieldHandler}});var a=LE();Object.defineProperty(e,`BinaryReader`,{enumerable:!0,get:function(){return a.BinaryReader}}),Object.defineProperty(e,`binaryReadOptions`,{enumerable:!0,get:function(){return a.binaryReadOptions}});var o=zE();Object.defineProperty(e,`BinaryWriter`,{enumerable:!0,get:function(){return o.BinaryWriter}}),Object.defineProperty(e,`binaryWriteOptions`,{enumerable:!0,get:function(){return o.binaryWriteOptions}});var s=IE();Object.defineProperty(e,`PbLong`,{enumerable:!0,get:function(){return s.PbLong}}),Object.defineProperty(e,`PbULong`,{enumerable:!0,get:function(){return s.PbULong}});var c=BE();Object.defineProperty(e,`jsonReadOptions`,{enumerable:!0,get:function(){return c.jsonReadOptions}}),Object.defineProperty(e,`jsonWriteOptions`,{enumerable:!0,get:function(){return c.jsonWriteOptions}}),Object.defineProperty(e,`mergeJsonOptions`,{enumerable:!0,get:function(){return c.mergeJsonOptions}});var l=VE();Object.defineProperty(e,`MESSAGE_TYPE`,{enumerable:!0,get:function(){return l.MESSAGE_TYPE}});var u=tD();Object.defineProperty(e,`MessageType`,{enumerable:!0,get:function(){return u.MessageType}});var d=UE();Object.defineProperty(e,`ScalarType`,{enumerable:!0,get:function(){return d.ScalarType}}),Object.defineProperty(e,`LongType`,{enumerable:!0,get:function(){return d.LongType}}),Object.defineProperty(e,`RepeatType`,{enumerable:!0,get:function(){return d.RepeatType}}),Object.defineProperty(e,`normalizeFieldInfo`,{enumerable:!0,get:function(){return d.normalizeFieldInfo}}),Object.defineProperty(e,`readFieldOptions`,{enumerable:!0,get:function(){return d.readFieldOptions}}),Object.defineProperty(e,`readFieldOption`,{enumerable:!0,get:function(){return d.readFieldOption}}),Object.defineProperty(e,`readMessageOption`,{enumerable:!0,get:function(){return d.readMessageOption}});var f=GE();Object.defineProperty(e,`ReflectionTypeCheck`,{enumerable:!0,get:function(){return f.ReflectionTypeCheck}});var p=QE();Object.defineProperty(e,`reflectionCreate`,{enumerable:!0,get:function(){return p.reflectionCreate}});var m=YE();Object.defineProperty(e,`reflectionScalarDefault`,{enumerable:!0,get:function(){return m.reflectionScalarDefault}});var h=$E();Object.defineProperty(e,`reflectionMergePartial`,{enumerable:!0,get:function(){return h.reflectionMergePartial}});var g=eD();Object.defineProperty(e,`reflectionEquals`,{enumerable:!0,get:function(){return g.reflectionEquals}});var v=XE();Object.defineProperty(e,`ReflectionBinaryReader`,{enumerable:!0,get:function(){return v.ReflectionBinaryReader}});var y=ZE();Object.defineProperty(e,`ReflectionBinaryWriter`,{enumerable:!0,get:function(){return y.ReflectionBinaryWriter}});var b=qE();Object.defineProperty(e,`ReflectionJsonReader`,{enumerable:!0,get:function(){return b.ReflectionJsonReader}});var x=JE();Object.defineProperty(e,`ReflectionJsonWriter`,{enumerable:!0,get:function(){return x.ReflectionJsonWriter}});var S=nD();Object.defineProperty(e,`containsMessageType`,{enumerable:!0,get:function(){return S.containsMessageType}});var C=WE();Object.defineProperty(e,`isOneofGroup`,{enumerable:!0,get:function(){return C.isOneofGroup}}),Object.defineProperty(e,`setOneofValue`,{enumerable:!0,get:function(){return C.setOneofValue}}),Object.defineProperty(e,`getOneofValue`,{enumerable:!0,get:function(){return C.getOneofValue}}),Object.defineProperty(e,`clearOneofValue`,{enumerable:!0,get:function(){return C.clearOneofValue}}),Object.defineProperty(e,`getSelectedOneofValue`,{enumerable:!0,get:function(){return C.getSelectedOneofValue}});var w=rD();Object.defineProperty(e,`listEnumValues`,{enumerable:!0,get:function(){return w.listEnumValues}}),Object.defineProperty(e,`listEnumNames`,{enumerable:!0,get:function(){return w.listEnumNames}}),Object.defineProperty(e,`listEnumNumbers`,{enumerable:!0,get:function(){return w.listEnumNumbers}}),Object.defineProperty(e,`isEnumObject`,{enumerable:!0,get:function(){return w.isEnumObject}});var T=HE();Object.defineProperty(e,`lowerCamelCase`,{enumerable:!0,get:function(){return T.lowerCamelCase}});var E=RE();Object.defineProperty(e,`assert`,{enumerable:!0,get:function(){return E.assert}}),Object.defineProperty(e,`assertNever`,{enumerable:!0,get:function(){return E.assertNever}}),Object.defineProperty(e,`assertInt32`,{enumerable:!0,get:function(){return E.assertInt32}}),Object.defineProperty(e,`assertUInt32`,{enumerable:!0,get:function(){return E.assertUInt32}}),Object.defineProperty(e,`assertFloat32`,{enumerable:!0,get:function(){return E.assertFloat32}})})),aD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readServiceOption=e.readMethodOption=e.readMethodOptions=e.normalizeMethodInfo=void 0;let t=iD();function n(e,n){let r=e;return r.service=n,r.localName=r.localName??t.lowerCamelCase(r.name),r.serverStreaming=!!r.serverStreaming,r.clientStreaming=!!r.clientStreaming,r.options=r.options??{},r.idempotency=r.idempotency??void 0,r}e.normalizeMethodInfo=n;function r(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;return i&&i[n]?r.fromJson(i[n]):void 0}e.readMethodOptions=r;function i(e,t,n,r){let i=e.methods.find((e,n)=>e.localName===t||n===t)?.options;if(!i)return;let a=i[n];return a===void 0?a:r?r.fromJson(a):a}e.readMethodOption=i;function a(e,t,n){let r=e.options;if(!r)return;let i=r[t];return i===void 0?i:n?n.fromJson(i):i}e.readServiceOption=a})),oD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServiceType=void 0;let t=aD();e.ServiceType=class{constructor(e,n,r){this.typeName=e,this.methods=n.map(e=>t.normalizeMethodInfo(e,this)),this.options=r??{}}}})),sD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcError=void 0,e.RpcError=class extends Error{constructor(e,t=`UNKNOWN`,n){super(e),this.name=`RpcError`,Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.meta=n??{}}toString(){let e=[this.name+`: `+this.message];this.code&&(e.push(``),e.push(`Code: `+this.code)),this.serviceName&&this.methodName&&e.push(`Method: `+this.serviceName+`/`+this.methodName);let t=Object.entries(this.meta);if(t.length){e.push(``),e.push(`Meta:`);for(let[n,r]of t)e.push(` ${n}: ${r}`)}return e.join(` +`)}}})),cD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeRpcOptions=void 0;let t=iD();function n(e,n){if(!n)return e;let i={};r(e,i),r(n,i);for(let a of Object.keys(n)){let o=n[a];switch(a){case`jsonOptions`:i.jsonOptions=t.mergeJsonOptions(e.jsonOptions,i.jsonOptions);break;case`binaryOptions`:i.binaryOptions=t.mergeBinaryOptions(e.binaryOptions,i.binaryOptions);break;case`meta`:i.meta={},r(e.meta,i.meta),r(n.meta,i.meta);break;case`interceptors`:i.interceptors=e.interceptors?e.interceptors.concat(o):o.concat();break}}return i}e.mergeRpcOptions=n;function r(e,t){if(!e)return;let n=t;for(let[t,r]of Object.entries(e))r instanceof Date?n[t]=new Date(r.getTime()):Array.isArray(r)?n[t]=r.concat():n[t]=r}})),lD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Deferred=e.DeferredState=void 0;var t;(function(e){e[e.PENDING=0]=`PENDING`,e[e.REJECTED=1]=`REJECTED`,e[e.RESOLVED=2]=`RESOLVED`})(t=e.DeferredState||={}),e.Deferred=class{constructor(e=!0){this._state=t.PENDING,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),e&&this._promise.catch(e=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==t.PENDING)throw Error(`cannot resolve ${t[this.state].toLowerCase()}`);this._resolve(e),this._state=t.RESOLVED}reject(e){if(this.state!==t.PENDING)throw Error(`cannot reject ${t[this.state].toLowerCase()}`);this._reject(e),this._state=t.REJECTED}resolvePending(e){this._state===t.PENDING&&this.resolve(e)}rejectPending(e){this._state===t.PENDING&&this.reject(e)}}})),uD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RpcOutputStreamController=void 0;let t=lD(),n=iD();e.RpcOutputStreamController=class{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(e){return this.addLis(e,this._lis.nxt)}onMessage(e){return this.addLis(e,this._lis.msg)}onError(e){return this.addLis(e,this._lis.err)}onComplete(e){return this.addLis(e,this._lis.cmp)}addLis(e,t){return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,t,r){n.assert((e?1:0)+(t?1:0)+(r?1:0)<=1,`only one emission at a time`),e&&this.notifyMessage(e),t&&this.notifyError(t),r&&this.notifyComplete()}notifyMessage(e){n.assert(!this.closed,`stream is closed`),this.pushIt({value:e,done:!1}),this._lis.msg.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(e,void 0,!1))}notifyError(e){n.assert(!this.closed,`stream is closed`),this._closed=e,this.pushIt(e),this._lis.err.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(void 0,e,!1)),this.clearLis()}notifyComplete(){n.assert(!this.closed,`stream is closed`),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(e=>e()),this._lis.nxt.forEach(e=>e(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let e=this._itState;n.assert(e,`bad state`),n.assert(!e.p,`iterator contract broken`);let r=e.q.shift();return r?`value`in r?Promise.resolve(r):Promise.reject(r):(e.p=new t.Deferred,e.p.promise)}}}pushIt(e){let r=this._itState;if(r.p){let i=r.p;n.assert(i.state==t.DeferredState.PENDING,`iterator contract broken`),`value`in e?i.resolve(e):i.reject(e),delete r.p}else r.q.push(e)}}})),dD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.UnaryCall=void 0,e.UnaryCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:t,status:n,trailers:r}})}}})),fD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerStreamingCall=void 0,e.ServerStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,status:t,trailers:n}})}}})),pD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientStreamingCall=void 0,e.ClientStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,response:t,status:n,trailers:r}})}}})),mD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.DuplexStreamingCall=void 0,e.DuplexStreamingCall=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.requests=n,this.headers=r,this.responses=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return t(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,status:t,trailers:n}})}}})),hD=U((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.TestTransport=void 0;let n=sD(),r=iD(),i=uD(),a=cD(),o=dD(),s=fD(),c=pD(),l=mD();var u=class e{constructor(e){this.suppressUncaughtRejections=!0,this.headerDelay=10,this.responseDelay=50,this.betweenResponseDelay=10,this.afterResponseDelay=10,this.data=e??{}}get sentMessages(){return this.lastInput instanceof f?this.lastInput.sent:typeof this.lastInput==`object`?[this.lastInput.single]:[]}get sendComplete(){return this.lastInput instanceof f?this.lastInput.completed:typeof this.lastInput==`object`}promiseHeaders(){let t=this.data.headers??e.defaultHeaders;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseSingleResponse(e){if(this.data.response instanceof n.RpcError)return Promise.reject(this.data.response);let t;return Array.isArray(this.data.response)?(r.assert(this.data.response.length>0),t=this.data.response[0]):t=this.data.response===void 0?e.O.create():this.data.response,r.assert(e.O.is(t)),Promise.resolve(t)}streamResponses(e,i,a){return t(this,void 0,void 0,function*(){let t=[];if(this.data.response===void 0)t.push(e.O.create());else if(Array.isArray(this.data.response))for(let n of this.data.response)r.assert(e.O.is(n)),t.push(n);else this.data.response instanceof n.RpcError||(r.assert(e.O.is(this.data.response)),t.push(this.data.response));try{yield d(this.responseDelay,a)(void 0)}catch(e){i.notifyError(e);return}if(this.data.response instanceof n.RpcError){i.notifyError(this.data.response);return}for(let e of t){i.notifyMessage(e);try{yield d(this.betweenResponseDelay,a)(void 0)}catch(e){i.notifyError(e);return}}if(this.data.status instanceof n.RpcError){i.notifyError(this.data.status);return}if(this.data.trailers instanceof n.RpcError){i.notifyError(this.data.trailers);return}i.notifyComplete()})}promiseStatus(){let t=this.data.status??e.defaultStatus;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}promiseTrailers(){let t=this.data.trailers??e.defaultTrailers;return t instanceof n.RpcError?Promise.reject(t):Promise.resolve(t)}maybeSuppressUncaught(...e){if(this.suppressUncaughtRejections)for(let t of e)t.catch(()=>{})}mergeOptions(e){return a.mergeRpcOptions({},e)}unary(e,t,n){let r=n.meta??{},i=this.promiseHeaders().then(d(this.headerDelay,n.abort)),a=i.catch(e=>{}).then(d(this.responseDelay,n.abort)).then(t=>this.promiseSingleResponse(e)),s=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseStatus()),c=a.catch(e=>{}).then(d(this.afterResponseDelay,n.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput={single:t},new o.UnaryCall(e,r,t,i,a,s,c)}serverStreaming(e,t,n){let r=n.meta??{},a=this.promiseHeaders().then(d(this.headerDelay,n.abort)),o=new i.RpcOutputStreamController,c=a.then(d(this.responseDelay,n.abort)).catch(()=>{}).then(()=>this.streamResponses(e,o,n.abort)).then(d(this.afterResponseDelay,n.abort)),l=c.then(()=>this.promiseStatus()),u=c.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(l,u),this.lastInput={single:t},new s.ServerStreamingCall(e,r,t,a,o,l,u)}clientStreaming(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),i=r.catch(e=>{}).then(d(this.responseDelay,t.abort)).then(t=>this.promiseSingleResponse(e)),a=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseStatus()),o=i.catch(e=>{}).then(d(this.afterResponseDelay,t.abort)).then(e=>this.promiseTrailers());return this.maybeSuppressUncaught(a,o),this.lastInput=new f(this.data,t.abort),new c.ClientStreamingCall(e,n,this.lastInput,r,i,a,o)}duplex(e,t){let n=t.meta??{},r=this.promiseHeaders().then(d(this.headerDelay,t.abort)),a=new i.RpcOutputStreamController,o=r.then(d(this.responseDelay,t.abort)).catch(()=>{}).then(()=>this.streamResponses(e,a,t.abort)).then(d(this.afterResponseDelay,t.abort)),s=o.then(()=>this.promiseStatus()),c=o.then(()=>this.promiseTrailers());return this.maybeSuppressUncaught(s,c),this.lastInput=new f(this.data,t.abort),new l.DuplexStreamingCall(e,n,this.lastInput,r,a,s,c)}};e.TestTransport=u,u.defaultHeaders={responseHeader:`test`},u.defaultStatus={code:`OK`,detail:`all good`},u.defaultTrailers={responseTrailer:`test`};function d(e,t){return r=>new Promise((i,a)=>{if(t?.aborted)a(new n.RpcError(`user cancel`,`CANCELLED`));else{let o=setTimeout(()=>i(r),e);t&&t.addEventListener(`abort`,e=>{clearTimeout(o),a(new n.RpcError(`user cancel`,`CANCELLED`))})}})}var f=class{constructor(e,t){this._completed=!1,this._sent=[],this.data=e,this.abort=t}get sent(){return this._sent}get completed(){return this._completed}send(e){if(this.data.inputMessage instanceof n.RpcError)return Promise.reject(this.data.inputMessage);let t=this.data.inputMessage===void 0?10:this.data.inputMessage;return Promise.resolve(void 0).then(()=>{this._sent.push(e)}).then(d(t,this.abort))}complete(){if(this.data.inputComplete instanceof n.RpcError)return Promise.reject(this.data.inputComplete);let e=this.data.inputComplete===void 0?10:this.data.inputComplete;return Promise.resolve(void 0).then(()=>{this._completed=!0}).then(d(e,this.abort))}}})),gD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stackDuplexStreamingInterceptors=e.stackClientStreamingInterceptors=e.stackServerStreamingInterceptors=e.stackUnaryInterceptors=e.stackIntercept=void 0;let t=iD();function n(e,n,r,i,a){if(e==`unary`){let e=(e,t,r)=>n.unary(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptUnary).reverse()){let n=e;e=(e,r,i)=>t.interceptUnary(n,e,r,i)}return e(r,a,i)}if(e==`serverStreaming`){let e=(e,t,r)=>n.serverStreaming(e,t,r);for(let t of(i.interceptors??[]).filter(e=>e.interceptServerStreaming).reverse()){let n=e;e=(e,r,i)=>t.interceptServerStreaming(n,e,r,i)}return e(r,a,i)}if(e==`clientStreaming`){let e=(e,t)=>n.clientStreaming(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptClientStreaming).reverse()){let n=e;e=(e,r)=>t.interceptClientStreaming(n,e,r)}return e(r,i)}if(e==`duplex`){let e=(e,t)=>n.duplex(e,t);for(let t of(i.interceptors??[]).filter(e=>e.interceptDuplex).reverse()){let n=e;e=(e,r)=>t.interceptDuplex(n,e,r)}return e(r,i)}t.assertNever(e)}e.stackIntercept=n;function r(e,t,r,i){return n(`unary`,e,t,i,r)}e.stackUnaryInterceptors=r;function i(e,t,r,i){return n(`serverStreaming`,e,t,i,r)}e.stackServerStreamingInterceptors=i;function a(e,t,r){return n(`clientStreaming`,e,t,r)}e.stackClientStreamingInterceptors=a;function o(e,t,r){return n(`duplex`,e,t,r)}e.stackDuplexStreamingInterceptors=o})),_D=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerCallContextController=void 0,e.ServerCallContextController=class{constructor(e,t,n,r,i={code:`OK`,detail:``}){this._cancelled=!1,this._listeners=[],this.method=e,this.headers=t,this.deadline=n,this.trailers={},this._sendRH=r,this.status=i}notifyCancelled(){if(!this._cancelled){this._cancelled=!0;for(let e of this._listeners)e()}}sendResponseHeaders(e){this._sendRH(e)}get cancelled(){return this._cancelled}onCancel(e){let t=this._listeners;return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}}})),vD=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oD();Object.defineProperty(e,`ServiceType`,{enumerable:!0,get:function(){return t.ServiceType}});var n=aD();Object.defineProperty(e,`readMethodOptions`,{enumerable:!0,get:function(){return n.readMethodOptions}}),Object.defineProperty(e,`readMethodOption`,{enumerable:!0,get:function(){return n.readMethodOption}}),Object.defineProperty(e,`readServiceOption`,{enumerable:!0,get:function(){return n.readServiceOption}});var r=sD();Object.defineProperty(e,`RpcError`,{enumerable:!0,get:function(){return r.RpcError}});var i=cD();Object.defineProperty(e,`mergeRpcOptions`,{enumerable:!0,get:function(){return i.mergeRpcOptions}});var a=uD();Object.defineProperty(e,`RpcOutputStreamController`,{enumerable:!0,get:function(){return a.RpcOutputStreamController}});var o=hD();Object.defineProperty(e,`TestTransport`,{enumerable:!0,get:function(){return o.TestTransport}});var s=lD();Object.defineProperty(e,`Deferred`,{enumerable:!0,get:function(){return s.Deferred}}),Object.defineProperty(e,`DeferredState`,{enumerable:!0,get:function(){return s.DeferredState}});var c=mD();Object.defineProperty(e,`DuplexStreamingCall`,{enumerable:!0,get:function(){return c.DuplexStreamingCall}});var l=pD();Object.defineProperty(e,`ClientStreamingCall`,{enumerable:!0,get:function(){return l.ClientStreamingCall}});var u=fD();Object.defineProperty(e,`ServerStreamingCall`,{enumerable:!0,get:function(){return u.ServerStreamingCall}});var d=dD();Object.defineProperty(e,`UnaryCall`,{enumerable:!0,get:function(){return d.UnaryCall}});var f=gD();Object.defineProperty(e,`stackIntercept`,{enumerable:!0,get:function(){return f.stackIntercept}}),Object.defineProperty(e,`stackDuplexStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackDuplexStreamingInterceptors}}),Object.defineProperty(e,`stackClientStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackClientStreamingInterceptors}}),Object.defineProperty(e,`stackServerStreamingInterceptors`,{enumerable:!0,get:function(){return f.stackServerStreamingInterceptors}}),Object.defineProperty(e,`stackUnaryInterceptors`,{enumerable:!0,get:function(){return f.stackUnaryInterceptors}});var p=_D();Object.defineProperty(e,`ServerCallContextController`,{enumerable:!0,get:function(){return p.ServerCallContextController}})})),$=iD();const yD=new class extends $.MessageType{constructor(){super(`github.actions.results.entities.v1.CacheScope`,[{no:1,name:`scope`,kind:`scalar`,T:9},{no:2,name:`permission`,kind:`scalar`,T:3}])}create(e){let t={scope:``,permission:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posyD}])}create(e){let t={repositoryId:`0`,scope:[]};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posbD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posbD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`size_bytes`,kind:`scalar`,T:3},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,sizeBytes:`0`,version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posbD},{no:2,name:`key`,kind:`scalar`,T:9},{no:3,name:`restore_keys`,kind:`scalar`,repeat:2,T:9},{no:4,name:`version`,kind:`scalar`,T:9}])}create(e){let t={key:``,restoreKeys:[],version:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posCD.fromJson(e,{ignoreUnknownFields:!0}))}FinalizeCacheEntryUpload(e){let t=wD.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`FinalizeCacheEntryUpload`,`application/json`,t).then(e=>TD.fromJson(e,{ignoreUnknownFields:!0}))}GetCacheEntryDownloadURL(e){let t=ED.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.CacheService`,`GetCacheEntryDownloadURL`,`application/json`,t).then(e=>DD.fromJson(e,{ignoreUnknownFields:!0}))}};function kD(e){if(e)try{let t=new URL(e).searchParams.get(`sig`);t&&(Cr(t),Cr(encodeURIComponent(t)))}catch(t){G(`Failed to parse URL: ${e} ${t instanceof Error?t.message:String(t)}`)}}function AD(e){if(typeof e!=`object`||!e){G(`body is not an object or is null`);return}`signed_upload_url`in e&&typeof e.signed_upload_url==`string`&&kD(e.signed_upload_url),`signed_download_url`in e&&typeof e.signed_download_url==`string`&&kD(e.signed_download_url)}var jD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},MD=class{constructor(e,t,n,r){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let i=sc();this.baseUrl=pE(),t&&(this.maxAttempts=t),n&&(this.baseRetryIntervalMilliseconds=n),r&&(this.retryMultiplier=r),this.httpClient=new On(e,[new jn(i)])}request(e,t,n,r){return jD(this,void 0,void 0,function*(){let i=new URL(`/twirp/${e}/${t}`,this.baseUrl).href;G(`[Request] ${t} ${i}`);let a={"Content-Type":n};try{let{body:e}=yield this.retryableRequest(()=>jD(this,void 0,void 0,function*(){return this.httpClient.post(i,JSON.stringify(r),a)}));return e}catch(e){throw Error(`Failed to ${t}: ${e.message}`)}})}retryableRequest(e){return jD(this,void 0,void 0,function*(){let t=0,n=``,r=``;for(;t0&&Ar(`You've hit a rate limit, your rate limit will reset in ${t} seconds`)}throw new HT(`Rate limited: ${n}`)}}catch(e){if(e instanceof SyntaxError&&G(`Raw Body: ${r}`),e instanceof VT||e instanceof HT)throw e;if(BT.isNetworkErrorCode(e?.code))throw new BT(e?.code);i=!0,n=e.message}if(!i)throw Error(`Received non-retryable error: ${n}`);if(t+1===this.maxAttempts)throw Error(`Failed to make request after ${this.maxAttempts} attempts: ${n}`);let a=this.getExponentialRetryTimeMilliseconds(t);jr(`Attempt ${t+1} of ${this.maxAttempts} failed with error: ${n}. Retrying request in ${a} ms...`),yield this.sleep(a),t++}throw Error(`Request failed`)})}isSuccessStatusCode(e){return e?e>=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[bn.BadGateway,bn.GatewayTimeout,bn.InternalServerError,bn.ServiceUnavailable].includes(e):!1}sleep(e){return jD(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw Error(`attempt should be a positive integer`);if(e===0)return this.baseRetryIntervalMilliseconds;let t=this.baseRetryIntervalMilliseconds*this.retryMultiplier**+e,n=t*this.retryMultiplier;return Math.trunc(Math.random()*(n-t)+t)}};function ND(e){return new OD(new MD(gE(),e?.maxAttempts,e?.retryIntervalMs,e?.retryMultiplier))}var PD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const FD=process.platform===`win32`;function ID(){return PD(this,void 0,void 0,function*(){switch(process.platform){case`win32`:{let e=yield ic(),t=Gs;if(e)return{path:e,type:Vs.GNU};if(c(t))return{path:t,type:Vs.BSD};break}case`darwin`:{let e=yield cr(`gtar`,!1);return e?{path:e,type:Vs.GNU}:{path:yield cr(`tar`,!0),type:Vs.BSD}}default:break}return{path:yield cr(`tar`,!0),type:Vs.GNU}})}function LD(e,t,n){return PD(this,arguments,void 0,function*(e,t,n,r=``){let i=[`"${e.path}"`],a=rc(t),o=`cache.tar`,s=zD(),c=e.type===Vs.BSD&&t!==Bs.Gzip&&FD;switch(n){case`create`:i.push(`--posix`,`-cf`,c?o:a.replace(RegExp(`\\${f.sep}`,`g`),`/`),`--exclude`,c?o:a.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${f.sep}`,`g`),`/`),`--files-from`,qs);break;case`extract`:i.push(`-xf`,c?o:r.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`,`-C`,s.replace(RegExp(`\\${f.sep}`,`g`),`/`));break;case`list`:i.push(`-tf`,c?o:r.replace(RegExp(`\\${f.sep}`,`g`),`/`),`-P`);break}if(e.type===Vs.GNU)switch(process.platform){case`win32`:i.push(`--force-local`);break;case`darwin`:i.push(`--delay-directory-restore`);break}return i})}function RD(e,t){return PD(this,arguments,void 0,function*(e,t,n=``){let r,i=yield ID(),a=yield LD(i,e,t,n),o=t===`create`?yield VD(i,e):yield BD(i,e,n),s=i.type===Vs.BSD&&e!==Bs.Gzip&&FD;return r=s&&t!==`create`?[[...o].join(` `),[...a].join(` `)]:[[...a].join(` `),[...o].join(` `)],s?r:[r.join(` `)]})}function zD(){return process.env.GITHUB_WORKSPACE??process.cwd()}function BD(e,t,n){return PD(this,void 0,void 0,function*(){let r=e.type===Vs.BSD&&t!==Bs.Gzip&&FD;switch(t){case Bs.Zstd:return r?[`zstd -d --long=30 --force -o`,Ks,n.replace(RegExp(`\\${f.sep}`,`g`),`/`)]:[`--use-compress-program`,FD?`"zstd -d --long=30"`:`unzstd --long=30`];case Bs.ZstdWithoutLong:return r?[`zstd -d --force -o`,Ks,n.replace(RegExp(`\\${f.sep}`,`g`),`/`)]:[`--use-compress-program`,FD?`"zstd -d"`:`unzstd`];default:return[`-z`]}})}function VD(e,t){return PD(this,void 0,void 0,function*(){let n=rc(t),r=e.type===Vs.BSD&&t!==Bs.Gzip&&FD;switch(t){case Bs.Zstd:return r?[`zstd -T0 --long=30 --force -o`,n.replace(RegExp(`\\${f.sep}`,`g`),`/`),Ks]:[`--use-compress-program`,FD?`"zstd -T0 --long=30"`:`zstdmt --long=30`];case Bs.ZstdWithoutLong:return r?[`zstd -T0 --force -o`,n.replace(RegExp(`\\${f.sep}`,`g`),`/`),Ks]:[`--use-compress-program`,FD?`"zstd -T0"`:`zstdmt`];default:return[`-z`]}})}function HD(e,t){return PD(this,void 0,void 0,function*(){for(let n of e)try{yield yr(n,void 0,{cwd:t,env:Object.assign(Object.assign({},process.env),{MSYS:`winsymlinks:nativestrict`})})}catch(e){throw Error(`${n.split(` `)[0]} failed with error: ${e?.message}`)}})}function UD(e,t){return PD(this,void 0,void 0,function*(){yield HD(yield RD(t,`list`,e))})}function WD(e,t){return PD(this,void 0,void 0,function*(){yield sr(zD()),yield HD(yield RD(t,`extract`,e))})}function GD(e,t,n){return PD(this,void 0,void 0,function*(){d(f.join(e,qs),t.join(` +`)),yield HD(yield RD(n,`create`),e)})}var KD=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},qD=class e extends Error{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}},JD=class e extends Error{constructor(t){super(t),this.name=`ReserveCacheError`,Object.setPrototypeOf(this,e.prototype)}},YD=class e extends Error{constructor(t){super(t),this.name=`FinalizeCacheError`,Object.setPrototypeOf(this,e.prototype)}};function XD(e){if(!e||e.length===0)throw new qD(`Path Validation Error: At least one directory or file path is required`)}function ZD(e){if(e.length>512)throw new qD(`Key Validation Error: ${e} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(e))throw new qD(`Key Validation Error: ${e} cannot contain commas.`)}function QD(e,t,n,r){return KD(this,arguments,void 0,function*(e,t,n,r,i=!1){let a=fE();switch(G(`Cache service version: ${a}`),XD(e),a){case`v2`:return yield eO(e,t,n,r,i);default:return yield $D(e,t,n,r,i)}})}function $D(e,t,n,r){return KD(this,arguments,void 0,function*(e,t,n,r,i=!1){n||=[];let a=[t,...n];if(G(`Resolved Keys:`),G(JSON.stringify(a)),a.length>10)throw new qD(`Key Validation Error: Keys are limited to a maximum of 10.`);for(let e of a)ZD(e);let o=yield nc(),s=``;try{let t=yield SE(a,e,{compressionMethod:o,enableCrossOsArchive:i});if(!t?.archiveLocation)return;if(r?.lookupOnly)return jr(`Lookup only - skipping download`),t.cacheKey;s=f.join(yield Zs(),rc(o)),G(`Archive Path: ${s}`),yield wE(t.archiveLocation,s,r),Or()&&(yield UD(s,o));let n=Qs(s);return jr(`Cache Size: ~${Math.round(n/(1024*1024))} MB (${n} B)`),yield WD(s,o),jr(`Cache restored successfully`),t.cacheKey}catch(e){let t=e;if(t.name===qD.name)throw e;t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to restore: ${e.message}`):Ar(`Failed to restore: ${e.message}`)}finally{try{yield ec(s)}catch(e){G(`Failed to delete archive: ${e}`)}}})}function eO(e,t,n,r){return KD(this,arguments,void 0,function*(e,t,n,r,i=!1){r=Object.assign(Object.assign({},r),{useAzureSdk:!0}),n||=[];let a=[t,...n];if(G(`Resolved Keys:`),G(JSON.stringify(a)),a.length>10)throw new qD(`Key Validation Error: Keys are limited to a maximum of 10.`);for(let e of a)ZD(e);let o=``;try{let s=ND(),c=yield nc(),l={key:t,restoreKeys:n,version:oc(e,c,i)},u=yield s.GetCacheEntryDownloadURL(l);if(!u.ok){G(`Cache not found for version ${l.version} of keys: ${a.join(`, `)}`);return}if(l.key===u.matchedKey?jr(`Cache hit for: ${u.matchedKey}`):jr(`Cache hit for restore-key: ${u.matchedKey}`),r?.lookupOnly)return jr(`Lookup only - skipping download`),u.matchedKey;o=f.join(yield Zs(),rc(c)),G(`Archive path: ${o}`),G(`Starting download of archive to: ${o}`),yield wE(u.signedDownloadUrl,o,r);let d=Qs(o);return jr(`Cache Size: ~${Math.round(d/(1024*1024))} MB (${d} B)`),Or()&&(yield UD(o,c)),yield WD(o,c),jr(`Cache restored successfully`),u.matchedKey}catch(e){let t=e;if(t.name===qD.name)throw e;t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to restore: ${e.message}`):Ar(`Failed to restore: ${e.message}`)}finally{try{o&&(yield ec(o))}catch(e){G(`Failed to delete archive: ${e}`)}}})}function tO(e,t,n){return KD(this,arguments,void 0,function*(e,t,n,r=!1){let i=fE();switch(G(`Cache service version: ${i}`),XD(e),ZD(t),i){case`v2`:return yield rO(e,t,n,r);default:return yield nO(e,t,n,r)}})}function nO(e,t,n){return KD(this,arguments,void 0,function*(e,t,n,r=!1){let i=yield nc(),a=-1,o=yield $s(e);if(G(`Cache Paths:`),G(`${JSON.stringify(o)}`),o.length===0)throw Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);let s=yield Zs(),c=f.join(s,rc(i));G(`Archive Path: ${c}`);try{yield GD(s,o,i),Or()&&(yield UD(c,i));let l=Qs(c);if(G(`File Size: ${l}`),l>10737418240&&!dE())throw Error(`Cache size of ~${Math.round(l/(1024*1024))} MB (${l} B) is over the 10GB limit, not saving cache.`);G(`Reserving Cache`);let u=yield TE(t,e,{compressionMethod:i,enableCrossOsArchive:r,cacheSize:l});if(u?.result?.cacheId)a=u?.result?.cacheId;else if(u?.statusCode===400)throw Error(u?.error?.message??`Cache size of ~${Math.round(l/(1024*1024))} MB (${l} B) is over the data cap limit, not saving cache.`);else throw new JD(`Unable to reserve cache with key ${t}, another job may be creating this cache. More details: ${u?.error?.message}`);G(`Saving Cache (ID: ${a})`),yield AE(a,c,``,n)}catch(e){let t=e;if(t.name===qD.name)throw e;t.name===JD.name?jr(`Failed to save: ${t.message}`):t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to save: ${t.message}`):Ar(`Failed to save: ${t.message}`)}finally{try{yield ec(c)}catch(e){G(`Failed to delete archive: ${e}`)}}return a})}function rO(e,t,n){return KD(this,arguments,void 0,function*(e,t,n,r=!1){n=Object.assign(Object.assign({},n),{uploadChunkSize:64*1024*1024,uploadConcurrency:8,useAzureSdk:!0});let i=yield nc(),a=ND(),o=-1,s=yield $s(e);if(G(`Cache Paths:`),G(`${JSON.stringify(s)}`),s.length===0)throw Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);let c=yield Zs(),l=f.join(c,rc(i));G(`Archive Path: ${l}`);try{yield GD(c,s,i),Or()&&(yield UD(l,i));let u=Qs(l);G(`File Size: ${u}`),n.archiveSizeBytes=u,G(`Reserving Cache`);let d=oc(e,i,r),f={key:t,version:d},p;try{let e=yield a.CreateCacheEntry(f);if(!e.ok)throw e.message&&Ar(`Cache reservation failed: ${e.message}`),Error(e.message||`Response was not ok`);p=e.signedUploadUrl}catch(e){throw G(`Failed to reserve cache: ${e}`),new JD(`Unable to reserve cache with key ${t}, another job may be creating this cache.`)}G(`Attempting to upload cache located at: ${l}`),yield AE(o,l,p,n);let m={key:t,version:d,sizeBytes:`${u}`},h=yield a.FinalizeCacheEntryUpload(m);if(G(`FinalizeCacheEntryUploadResponse: ${h.ok}`),!h.ok)throw h.message?new YD(h.message):Error(`Unable to finalize cache with key ${t}, another job may be finalizing this cache.`);o=parseInt(h.entryId)}catch(e){let t=e;if(t.name===qD.name)throw e;t.name===JD.name?jr(`Failed to save: ${t.message}`):t.name===YD.name?Ar(t.message):t instanceof En&&typeof t.statusCode==`number`&&t.statusCode>=500?kr(`Failed to save: ${t.message}`):Ar(`Failed to save: ${t.message}`)}finally{try{yield ec(l)}catch(e){G(`Failed to delete archive: ${e}`)}}return o})}function iO(e){return e.replaceAll(`/`,`-`)}function aO(e){let{agentIdentity:t,repo:n,ref:r,os:i}=e;return`${Jr}-${t}-${iO(n)}-${r}-${i}`}function oO(e){let{agentIdentity:t,repo:n,ref:r}=e,i=iO(n);return[`${Jr}-${t}-${i}-${r}-`,`${Jr}-${t}-${i}-`]}function sO(e,t){return`${aO(e)}-${t}`}function cO(){return{agentIdentity:`github`,repo:ii(),ref:ai(),os:ri()}}function lO(){let e=t.env.XDG_DATA_HOME??F.join(I.homedir(),`.local`,`share`);return F.join(e,`opencode`,`opencode.db`)}async function uO(e){if(e!=null)return dO(e,`1.2.0`)>=0;try{return await P.access(lO()),!0}catch{return!1}}function dO(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}function fO(){return{restoreCache:async(e,t,n)=>QD(e,t,n),saveCache:async(e,t)=>tO(e,t)}}const pO=fO();async function mO(e,t,n){let r=[e];if(t!=null&&r.push(t),await uO(n??null)){let t=F.join(F.dirname(e),`opencode.db`);r.push(t)}return r}function hO(e,t){let n=F.resolve(e),r=F.resolve(t);return n.startsWith(r+F.sep)}async function gO(e,t,n){if(!hO(e,t)){n.debug(`auth.json is outside storage path - skipping deletion`,{authPath:e,storagePath:t});return}try{await P.unlink(e),n.debug(`Deleted auth.json from cache storage`)}catch(e){e.code!==`ENOENT`&&n.warning(`Failed to delete auth.json`,{error:Pr(e)})}}async function _O(e,t){try{return(await P.stat(e)).isDirectory()===!1?!0:(await P.readdir(e),!1)}catch{return t.debug(`Storage path not accessible - treating as corrupted`),!0}}async function vO(e,t){let n=F.join(e,`.version`);try{let e=await P.readFile(n,`utf8`),r=Number.parseInt(e.trim(),10);return r===1?!0:(t.info(`Storage version mismatch`,{expected:1,found:r}),!1)}catch{return t.debug(`No version file found - treating as compatible`),!0}}async function yO(e){try{await P.rm(e,{recursive:!0,force:!0}),await P.mkdir(e,{recursive:!0})}catch{}}async function bO(e){let{components:n,logger:r,storagePath:i,authPath:a,projectIdPath:o,opencodeVersion:s,cacheAdapter:c=pO}=e;if(t.env.SKIP_CACHE===`true`)return r.debug(`Skipping cache restore (SKIP_CACHE=true)`),await P.mkdir(i,{recursive:!0}),{hit:!1,key:null,restoredPath:null,corrupted:!1};let l=aO(n),u=oO(n),d=await mO(i,o,s);r.info(`Restoring cache`,{primaryKey:l,restoreKeys:[...u],paths:d});try{let e=await c.restoreCache(d,l,[...u]);return e==null?(r.info(`Cache miss - starting with fresh state`),await P.mkdir(i,{recursive:!0}),{hit:!1,key:null,restoredPath:null,corrupted:!1}):(r.info(`Cache restored`,{restoredKey:e}),await _O(i,r)===!0?(r.warning(`Cache corruption detected - proceeding with clean state`),await yO(i),{hit:!0,key:e,restoredPath:i,corrupted:!0}):await vO(i,r)===!1?(r.warning(`Storage version mismatch - proceeding with clean state`),await yO(i),{hit:!0,key:e,restoredPath:i,corrupted:!0}):(await gO(a,i,r),{hit:!0,key:e,restoredPath:i,corrupted:!1}))}catch(e){return r.warning(`Cache restore failed`,{error:Pr(e)}),{hit:!1,key:null,restoredPath:null,corrupted:!1}}}async function xO(e,t,n){let r=[e];if(t!=null&&r.push(t),await uO(n??null)){let t=F.join(F.dirname(e),`opencode.db`);r.push(t)}return r}async function SO(e,t,n){if(!hO(e,t)){n.debug(`auth.json is outside storage path - skipping deletion`,{authPath:e,storagePath:t});return}try{await P.unlink(e),n.debug(`Deleted auth.json from cache storage`)}catch(e){e.code!==`ENOENT`&&n.warning(`Failed to delete auth.json`,{error:Pr(e)})}}async function CO(e){let t=F.join(e,`.version`);await P.mkdir(e,{recursive:!0}),await P.writeFile(t,`1`,`utf8`)}async function wO(e){try{return(await P.readdir(e)).length>0}catch{return!1}}async function TO(e){let{components:n,runId:r,logger:i,storagePath:a,authPath:o,projectIdPath:s,opencodeVersion:c,cacheAdapter:l=pO}=e;if(t.env.SKIP_CACHE===`true`)return i.debug(`Skipping cache save (SKIP_CACHE=true)`),!0;let u=sO(n,r),d=await xO(a,s,c);i.info(`Saving cache`,{saveKey:u,paths:d});try{return await SO(o,a,i),await wO(a)===!1?(i.info(`No storage content to cache`),!1):(await CO(a),await l.saveCache(d,u),i.info(`Cache saved`,{saveKey:u}),!0)}catch(e){return e instanceof Error&&e.message.includes(`already exists`)?(i.info(`Cache key already exists, skipping save`),!0):(i.warning(`Cache save failed`,{error:Pr(e)}),!1)}}function EO(){return 8*1024*1024}function DO(){let e=process.env.ACTIONS_RUNTIME_TOKEN;if(!e)throw Error(`Unable to get the ACTIONS_RUNTIME_TOKEN env variable`);return e}function OO(){let e=process.env.ACTIONS_RESULTS_URL;if(!e)throw Error(`Unable to get the ACTIONS_RESULTS_URL env variable`);return new URL(e).origin}function kO(){let e=new URL(process.env.GITHUB_SERVER_URL||`https://github.com`).hostname.trimEnd().toUpperCase(),t=e===`GITHUB.COM`,n=e.endsWith(`.GHE.COM`),r=e.endsWith(`.LOCALHOST`);return!t&&!n&&!r}function AO(){let e=process.env.GITHUB_WORKSPACE;if(!e)throw Error(`Unable to get the GITHUB_WORKSPACE env variable`);return e}function jO(){let e=r.cpus().length,t=32;if(e>4){let n=16*e;t=n>300?300:n}let n=process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY;if(n){let e=parseInt(n);if(isNaN(e)||e<1)throw Error(`Invalid value set for ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY env variable`);return eDate.parse(`9999-12-31T23:59:59Z`))throw Error(`Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);if(e.nanos<0)throw Error(`Unable to encode invalid Timestamp to JSON. Nanos must not be negative.`);let r=`Z`;if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);r=t.substring(3)===`000000`?`.`+t.substring(0,3)+`Z`:t.substring(6)===`000`?`.`+t.substring(0,6)+`Z`:`.`+t+`Z`}return new Date(n).toISOString().replace(`.000Z`,r)}internalJsonRead(e,t,n){if(typeof e!=`string`)throw Error(`Unable to parse Timestamp from JSON `+(0,$.typeofJsonValue)(e)+`.`);let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw Error(`Unable to parse Timestamp from JSON. Invalid format.`);let i=Date.parse(r[1]+`-`+r[2]+`-`+r[3]+`T`+r[4]+`:`+r[5]+`:`+r[6]+(r[8]?r[8]:`Z`));if(Number.isNaN(i))throw Error(`Unable to parse Timestamp from JSON. Invalid value.`);if(iDate.parse(`9999-12-31T23:59:59Z`))throw new globalThis.Error(`Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);return n||=this.create(),n.seconds=$.PbLong.from(i/1e3).toString(),n.nanos=0,r[7]&&(n.nanos=parseInt(`1`+r[7]+`0`.repeat(9-r[7].length))-1e9),n}create(e){let t={seconds:`0`,nanos:0};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posPO},{no:5,name:`version`,kind:`scalar`,T:5},{no:6,name:`mime_type`,kind:`message`,T:()=>IO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,name:``,version:0};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posIO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,name:``,size:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posIO},{no:4,name:`id_filter`,kind:`message`,T:()=>FO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posUO}])}create(e){let t={artifacts:[]};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posPO},{no:7,name:`digest`,kind:`message`,T:()=>IO}])}create(e){let t={workflowRunBackendId:``,workflowJobRunBackendId:``,databaseId:`0`,name:``,size:`0`};return globalThis.Object.defineProperty(t,$.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,$.reflectionMergePartial)(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),a=e.pos+t;for(;e.posRO.fromJson(e,{ignoreUnknownFields:!0}))}FinalizeArtifact(e){let t=zO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`FinalizeArtifact`,`application/json`,t).then(e=>BO.fromJson(e,{ignoreUnknownFields:!0}))}ListArtifacts(e){let t=VO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`ListArtifacts`,`application/json`,t).then(e=>HO.fromJson(e,{ignoreUnknownFields:!0}))}GetSignedArtifactURL(e){let t=WO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`GetSignedArtifactURL`,`application/json`,t).then(e=>GO.fromJson(e,{ignoreUnknownFields:!0}))}DeleteArtifact(e){let t=KO.toJson(e,{useProtoFieldName:!0,emitDefaultValues:!1});return this.rpc.request(`github.actions.results.api.v1.ArtifactService`,`DeleteArtifact`,`application/json`,t).then(e=>qO.fromJson(e,{ignoreUnknownFields:!0}))}};function YO(e){if(!e)return;let t=XO();t&&t`,` Greater than >`],[`|`,` Vertical bar |`],[`*`,` Asterisk *`],[`?`,` Question mark ?`],[`\r`,` Carriage return \\r`],[` +`,` Line feed \\n`]]),QO=new Map([...ZO,[`\\`,` Backslash \\`],[`/`,` Forward slash /`]]);function $O(e){if(!e)throw Error(`Provided artifact name input during validation is empty`);for(let[t,n]of QO)if(e.includes(t))throw Error(`The artifact name is not valid: ${e}. Contains the following character: ${n} -Invalid characters include: ${Array.from($O.values()).toString()} +Invalid characters include: ${Array.from(QO.values()).toString()} -These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`);jr(`Artifact name is valid!`)}function tk(e){if(!e)throw Error(`Provided file path input during validation is empty`);for(let[t,n]of QO)if(e.includes(t))throw Error(`The path for one of the files in artifact is not valid: ${e}. Contains the following character: ${n} +These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`);jr(`Artifact name is valid!`)}function ek(e){if(!e)throw Error(`Provided file path input during validation is empty`);for(let[t,n]of ZO)if(e.includes(t))throw Error(`The path for one of the files in artifact is not valid: ${e}. Contains the following character: ${n} -Invalid characters include: ${Array.from(QO.values()).toString()} +Invalid characters include: ${Array.from(ZO.values()).toString()} The following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems. - `)}var nk=U(((e,t)=>{t.exports={name:`@actions/artifact`,version:`6.2.1`,preview:!0,description:`Actions artifact lib`,keywords:[`github`,`actions`,`artifact`],homepage:`https://github.com/actions/toolkit/tree/main/packages/artifact`,license:`MIT`,type:`module`,main:`lib/artifact.js`,types:`lib/artifact.d.ts`,exports:{".":{types:`./lib/artifact.d.ts`,import:`./lib/artifact.js`}},directories:{lib:`lib`,test:`__tests__`},files:[`lib`,`!.DS_Store`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/actions/toolkit.git`,directory:`packages/artifact`},scripts:{"audit-moderate":`npm install && npm audit --json --audit-level=moderate > audit.json`,test:`cd ../../ && npm run test ./packages/artifact`,bootstrap:`cd ../../ && npm run bootstrap`,"tsc-run":`tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/`,tsc:`npm run bootstrap && npm run tsc-run`,"gen:docs":`typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none`},bugs:{url:`https://github.com/actions/toolkit/issues`},dependencies:{"@actions/core":`^3.0.0`,"@actions/github":`^9.0.0`,"@actions/http-client":`^4.0.0`,"@azure/storage-blob":`^12.30.0`,"@octokit/core":`^7.0.6`,"@octokit/plugin-request-log":`^6.0.0`,"@octokit/plugin-retry":`^8.0.0`,"@octokit/request":`^10.0.7`,"@octokit/request-error":`^7.1.0`,"@protobuf-ts/plugin":`^2.2.3-alpha.1`,"@protobuf-ts/runtime":`^2.9.4`,archiver:`^7.0.1`,"jwt-decode":`^4.0.0`,"unzip-stream":`^0.3.1`},devDependencies:{"@types/archiver":`^7.0.0`,"@types/unzip-stream":`^0.3.4`,typedoc:`^0.28.16`,"typedoc-plugin-markdown":`^4.9.0`,typescript:`^5.9.3`},overrides:{"uri-js":`npm:uri-js-replace@^1.0.1`,"node-fetch":`^3.3.2`}}})),rk=U(((e,t)=>{t.exports={version:nk().version}}))();function ik(){return`@actions/artifact-${rk.version}`}var ak=class extends Error{constructor(e=[]){let t=`No files were found to upload`;e.length>0&&(t+=`: ${e.join(`, `)}`),super(t),this.files=e,this.name=`FilesNotFoundError`}},ok=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},sk=class extends Error{constructor(e=`Artifact not found`){super(e),this.name=`ArtifactNotFoundError`}},ck=class extends Error{constructor(e=`@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.`){super(e),this.name=`GHESNotSupportedError`}},lk=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};lk.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var uk=class extends Error{constructor(){super(`Artifact storage quota has been hit. Unable to upload any new artifacts. -More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name=`UsageError`}};uk.isUsageErrorMessage=e=>e?e.includes(`insufficient usage`):!1;var dk=class extends Error{};dk.prototype.name=`InvalidTokenError`;function fk(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function pk(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return fk(t)}catch{return atob(t)}}function mk(e,t){if(typeof e!=`string`)throw new dk(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new dk(`Invalid token specified: missing part #${n+1}`);let i;try{i=pk(r)}catch(e){throw new dk(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new dk(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}const hk=Error(`Failed to get backend IDs: The provided JWT token is invalid and/or missing claims`);function gk(){let e=mk(OO());if(!e.scp)throw hk;let t=e.scp.split(` `);if(t.length===0)throw hk;for(let e of t){let t=e.split(`:`);if(t?.[0]!==`Actions.Results`)continue;if(t.length!==3)throw hk;let n={workflowRunBackendId:t[1],workflowJobRunBackendId:t[2]};return G(`Workflow Run Backend ID: ${n.workflowRunBackendId}`),G(`Workflow Job Run Backend ID: ${n.workflowJobRunBackendId}`),n}throw hk}function _k(e){if(e)try{let t=new URL(e).searchParams.get(`sig`);t&&(Cr(t),Cr(encodeURIComponent(t)))}catch(t){G(`Failed to parse URL: ${e} ${t instanceof Error?t.message:String(t)}`)}}function vk(e){if(typeof e!=`object`||!e){G(`body is not an object or is null`);return}`signed_upload_url`in e&&typeof e.signed_upload_url==`string`&&_k(e.signed_upload_url),`signed_url`in e&&typeof e.signed_url==`string`&&_k(e.signed_url)}var yk=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},bk=class{constructor(e,t,n,r){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let i=OO();this.baseUrl=kO(),t&&(this.maxAttempts=t),n&&(this.baseRetryIntervalMilliseconds=n),r&&(this.retryMultiplier=r),this.httpClient=new On(e,[new jn(i)])}request(e,t,n,r){return yk(this,void 0,void 0,function*(){let i=new URL(`/twirp/${e}/${t}`,this.baseUrl).href;G(`[Request] ${t} ${i}`);let a={"Content-Type":n};try{let{body:e}=yield this.retryableRequest(()=>yk(this,void 0,void 0,function*(){return this.httpClient.post(i,JSON.stringify(r),a)}));return e}catch(e){throw Error(`Failed to ${t}: ${e.message}`)}})}retryableRequest(e){return yk(this,void 0,void 0,function*(){let t=0,n=``,r=``;for(;t=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[bn.BadGateway,bn.GatewayTimeout,bn.InternalServerError,bn.ServiceUnavailable,bn.TooManyRequests].includes(e):!1}sleep(e){return yk(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw Error(`attempt should be a positive integer`);if(e===0)return this.baseRetryIntervalMilliseconds;let t=this.baseRetryIntervalMilliseconds*this.retryMultiplier**+e,n=t*this.retryMultiplier;return Math.trunc(Math.random()*(n-t)+t)}};function xk(e){return new YO(new bk(ik(),e?.maxAttempts,e?.retryIntervalMs,e?.retryMultiplier))}function Sk(e){if(!o.existsSync(e))throw Error(`The provided rootDirectory ${e} does not exist`);if(!o.statSync(e).isDirectory())throw Error(`The provided rootDirectory ${e} is not a valid directory`);jr(`Root directory input is valid!`)}function Ck(e,t){let n=[];t=p(t),t=m(t);for(let r of e){let e=o.lstatSync(r,{throwIfNoEntry:!1});if(!e)throw Error(`File ${r} does not exist`);if(e.isDirectory()){let i=r.replace(t,``);tk(i),n.push({sourcePath:null,destinationPath:i,stats:e})}else{if(r=p(r),r=m(r),!r.startsWith(t))throw Error(`The rootDirectory: ${t} is not a parent directory of the file: ${r}`);let i=r.replace(t,``);tk(i),n.push({sourcePath:r,destinationPath:i,stats:e})}}return n}var wk=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Tk(e,t,n){return wk(this,void 0,void 0,function*(){let r=0,i=Date.now(),o=new AbortController,s=e=>wk(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=setInterval(()=>{Date.now()-i>e&&n(Error(`Upload progress stalled.`))},e);o.signal.addEventListener(`abort`,()=>{clearInterval(r),t()})})}),c=MO(),l=DO(),u=new IT(e).getBlockBlobClient();G(`Uploading artifact to blob storage with maxConcurrency: ${c}, bufferSize: ${l}, contentType: ${n}`);let d={blobHTTPHeaders:{blobContentType:n},onProgress:e=>{jr(`Uploaded bytes ${e.loadedBytes}`),r=e.loadedBytes,i=Date.now()},abortSignal:o.signal},f,p=new z.PassThrough,m=a.createHash(`sha256`);t.pipe(p),t.pipe(m).setEncoding(`hex`),jr(`Beginning upload of artifact content to blob storage`);try{yield Promise.race([u.uploadStream(p,l,c,d),s(NO())])}catch(e){throw lk.isNetworkErrorCode(e?.code)?new lk(e?.code):e}finally{o.abort()}return jr(`Finished uploading artifact content to blob storage!`),m.end(),f=m.read(),jr(`SHA256 digest of uploaded artifact is ${f}`),r===0&&Ar(`No data was uploaded to blob storage. Reported upload byte count is 0.`),{uploadSize:r,sha256Hash:f}})}var Ek=U(((e,t)=>{t.exports=typeof process==`object`&&process&&process.platform===`win32`?{sep:`\\`}:{sep:`/`}})),Dk=U(((e,t)=>{var n=Cs();t.exports=f;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`;function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function u(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function d(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=d(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function f(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),v(l(e),!0).map(u)):[]}function p(e){return`{`+e+`}`}function m(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function g(e,t){return e>=t}function v(e,t){var r=[],i=n(`{`,`}`,e);if(!i)return[e];var o=i.pre,s=i.post.length?v(i.post,!1):[``];if(/\$$/.test(i.pre))for(var l=0;l=0;if(!b&&!x)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+a+i.post,v(e)):[e];var S;if(b)S=i.body.split(/\.\./);else if(S=d(i.body),S.length===1&&(S=v(S[0],!1).map(p),S.length===1))return s.map(function(e){return i.pre+S[0]+e});var C;if(b){var w=c(S[0]),T=c(S[1]),E=Math.max(S[0].length,S[1].length),D=S.length==3?Math.max(Math.abs(c(S[2])),1):1,O=h;T0){var N=Array(M+1).join(`0`);j=A<0?`-`+N+j.slice(1):N+j}}C.push(j)}}else{C=[];for(var P=0;P{let n=t.exports=(e,t,n={})=>(h(t),!n.nocomment&&t.charAt(0)===`#`?!1:new S(t,n).match(e));t.exports=n;let r=Ek();n.sep=r.sep;let i=Symbol(`globstar **`);n.GLOBSTAR=i;let a=Dk(),o={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},s=`[^/]`,c=s+`*?`,l=e=>e.split(``).reduce((e,t)=>(e[t]=!0,e),{}),u=l(`().*{}+?[]^$\\!`),d=l(`[.(`),f=/\/+/;n.filter=(e,t={})=>(r,i,a)=>n(r,e,t);let p=(e,t={})=>{let n={};return Object.keys(e).forEach(t=>n[t]=e[t]),Object.keys(t).forEach(e=>n[e]=t[e]),n};n.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return n;let t=n,r=(n,r,i)=>t(n,r,p(e,i));return r.Minimatch=class extends t.Minimatch{constructor(t,n){super(t,p(e,n))}},r.Minimatch.defaults=n=>t.defaults(p(e,n)).Minimatch,r.filter=(n,r)=>t.filter(n,p(e,r)),r.defaults=n=>t.defaults(p(e,n)),r.makeRe=(n,r)=>t.makeRe(n,p(e,r)),r.braceExpand=(n,r)=>t.braceExpand(n,p(e,r)),r.match=(n,r,i)=>t.match(n,r,p(e,i)),r},n.braceExpand=(e,t)=>m(e,t);let m=(e,t={})=>(h(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:a(e)),h=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},g=Symbol(`subparse`);n.makeRe=(e,t)=>new S(e,t||{}).makeRe(),n.match=(e,t,n={})=>{let r=new S(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};let v=e=>e.replace(/\\(.)/g,`$1`),y=e=>e.replace(/\\([^-\]])/g,`$1`),b=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),x=e=>e.replace(/[[\]\\]/g,`\\$&`);var S=class{constructor(e,t){h(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map(e=>e.split(f)),this.debug(this.pattern,n),n=n.map((e,t,n)=>e.map(this.parse,this)),this.debug(this.pattern,n),n=n.filter(e=>e.indexOf(!1)===-1),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r=0;e--)if(t[e]===i){s=e;break}let c=t.slice(a,o),l=n?t.slice(o+1):t.slice(o+1,s),u=n?[]:t.slice(s+1);if(c.length){let t=e.slice(r,r+c.length);if(!this._matchOne(t,c,n,0,0))return!1;r+=c.length}let d=0;if(u.length){if(u.length+r>e.length)return!1;let t=e.length-u.length;if(this._matchOne(e,u,n,t,0))d=u.length;else{if(e[e.length-1]!==``||r+u.length===e.length||!this._matchOne(e,u,n,t-1,0))return!1;d=u.length+1}}if(!l.length){let t=!!d;for(let n=r;nD?``:O?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,A=e=>e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,j=()=>{if(m){switch(m){case`*`:r+=c,a=!0;break;case`?`:r+=s,a=!0;break;default:r+=`\\`+m;break}this.debug(`clearStateChar %j %j`,m,r),m=!1}};for(let t=0,i;t(n||=`\\`,t+t+n+`|`)),this.debug(`tail=%j - %s`,e,e,T,r);let t=T.type===`*`?c:T.type===`?`?s:`\\`+T.type;a=!0,r=r.slice(0,T.reStart)+t+`\\(`+e}j(),l&&(r+=`\\\\`);let M=d[r.charAt(0)];for(let e=p.length-1;e>-1;e--){let n=p[e],i=r.slice(0,n.reStart),a=r.slice(n.reStart,n.reEnd-8),o=r.slice(n.reEnd),s=r.slice(n.reEnd-8,n.reEnd)+o,c=i.split(`)`).length,l=i.split(`(`).length-c,u=o;for(let e=0;e(e=e.map(e=>typeof e==`string`?b(e):e===i?i:e._src).reduce((e,t)=>(e[e.length-1]===i&&t===i||e.push(t),e),[]),e.forEach((t,r)=>{t!==i||e[r-1]===i||(r===0?e.length>1?e[r+1]=`(?:\\/|`+n+`\\/)?`+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+=`(?:\\/|`+n+`)?`:(e[r-1]+=`(?:\\/|\\/`+n+`\\/)`+e[r+1],e[r+1]=i))}),e.filter(e=>e!==i).join(`/`))).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{this.regexp=new RegExp(a,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;r.sep!==`/`&&(e=e.split(r.sep).join(`/`)),e=e.split(f),this.debug(this.pattern,`split`,e);let i=this.set;this.debug(this.pattern,`set`,i);let a;for(let t=e.length-1;t>=0&&(a=e[t],!a);t--);for(let r=0;r{t.exports=f;let n=W(`fs`),{EventEmitter:r}=W(`events`),{Minimatch:i}=Ok(),{resolve:a}=W(`path`);function o(e,t){return new Promise((r,i)=>{n.readdir(e,{withFileTypes:!0},(e,n)=>{if(e)switch(e.code){case`ENOTDIR`:t?i(e):r([]);break;case`ENOTSUP`:case`ENOENT`:case`ENAMETOOLONG`:case`UNKNOWN`:r([]);break;default:i(e);break}else r(n)})})}function s(e,t){return new Promise((r,i)=>{(t?n.stat:n.lstat)(e,(n,i)=>{if(n)switch(n.code){case`ENOENT`:r(t?s(e,!1):null);break;default:r(null);break}else r(i)})})}async function*c(e,t,n,r,i,a){let l=await o(t+e,a);for(let a of l){let o=a.name;o===void 0&&(o=a,r=!0);let l=e+`/`+o,u=l.slice(1),d=t+`/`+u,f=null;(r||n)&&(f=await s(d,n)),!f&&a.name!==void 0&&(f=a),f===null&&(f={isDirectory:()=>!1}),f.isDirectory()?i(u)||(yield{relative:u,absolute:d,stats:f},yield*c(l,t,n,r,i,!1)):yield{relative:u,absolute:d,stats:f}}}async function*l(e,t,n,r){yield*c(``,e,t,n,r,!0)}function u(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}var d=class extends r{constructor(e,t,n){super(),typeof t==`function`&&(n=t,t=null),this.options=u(t||{}),this.matchers=[],this.options.pattern&&(this.matchers=(Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern]).map(e=>new i(e,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))),this.ignoreMatchers=[],this.options.ignore&&(this.ignoreMatchers=(Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore]).map(e=>new i(e,{dot:!0}))),this.skipMatchers=[],this.options.skip&&(this.skipMatchers=(Array.isArray(this.options.skip)?this.options.skip:[this.options.skip]).map(e=>new i(e,{dot:!0}))),this.iterator=l(a(e||`.`),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,n&&(this._matches=[],this.on(`match`,e=>this._matches.push(this.options.absolute?e.absolute:e.relative)),this.on(`error`,e=>n(e)),this.on(`end`,()=>n(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(e){return this.skipMatchers.some(t=>t.match(e))}_fileMatches(e,t){let n=e+(t?`/`:``);return(this.matchers.length===0||this.matchers.some(e=>e.match(n)))&&!this.ignoreMatchers.some(e=>e.match(n))&&(!this.options.nodir||!t)}_next(){!this.paused&&!this.aborted?this.iterator.next().then(e=>{if(e.done)this.emit(`end`);else{let t=e.value.stats.isDirectory();if(this._fileMatches(e.value.relative,t)){let n=e.value.relative,r=e.value.absolute;this.options.mark&&t&&(n+=`/`,r+=`/`),this.options.stat?this.emit(`match`,{relative:n,absolute:r,stat:e.value.stats}):this.emit(`match`,{relative:n,absolute:r})}this._next(this.iterator)}}).catch(e=>{this.abort(),this.emit(`error`,e),!e.code&&!this.options.silent&&console.error(e)}):this.inactive=!0}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}};function f(e,t,n){return new d(e,t,n)}f.ReaddirGlob=d})),Ak=U(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.async={}))})(e,(function(e){function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}var r=typeof queueMicrotask==`function`&&queueMicrotask,i=typeof setImmediate==`function`&&setImmediate,a=typeof process==`object`&&typeof process.nextTick==`function`;function o(e){setTimeout(e,0)}function s(e){return(t,...n)=>e(()=>t(...n))}var c=s(r?queueMicrotask:i?setImmediate:a?process.nextTick:o);function l(e){return f(e)?function(...t){let n=t.pop();return u(e.apply(this,t),n)}:n(function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&typeof r.then==`function`)return u(r,n);n(null,r)})}function u(e,t){return e.then(e=>{d(t,null,e)},e=>{d(t,e&&(e instanceof Error||e.message)?e:Error(e))})}function d(e,t,n){try{e(t,n)}catch(e){c(e=>{throw e},e)}}function f(e){return e[Symbol.toStringTag]===`AsyncFunction`}function p(e){return e[Symbol.toStringTag]===`AsyncGenerator`}function m(e){return typeof e[Symbol.asyncIterator]==`function`}function h(e){if(typeof e!=`function`)throw Error(`expected a function`);return f(e)?l(e):e}function g(e,t){if(t||=e.length,!t)throw Error(`arity is undefined`);function n(...n){return typeof n[t-1]==`function`?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}return n}function v(e){return function(t,...n){return g(function(r){var i=this;return e(t,(e,t)=>{h(e).apply(i,n.concat(t))},r)})}}function y(e,t,n,r){t||=[];var i=[],a=0,o=h(n);return e(t,(e,t,n)=>{var r=a++;o(e,(e,t)=>{i[r]=t,n(e)})},e=>{r(e,i)})}function b(e){return e&&typeof e.length==`number`&&e.length>=0&&e.length%1==0}let x={};function S(e){function t(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function C(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function w(e){var t=-1,n=e.length;return function(){return++t=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!(a||i)){if(o=!1,t){i=!0,s<=0&&r(null);return}s++,n(e,c,u),c++,l()}}).catch(d))}function u(e,t){if(--s,!a){if(e)return d(e);if(e===!1){i=!0,a=!0;return}if(t===x||i&&s<=0)return i=!0,r(null);l()}}function d(e){a||(o=!1,i=!0,r(e))}l()}var A=e=>(t,n,r)=>{if(r=S(r),e<=0)throw RangeError(`concurrency limit cannot be less than 1`);if(!t)return r(null);if(p(t))return k(t,e,n,r);if(m(t))return k(t[Symbol.asyncIterator](),e,n,r);var i=D(t),a=!1,o=!1,s=0,c=!1;function l(e,t){if(!o)if(--s,e)a=!0,r(e);else if(e===!1)a=!0,o=!0;else if(t===x||a&&s<=0)return a=!0,r(null);else c||u()}function u(){for(c=!0;s1?r:r[0])}return n[H]=new Promise((n,r)=>{e=n,t=r}),n}function ie(e,t,n){typeof t!=`number`&&(n=t,t=null),n=S(n||re());var r=Object.keys(e).length;if(!r)return n(null);t||=r;var i={},a=0,o=!1,s=!1,c=Object.create(null),l=[],u=[],d={};Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n)){f(t,[n]),u.push(t);return}var r=n.slice(0,n.length-1),i=r.length;if(i===0){f(t,n),u.push(t);return}d[t]=i,r.forEach(a=>{if(!e[a])throw Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(`, `));m(a,()=>{i--,i===0&&f(t,n)})})}),y(),p();function f(e,t){l.push(()=>v(e,t))}function p(){if(!o){if(l.length===0&&a===0)return n(null,i);for(;l.length&&ae()),p()}function v(e,t){if(!s){var r=O((t,...r)=>{if(a--,t===!1){o=!0;return}if(r.length<2&&([r]=r),t){var l={};if(Object.keys(i).forEach(e=>{l[e]=i[e]}),l[e]=r,s=!0,c=Object.create(null),o)return;n(t,l)}else i[e]=r,g(e)});a++;var l=h(t[t.length-1]);t.length>1?l(i,r):l(r)}}function y(){for(var e,t=0;u.length;)e=u.pop(),t++,b(e).forEach(e=>{--d[e]===0&&u.push(e)});if(t!==r)throw Error(`async.auto cannot execute tasks due to a recursive dependency`)}function b(t){var n=[];return Object.keys(e).forEach(r=>{let i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)}),n}return n[H]}var ae=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,oe=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,se=/,/,ce=/(=.+)?(\s*)$/;function le(e){let t=``,n=0,r=e.indexOf(`*/`);for(;n{t.exports={name:`@actions/artifact`,version:`6.2.1`,preview:!0,description:`Actions artifact lib`,keywords:[`github`,`actions`,`artifact`],homepage:`https://github.com/actions/toolkit/tree/main/packages/artifact`,license:`MIT`,type:`module`,main:`lib/artifact.js`,types:`lib/artifact.d.ts`,exports:{".":{types:`./lib/artifact.d.ts`,import:`./lib/artifact.js`}},directories:{lib:`lib`,test:`__tests__`},files:[`lib`,`!.DS_Store`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/actions/toolkit.git`,directory:`packages/artifact`},scripts:{"audit-moderate":`npm install && npm audit --json --audit-level=moderate > audit.json`,test:`cd ../../ && npm run test ./packages/artifact`,bootstrap:`cd ../../ && npm run bootstrap`,"tsc-run":`tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/`,tsc:`npm run bootstrap && npm run tsc-run`,"gen:docs":`typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none`},bugs:{url:`https://github.com/actions/toolkit/issues`},dependencies:{"@actions/core":`^3.0.0`,"@actions/github":`^9.0.0`,"@actions/http-client":`^4.0.0`,"@azure/storage-blob":`^12.30.0`,"@octokit/core":`^7.0.6`,"@octokit/plugin-request-log":`^6.0.0`,"@octokit/plugin-retry":`^8.0.0`,"@octokit/request":`^10.0.7`,"@octokit/request-error":`^7.1.0`,"@protobuf-ts/plugin":`^2.2.3-alpha.1`,"@protobuf-ts/runtime":`^2.9.4`,archiver:`^7.0.1`,"jwt-decode":`^4.0.0`,"unzip-stream":`^0.3.1`},devDependencies:{"@types/archiver":`^7.0.0`,"@types/unzip-stream":`^0.3.4`,typedoc:`^0.28.16`,"typedoc-plugin-markdown":`^4.9.0`,typescript:`^5.9.3`},overrides:{"uri-js":`npm:uri-js-replace@^1.0.1`,"node-fetch":`^3.3.2`}}})),nk=U(((e,t)=>{t.exports={version:tk().version}}))();function rk(){return`@actions/artifact-${nk.version}`}var ik=class extends Error{constructor(e=[]){let t=`No files were found to upload`;e.length>0&&(t+=`: ${e.join(`, `)}`),super(t),this.files=e,this.name=`FilesNotFoundError`}},ak=class extends Error{constructor(e){super(e),this.name=`InvalidResponseError`}},ok=class extends Error{constructor(e=`Artifact not found`){super(e),this.name=`ArtifactNotFoundError`}},sk=class extends Error{constructor(e=`@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.`){super(e),this.name=`GHESNotSupportedError`}},ck=class extends Error{constructor(e){let t=`Unable to make request: ${e}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(t),this.code=e,this.name=`NetworkError`}};ck.isNetworkErrorCode=e=>e?[`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`ECONNREFUSED`,`EHOSTUNREACH`].includes(e):!1;var lk=class extends Error{constructor(){super(`Artifact storage quota has been hit. Unable to upload any new artifacts. +More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name=`UsageError`}};lk.isUsageErrorMessage=e=>e?e.includes(`insufficient usage`):!1;var uk=class extends Error{};uk.prototype.name=`InvalidTokenError`;function dk(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function fk(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return dk(t)}catch{return atob(t)}}function pk(e,t){if(typeof e!=`string`)throw new uk(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new uk(`Invalid token specified: missing part #${n+1}`);let i;try{i=fk(r)}catch(e){throw new uk(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new uk(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}const mk=Error(`Failed to get backend IDs: The provided JWT token is invalid and/or missing claims`);function hk(){let e=pk(DO());if(!e.scp)throw mk;let t=e.scp.split(` `);if(t.length===0)throw mk;for(let e of t){let t=e.split(`:`);if(t?.[0]!==`Actions.Results`)continue;if(t.length!==3)throw mk;let n={workflowRunBackendId:t[1],workflowJobRunBackendId:t[2]};return G(`Workflow Run Backend ID: ${n.workflowRunBackendId}`),G(`Workflow Job Run Backend ID: ${n.workflowJobRunBackendId}`),n}throw mk}function gk(e){if(e)try{let t=new URL(e).searchParams.get(`sig`);t&&(Cr(t),Cr(encodeURIComponent(t)))}catch(t){G(`Failed to parse URL: ${e} ${t instanceof Error?t.message:String(t)}`)}}function _k(e){if(typeof e!=`object`||!e){G(`body is not an object or is null`);return}`signed_upload_url`in e&&typeof e.signed_upload_url==`string`&&gk(e.signed_upload_url),`signed_url`in e&&typeof e.signed_url==`string`&&gk(e.signed_url)}var vk=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},yk=class{constructor(e,t,n,r){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let i=DO();this.baseUrl=OO(),t&&(this.maxAttempts=t),n&&(this.baseRetryIntervalMilliseconds=n),r&&(this.retryMultiplier=r),this.httpClient=new On(e,[new jn(i)])}request(e,t,n,r){return vk(this,void 0,void 0,function*(){let i=new URL(`/twirp/${e}/${t}`,this.baseUrl).href;G(`[Request] ${t} ${i}`);let a={"Content-Type":n};try{let{body:e}=yield this.retryableRequest(()=>vk(this,void 0,void 0,function*(){return this.httpClient.post(i,JSON.stringify(r),a)}));return e}catch(e){throw Error(`Failed to ${t}: ${e.message}`)}})}retryableRequest(e){return vk(this,void 0,void 0,function*(){let t=0,n=``,r=``;for(;t=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[bn.BadGateway,bn.GatewayTimeout,bn.InternalServerError,bn.ServiceUnavailable,bn.TooManyRequests].includes(e):!1}sleep(e){return vk(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw Error(`attempt should be a positive integer`);if(e===0)return this.baseRetryIntervalMilliseconds;let t=this.baseRetryIntervalMilliseconds*this.retryMultiplier**+e,n=t*this.retryMultiplier;return Math.trunc(Math.random()*(n-t)+t)}};function bk(e){return new JO(new yk(rk(),e?.maxAttempts,e?.retryIntervalMs,e?.retryMultiplier))}function xk(e){if(!o.existsSync(e))throw Error(`The provided rootDirectory ${e} does not exist`);if(!o.statSync(e).isDirectory())throw Error(`The provided rootDirectory ${e} is not a valid directory`);jr(`Root directory input is valid!`)}function Sk(e,t){let n=[];t=p(t),t=m(t);for(let r of e){let e=o.lstatSync(r,{throwIfNoEntry:!1});if(!e)throw Error(`File ${r} does not exist`);if(e.isDirectory()){let i=r.replace(t,``);ek(i),n.push({sourcePath:null,destinationPath:i,stats:e})}else{if(r=p(r),r=m(r),!r.startsWith(t))throw Error(`The rootDirectory: ${t} is not a parent directory of the file: ${r}`);let i=r.replace(t,``);ek(i),n.push({sourcePath:r,destinationPath:i,stats:e})}}return n}var Ck=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function wk(e,t,n){return Ck(this,void 0,void 0,function*(){let r=0,i=Date.now(),o=new AbortController,s=e=>Ck(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=setInterval(()=>{Date.now()-i>e&&n(Error(`Upload progress stalled.`))},e);o.signal.addEventListener(`abort`,()=>{clearInterval(r),t()})})}),c=jO(),l=EO(),u=new FT(e).getBlockBlobClient();G(`Uploading artifact to blob storage with maxConcurrency: ${c}, bufferSize: ${l}, contentType: ${n}`);let d={blobHTTPHeaders:{blobContentType:n},onProgress:e=>{jr(`Uploaded bytes ${e.loadedBytes}`),r=e.loadedBytes,i=Date.now()},abortSignal:o.signal},f,p=new z.PassThrough,m=a.createHash(`sha256`);t.pipe(p),t.pipe(m).setEncoding(`hex`),jr(`Beginning upload of artifact content to blob storage`);try{yield Promise.race([u.uploadStream(p,l,c,d),s(MO())])}catch(e){throw ck.isNetworkErrorCode(e?.code)?new ck(e?.code):e}finally{o.abort()}return jr(`Finished uploading artifact content to blob storage!`),m.end(),f=m.read(),jr(`SHA256 digest of uploaded artifact is ${f}`),r===0&&Ar(`No data was uploaded to blob storage. Reported upload byte count is 0.`),{uploadSize:r,sha256Hash:f}})}var Tk=U(((e,t)=>{t.exports=typeof process==`object`&&process&&process.platform===`win32`?{sep:`\\`}:{sep:`/`}})),Ek=U(((e,t)=>{let n=t.exports=(e,t,n={})=>(h(t),!n.nocomment&&t.charAt(0)===`#`?!1:new S(t,n).match(e));t.exports=n;let r=Tk();n.sep=r.sep;let i=Symbol(`globstar **`);n.GLOBSTAR=i;let a=Cs(),o={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},s=`[^/]`,c=s+`*?`,l=e=>e.split(``).reduce((e,t)=>(e[t]=!0,e),{}),u=l(`().*{}+?[]^$\\!`),d=l(`[.(`),f=/\/+/;n.filter=(e,t={})=>(r,i,a)=>n(r,e,t);let p=(e,t={})=>{let n={};return Object.keys(e).forEach(t=>n[t]=e[t]),Object.keys(t).forEach(e=>n[e]=t[e]),n};n.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return n;let t=n,r=(n,r,i)=>t(n,r,p(e,i));return r.Minimatch=class extends t.Minimatch{constructor(t,n){super(t,p(e,n))}},r.Minimatch.defaults=n=>t.defaults(p(e,n)).Minimatch,r.filter=(n,r)=>t.filter(n,p(e,r)),r.defaults=n=>t.defaults(p(e,n)),r.makeRe=(n,r)=>t.makeRe(n,p(e,r)),r.braceExpand=(n,r)=>t.braceExpand(n,p(e,r)),r.match=(n,r,i)=>t.match(n,r,p(e,i)),r},n.braceExpand=(e,t)=>m(e,t);let m=(e,t={})=>(h(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:a(e)),h=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},g=Symbol(`subparse`);n.makeRe=(e,t)=>new S(e,t||{}).makeRe(),n.match=(e,t,n={})=>{let r=new S(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};let v=e=>e.replace(/\\(.)/g,`$1`),y=e=>e.replace(/\\([^-\]])/g,`$1`),b=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),x=e=>e.replace(/[[\]\\]/g,`\\$&`);var S=class{constructor(e,t){h(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map(e=>e.split(f)),this.debug(this.pattern,n),n=n.map((e,t,n)=>e.map(this.parse,this)),this.debug(this.pattern,n),n=n.filter(e=>e.indexOf(!1)===-1),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r=0;e--)if(t[e]===i){s=e;break}let c=t.slice(a,o),l=n?t.slice(o+1):t.slice(o+1,s),u=n?[]:t.slice(s+1);if(c.length){let t=e.slice(r,r+c.length);if(!this._matchOne(t,c,n,0,0))return!1;r+=c.length}let d=0;if(u.length){if(u.length+r>e.length)return!1;let t=e.length-u.length;if(this._matchOne(e,u,n,t,0))d=u.length;else{if(e[e.length-1]!==``||r+u.length===e.length||!this._matchOne(e,u,n,t-1,0))return!1;d=u.length+1}}if(!l.length){let t=!!d;for(let n=r;nD?``:O?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,A=e=>e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,j=()=>{if(m){switch(m){case`*`:r+=c,a=!0;break;case`?`:r+=s,a=!0;break;default:r+=`\\`+m;break}this.debug(`clearStateChar %j %j`,m,r),m=!1}};for(let t=0,i;t(n||=`\\`,t+t+n+`|`)),this.debug(`tail=%j + %s`,e,e,T,r);let t=T.type===`*`?c:T.type===`?`?s:`\\`+T.type;a=!0,r=r.slice(0,T.reStart)+t+`\\(`+e}j(),l&&(r+=`\\\\`);let M=d[r.charAt(0)];for(let e=p.length-1;e>-1;e--){let n=p[e],i=r.slice(0,n.reStart),a=r.slice(n.reStart,n.reEnd-8),o=r.slice(n.reEnd),s=r.slice(n.reEnd-8,n.reEnd)+o,c=i.split(`)`).length,l=i.split(`(`).length-c,u=o;for(let e=0;e(e=e.map(e=>typeof e==`string`?b(e):e===i?i:e._src).reduce((e,t)=>(e[e.length-1]===i&&t===i||e.push(t),e),[]),e.forEach((t,r)=>{t!==i||e[r-1]===i||(r===0?e.length>1?e[r+1]=`(?:\\/|`+n+`\\/)?`+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+=`(?:\\/|`+n+`)?`:(e[r-1]+=`(?:\\/|\\/`+n+`\\/)`+e[r+1],e[r+1]=i))}),e.filter(e=>e!==i).join(`/`))).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{this.regexp=new RegExp(a,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;r.sep!==`/`&&(e=e.split(r.sep).join(`/`)),e=e.split(f),this.debug(this.pattern,`split`,e);let i=this.set;this.debug(this.pattern,`set`,i);let a;for(let t=e.length-1;t>=0&&(a=e[t],!a);t--);for(let r=0;r{t.exports=f;let n=W(`fs`),{EventEmitter:r}=W(`events`),{Minimatch:i}=Ek(),{resolve:a}=W(`path`);function o(e,t){return new Promise((r,i)=>{n.readdir(e,{withFileTypes:!0},(e,n)=>{if(e)switch(e.code){case`ENOTDIR`:t?i(e):r([]);break;case`ENOTSUP`:case`ENOENT`:case`ENAMETOOLONG`:case`UNKNOWN`:r([]);break;default:i(e);break}else r(n)})})}function s(e,t){return new Promise((r,i)=>{(t?n.stat:n.lstat)(e,(n,i)=>{if(n)switch(n.code){case`ENOENT`:r(t?s(e,!1):null);break;default:r(null);break}else r(i)})})}async function*c(e,t,n,r,i,a){let l=await o(t+e,a);for(let a of l){let o=a.name;o===void 0&&(o=a,r=!0);let l=e+`/`+o,u=l.slice(1),d=t+`/`+u,f=null;(r||n)&&(f=await s(d,n)),!f&&a.name!==void 0&&(f=a),f===null&&(f={isDirectory:()=>!1}),f.isDirectory()?i(u)||(yield{relative:u,absolute:d,stats:f},yield*c(l,t,n,r,i,!1)):yield{relative:u,absolute:d,stats:f}}}async function*l(e,t,n,r){yield*c(``,e,t,n,r,!0)}function u(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}var d=class extends r{constructor(e,t,n){super(),typeof t==`function`&&(n=t,t=null),this.options=u(t||{}),this.matchers=[],this.options.pattern&&(this.matchers=(Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern]).map(e=>new i(e,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))),this.ignoreMatchers=[],this.options.ignore&&(this.ignoreMatchers=(Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore]).map(e=>new i(e,{dot:!0}))),this.skipMatchers=[],this.options.skip&&(this.skipMatchers=(Array.isArray(this.options.skip)?this.options.skip:[this.options.skip]).map(e=>new i(e,{dot:!0}))),this.iterator=l(a(e||`.`),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,n&&(this._matches=[],this.on(`match`,e=>this._matches.push(this.options.absolute?e.absolute:e.relative)),this.on(`error`,e=>n(e)),this.on(`end`,()=>n(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(e){return this.skipMatchers.some(t=>t.match(e))}_fileMatches(e,t){let n=e+(t?`/`:``);return(this.matchers.length===0||this.matchers.some(e=>e.match(n)))&&!this.ignoreMatchers.some(e=>e.match(n))&&(!this.options.nodir||!t)}_next(){!this.paused&&!this.aborted?this.iterator.next().then(e=>{if(e.done)this.emit(`end`);else{let t=e.value.stats.isDirectory();if(this._fileMatches(e.value.relative,t)){let n=e.value.relative,r=e.value.absolute;this.options.mark&&t&&(n+=`/`,r+=`/`),this.options.stat?this.emit(`match`,{relative:n,absolute:r,stat:e.value.stats}):this.emit(`match`,{relative:n,absolute:r})}this._next(this.iterator)}}).catch(e=>{this.abort(),this.emit(`error`,e),!e.code&&!this.options.silent&&console.error(e)}):this.inactive=!0}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}};function f(e,t,n){return new d(e,t,n)}f.ReaddirGlob=d})),Ok=U(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.async={}))})(e,(function(e){function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}var r=typeof queueMicrotask==`function`&&queueMicrotask,i=typeof setImmediate==`function`&&setImmediate,a=typeof process==`object`&&typeof process.nextTick==`function`;function o(e){setTimeout(e,0)}function s(e){return(t,...n)=>e(()=>t(...n))}var c=s(r?queueMicrotask:i?setImmediate:a?process.nextTick:o);function l(e){return f(e)?function(...t){let n=t.pop();return u(e.apply(this,t),n)}:n(function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&typeof r.then==`function`)return u(r,n);n(null,r)})}function u(e,t){return e.then(e=>{d(t,null,e)},e=>{d(t,e&&(e instanceof Error||e.message)?e:Error(e))})}function d(e,t,n){try{e(t,n)}catch(e){c(e=>{throw e},e)}}function f(e){return e[Symbol.toStringTag]===`AsyncFunction`}function p(e){return e[Symbol.toStringTag]===`AsyncGenerator`}function m(e){return typeof e[Symbol.asyncIterator]==`function`}function h(e){if(typeof e!=`function`)throw Error(`expected a function`);return f(e)?l(e):e}function g(e,t){if(t||=e.length,!t)throw Error(`arity is undefined`);function n(...n){return typeof n[t-1]==`function`?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}return n}function v(e){return function(t,...n){return g(function(r){var i=this;return e(t,(e,t)=>{h(e).apply(i,n.concat(t))},r)})}}function y(e,t,n,r){t||=[];var i=[],a=0,o=h(n);return e(t,(e,t,n)=>{var r=a++;o(e,(e,t)=>{i[r]=t,n(e)})},e=>{r(e,i)})}function b(e){return e&&typeof e.length==`number`&&e.length>=0&&e.length%1==0}let x={};function S(e){function t(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function C(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function w(e){var t=-1,n=e.length;return function(){return++t=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!(a||i)){if(o=!1,t){i=!0,s<=0&&r(null);return}s++,n(e,c,u),c++,l()}}).catch(d))}function u(e,t){if(--s,!a){if(e)return d(e);if(e===!1){i=!0,a=!0;return}if(t===x||i&&s<=0)return i=!0,r(null);l()}}function d(e){a||(o=!1,i=!0,r(e))}l()}var A=e=>(t,n,r)=>{if(r=S(r),e<=0)throw RangeError(`concurrency limit cannot be less than 1`);if(!t)return r(null);if(p(t))return k(t,e,n,r);if(m(t))return k(t[Symbol.asyncIterator](),e,n,r);var i=D(t),a=!1,o=!1,s=0,c=!1;function l(e,t){if(!o)if(--s,e)a=!0,r(e);else if(e===!1)a=!0,o=!0;else if(t===x||a&&s<=0)return a=!0,r(null);else c||u()}function u(){for(c=!0;s1?r:r[0])}return n[H]=new Promise((n,r)=>{e=n,t=r}),n}function ie(e,t,n){typeof t!=`number`&&(n=t,t=null),n=S(n||re());var r=Object.keys(e).length;if(!r)return n(null);t||=r;var i={},a=0,o=!1,s=!1,c=Object.create(null),l=[],u=[],d={};Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n)){f(t,[n]),u.push(t);return}var r=n.slice(0,n.length-1),i=r.length;if(i===0){f(t,n),u.push(t);return}d[t]=i,r.forEach(a=>{if(!e[a])throw Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(`, `));m(a,()=>{i--,i===0&&f(t,n)})})}),y(),p();function f(e,t){l.push(()=>v(e,t))}function p(){if(!o){if(l.length===0&&a===0)return n(null,i);for(;l.length&&ae()),p()}function v(e,t){if(!s){var r=O((t,...r)=>{if(a--,t===!1){o=!0;return}if(r.length<2&&([r]=r),t){var l={};if(Object.keys(i).forEach(e=>{l[e]=i[e]}),l[e]=r,s=!0,c=Object.create(null),o)return;n(t,l)}else i[e]=r,g(e)});a++;var l=h(t[t.length-1]);t.length>1?l(i,r):l(r)}}function y(){for(var e,t=0;u.length;)e=u.pop(),t++,b(e).forEach(e=>{--d[e]===0&&u.push(e)});if(t!==r)throw Error(`async.auto cannot execute tasks due to a recursive dependency`)}function b(t){var n=[];return Object.keys(e).forEach(r=>{let i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)}),n}return n[H]}var ae=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,oe=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,se=/,/,ce=/(=.+)?(\s*)$/;function le(e){let t=``,n=0,r=e.indexOf(`*/`);for(;ne.replace(ce,``).trim())}function U(e,t){var n={};return Object.keys(e).forEach(t=>{var r=e[t],i,a=f(r),o=!a&&r.length===1||a&&r.length===0;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(i.length>0?s:r);else if(o)n[t]=r;else{if(i=ue(r),r.length===0&&!a&&i.length===0)throw Error(`autoInject task functions require explicit parameters.`);a||i.pop(),n[t]=i.concat(s)}function s(e,t){var n=i.map(t=>e[t]);n.push(t),h(r)(...n)}}),ie(n,t)}class de{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,--this.length,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):fe(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):fe(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function fe(e,t){e.length=1,e.head=e.tail=t}function pe(e,t,n){if(t==null)t=1;else if(t===0)throw RangeError(`Concurrency must not be zero`);var r=h(e),i=0,a=[];let o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){o[e].push(t)}function l(e,t){let n=(...r)=>{u(e,n),t(...r)};o[e].push(n)}function u(e,t){if(!e)return Object.keys(o).forEach(e=>o[e]=[]);if(!t)return o[e]=[];o[e]=o[e].filter(e=>e!==t)}function d(e,...t){o[e].forEach(e=>e(...t))}var f=!1;function p(e,t,n,r){if(r!=null&&typeof r!=`function`)throw Error(`task callback must be a function`);b.started=!0;var i,a;function o(e,...t){if(e)return n?a(e):i();if(t.length<=1)return i(t[0]);i(t)}var s=b._createTaskItem(e,n?o:r||o);if(t?b._tasks.unshift(s):b._tasks.push(s),f||(f=!0,c(()=>{f=!1,b.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function m(e){return function(t,...n){--i;for(var r=0,o=e.length;r0&&a.splice(c,1),s.callback(t,...n),t!=null&&d(`error`,t,s.data)}i<=b.concurrency-b.buffer&&d(`unsaturated`),b.idle()&&d(`drain`),b.process()}}function g(e){return e.length===0&&b.idle()?(c(()=>d(`drain`)),!0):!1}let v=e=>t=>{if(!t)return new Promise((t,n)=>{l(e,(e,r)=>{if(e)return n(e);t(r)})});u(e),s(e,t)};var y=!1,b={_tasks:new de,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*b._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!1,!1,t)):p(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!1,!0,t)):p(e,!1,!0,t)},kill(){u(),b._tasks.empty()},unshift(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!0,!1,t)):p(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!0,!0,t)):p(e,!0,!0,t)},remove(e){b._tasks.remove(e)},process(){if(!y){for(y=!0;!b.paused&&i{i(t,e,(e,n)=>{t=n,r(e)})},e=>r(e,t))}var ge=g(he,4);function _e(...e){var t=e.map(h);return function(...e){var n=this,r=e[e.length-1];return typeof r==`function`?e.pop():r=re(),ge(t,e,(e,t,r)=>{t.apply(n,e.concat((e,...t)=>{r(e,t)}))},(e,t)=>r(e,...t)),r[H]}}function ve(...e){return _e(...e.reverse())}function ye(e,t,n,r){return y(A(t),e,n,r)}var be=g(ye,4);function xe(e,t,n,r){var i=h(n);return be(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],i=0;i{var o=!1,s;let c=h(i);n(r,(n,r,i)=>{c(n,(r,a)=>{if(r||r===!1)return i(r);if(e(a)&&!s)return o=!0,s=t(!0,n),i(null,x);i()})},e=>{if(e)return a(e);a(null,o?s:t(!1))})}}function ke(e,t,n){return Oe(e=>e,(e,t)=>t)(I,e,t,n)}var Ae=g(ke,3);function je(e,t,n,r){return Oe(e=>e,(e,t)=>t)(A(t),e,n,r)}var Me=g(je,4);function Ne(e,t,n){return Oe(e=>e,(e,t)=>t)(A(1),e,t,n)}var Pe=g(Ne,3);function Fe(e){return(t,...n)=>h(t)(...n,(t,...n)=>{typeof console==`object`&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}var Ie=Fe(`dir`);function Le(e,t,n){n=O(n);var r=h(e),i=h(t),a;function o(e,...t){if(e)return n(e);e!==!1&&(a=t,i(...t,s))}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return s(null,!0)}var Re=g(Le,3);function ze(e,t,n){let r=h(t);return Re(e,(...e)=>{let t=e.pop();r(...e,(e,n)=>t(e,!n))},n)}function Be(e){return(t,n,r)=>e(t,r)}function Ve(e,t,n){return I(e,Be(h(t)),n)}var He=g(Ve,3);function Ue(e,t,n,r){return A(t)(e,Be(h(n)),r)}var We=g(Ue,4);function Ge(e,t,n){return We(e,1,t,n)}var Ke=g(Ge,3);function qe(e){return f(e)?e:function(...t){var n=t.pop(),r=!0;t.push((...e)=>{r?c(()=>n(...e)):n(...e)}),e.apply(this,t),r=!1}}function Je(e,t,n){return Oe(e=>!e,e=>!e)(I,e,t,n)}var Ye=g(Je,3);function Xe(e,t,n,r){return Oe(e=>!e,e=>!e)(A(t),e,n,r)}var Ze=g(Xe,4);function Qe(e,t,n){return Oe(e=>!e,e=>!e)(B,e,t,n)}var $e=g(Qe,3);function et(e,t,n,r){var i=Array(t.length);e(t,(e,t,r)=>{n(e,(e,n)=>{i[t]=!!n,r(e)})},e=>{if(e)return r(e);for(var n=[],a=0;a{n(e,(n,a)=>{if(n)return r(n);a&&i.push({index:t,value:e}),r(n)})},e=>{if(e)return r(e);r(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function nt(e,t,n,r){return(b(t)?et:tt)(e,t,h(n),r)}function rt(e,t,n){return nt(I,e,t,n)}var it=g(rt,3);function at(e,t,n,r){return nt(A(t),e,n,r)}var ot=g(at,4);function st(e,t,n){return nt(B,e,t,n)}var ct=g(st,3);function lt(e,t){var n=O(t),r=h(qe(e));function i(e){if(e)return n(e);e!==!1&&r(i)}return i()}var ut=g(lt,2);function dt(e,t,n,r){var i=h(n);return be(e,t,(e,t)=>{i(e,(n,r)=>n?t(n):t(n,{key:r,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:i}=Object.prototype,a=0;a{a(e,t,(e,r)=>{if(e)return n(e);i[t]=r,n(e)})},e=>r(e,i))}var _t=g(gt,4);function vt(e,t,n){return _t(e,1/0,t,n)}function yt(e,t,n){return _t(e,1,t,n)}function bt(e,t=e=>e){var r=Object.create(null),i=Object.create(null),a=h(e),o=n((e,n)=>{var o=t(...e);o in r?c(()=>n(null,...r[o])):o in i?i[o].push(n):(i[o]=[n],a(...e,(e,...t)=>{e||(r[o]=t);var n=i[o];delete i[o];for(var a=0,s=n.length;a{var r=b(t)?[]:{};e(t,(e,t,n)=>{h(e)((e,...i)=>{i.length<2&&([i]=i),r[t]=i,n(e)})},e=>n(e,r))},3);function Ct(e,t){return St(I,e,t)}function wt(e,t,n){return St(A(t),e,n)}function Tt(e,t){var n=h(e);return pe((e,t)=>{n(e[0],t)},t,1)}class Et{constructor(){this.heap=[],this.pushCount=-(2**53-1)}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&kt(this.heap[e],this.heap[t=Ot(e)]);){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}percDown(e){let t;for(;(t=Dt(e))=0;e--)this.percDown(e);return this}}function Dt(e){return(e<<1)+1}function Ot(e){return(e+1>>1)-1}function kt(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t,callback:n});function a(e,t){return Array.isArray(e)?e.map(e=>({data:e,priority:t})):{data:e,priority:t}}return n.push=function(e,t=0,n){return r(a(e,t),n)},n.pushAsync=function(e,t=0,n){return i(a(e,t),n)},delete n.unshift,delete n.unshiftAsync,n}function jt(e,t){if(t=S(t),!Array.isArray(e))return t(TypeError(`First argument to race must be an array of functions`));if(!e.length)return t();for(var n=0,r=e.length;n{let r={};if(e&&(r.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),r.value=i}n(null,r)}),t.apply(this,e)})}function Ft(e){var t;return Array.isArray(e)?t=e.map(Pt):(t={},Object.keys(e).forEach(n=>{t[n]=Pt.call(this,e[n])})),t}function It(e,t,n,r){let i=h(n);return nt(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},r)}function Lt(e,t,n){return It(I,e,t,n)}var Rt=g(Lt,3);function zt(e,t,n,r){return It(A(t),e,n,r)}var Bt=g(zt,4);function Vt(e,t,n){return It(B,e,t,n)}var Ht=g(Vt,3);function Ut(e){return function(){return e}}function Wt(e,t,n){var r={times:5,intervalFunc:Ut(0)};if(arguments.length<3&&typeof e==`function`?(n=t||re(),t=e):(Gt(r,e),n||=re()),typeof t!=`function`)throw Error(`Invalid arguments for async.retry`);var i=h(t),a=1;function o(){i((e,...t)=>{e!==!1&&(e&&a++{(t.lengthe)(I,e,t,n)}var Yt=g(Jt,3);function Xt(e,t,n,r){return Oe(Boolean,e=>e)(A(t),e,n,r)}var Zt=g(Xt,4);function Qt(e,t,n){return Oe(Boolean,e=>e)(B,e,t,n)}var $t=g(Qt,3);function en(e,t,n){var r=h(t);return R(e,(e,t)=>{r(e,(n,r)=>{if(n)return t(n);t(n,{value:e,criteria:r})})},(e,t)=>{if(e)return n(e);n(null,t.sort(i).map(e=>e.value))});function i(e,t){var n=e.criteria,r=t.criteria;return nr?1:0}}var tn=g(en,3);function nn(e,t,r){var i=h(e);return n((n,a)=>{var o=!1,s;function c(){var t=e.name||`anonymous`,n=Error(`Callback function "`+t+`" timed out.`);n.code=`ETIMEDOUT`,r&&(n.info=r),o=!0,a(n)}n.push((...e)=>{o||(a(...e),clearTimeout(s))}),s=setTimeout(c,t),i(...n)})}function rn(e){for(var t=Array(e);e--;)t[e]=e;return t}function an(e,t,n,r){var i=h(n);return be(rn(e),t,i,r)}function on(e,t,n){return an(e,1/0,t,n)}function sn(e,t,n){return an(e,1,t,n)}function cn(e,t,n,r){arguments.length<=3&&typeof t==`function`&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=S(r||re());var i=h(n);return I(e,(e,n,r)=>{i(t,e,n,r)},e=>r(e,t)),r[H]}function ln(e,t){var n=null,r;return Ke(e,(e,t)=>{h(e)((e,...i)=>{if(e===!1)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})})},()=>t(n,r))}var un=g(ln);function dn(e){return(...t)=>(e.unmemoized||e)(...t)}function fn(e,t,n){n=O(n);var r=h(t),i=h(e),a=[];function o(e,...t){if(e)return n(e);a=t,e!==!1&&i(s)}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return i(s)}var pn=g(fn,3);function mn(e,t,n){let r=h(e);return pn(e=>r((t,n)=>e(t,!n)),t,n)}function hn(e,t){if(t=S(t),!Array.isArray(e))return t(Error(`First argument to waterfall must be an array of functions`));if(!e.length)return t();var n=0;function r(t){h(e[n++])(...t,O(i))}function i(i,...a){if(i!==!1){if(i||n===e.length)return t(i,...a);r(a)}}r([])}var gn=g(hn),_n={apply:t,applyEach:z,applyEachSeries:ne,asyncify:l,auto:ie,autoInject:U,cargo:W,cargoQueue:me,compose:ve,concat:we,concatLimit:Se,concatSeries:Ee,constant:De,detect:Ae,detectLimit:Me,detectSeries:Pe,dir:Ie,doUntil:ze,doWhilst:Re,each:He,eachLimit:We,eachOf:I,eachOfLimit:M,eachOfSeries:B,eachSeries:Ke,ensureAsync:qe,every:Ye,everyLimit:Ze,everySeries:$e,filter:it,filterLimit:ot,filterSeries:ct,forever:ut,groupBy:pt,groupByLimit:ft,groupBySeries:mt,log:ht,map:R,mapLimit:be,mapSeries:V,mapValues:vt,mapValuesLimit:_t,mapValuesSeries:yt,memoize:bt,nextTick:xt,parallel:Ct,parallelLimit:wt,priorityQueue:At,queue:Tt,race:Mt,reduce:ge,reduceRight:Nt,reflect:Pt,reflectAll:Ft,reject:Rt,rejectLimit:Bt,rejectSeries:Ht,retry:Wt,retryable:Kt,seq:_e,series:qt,setImmediate:c,some:Yt,someLimit:Zt,someSeries:$t,sortBy:tn,timeout:nn,times:on,timesLimit:an,timesSeries:sn,transform:cn,tryEach:un,unmemoize:dn,until:mn,waterfall:gn,whilst:pn,all:Ye,allLimit:Ze,allSeries:$e,any:Yt,anyLimit:Zt,anySeries:$t,find:Ae,findLimit:Me,findSeries:Pe,flatMap:we,flatMapLimit:Se,flatMapSeries:Ee,forEach:He,forEachSeries:Ke,forEachLimit:We,forEachOf:I,forEachOfSeries:B,forEachOfLimit:M,inject:ge,foldl:ge,foldr:Nt,select:it,selectLimit:ot,selectSeries:ct,wrapSync:l,during:pn,doDuring:Re};e.all=Ye,e.allLimit=Ze,e.allSeries=$e,e.any=Yt,e.anyLimit=Zt,e.anySeries=$t,e.apply=t,e.applyEach=z,e.applyEachSeries=ne,e.asyncify=l,e.auto=ie,e.autoInject=U,e.cargo=W,e.cargoQueue=me,e.compose=ve,e.concat=we,e.concatLimit=Se,e.concatSeries=Ee,e.constant=De,e.default=_n,e.detect=Ae,e.detectLimit=Me,e.detectSeries=Pe,e.dir=Ie,e.doDuring=Re,e.doUntil=ze,e.doWhilst=Re,e.during=pn,e.each=He,e.eachLimit=We,e.eachOf=I,e.eachOfLimit=M,e.eachOfSeries=B,e.eachSeries=Ke,e.ensureAsync=qe,e.every=Ye,e.everyLimit=Ze,e.everySeries=$e,e.filter=it,e.filterLimit=ot,e.filterSeries=ct,e.find=Ae,e.findLimit=Me,e.findSeries=Pe,e.flatMap=we,e.flatMapLimit=Se,e.flatMapSeries=Ee,e.foldl=ge,e.foldr=Nt,e.forEach=He,e.forEachLimit=We,e.forEachOf=I,e.forEachOfLimit=M,e.forEachOfSeries=B,e.forEachSeries=Ke,e.forever=ut,e.groupBy=pt,e.groupByLimit=ft,e.groupBySeries=mt,e.inject=ge,e.log=ht,e.map=R,e.mapLimit=be,e.mapSeries=V,e.mapValues=vt,e.mapValuesLimit=_t,e.mapValuesSeries=yt,e.memoize=bt,e.nextTick=xt,e.parallel=Ct,e.parallelLimit=wt,e.priorityQueue=At,e.queue=Tt,e.race=Mt,e.reduce=ge,e.reduceRight=Nt,e.reflect=Pt,e.reflectAll=Ft,e.reject=Rt,e.rejectLimit=Bt,e.rejectSeries=Ht,e.retry=Wt,e.retryable=Kt,e.select=it,e.selectLimit=ot,e.selectSeries=ct,e.seq=_e,e.series=qt,e.setImmediate=c,e.some=Yt,e.someLimit=Zt,e.someSeries=$t,e.sortBy=tn,e.timeout=nn,e.times=on,e.timesLimit=an,e.timesSeries=sn,e.transform=cn,e.tryEach=un,e.unmemoize=dn,e.until=mn,e.waterfall=gn,e.whilst=pn,e.wrapSync=l,Object.defineProperty(e,`__esModule`,{value:!0})}))})),jk=U(((e,t)=>{var n=W(`constants`),r=process.cwd,i=null,a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||=r.call(process),i};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var o=process.chdir;process.chdir=function(e){i=null,o.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,o)}t.exports=s;function s(e){n.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),a===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){if(t){i&&i(t);return}e.fchmod(n,r,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),a=!0,o;try{o=e.fchmodSync(i,r),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function r(e){n.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,r,i,a){e.open(t,n.O_SYMLINK,function(t,n){if(t){a&&a(t);return}e.futimes(n,r,i,function(t){e.close(n,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,r,i){var a=e.openSync(t,n.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,r,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function o(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),Mk=U(((e,t)=>{var n=W(`stream`).Stream;t.exports=r;function r(e){return{ReadStream:t,WriteStream:r};function t(r,i){if(!(this instanceof t))return new t(r,i);n.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,i||={};for(var o=Object.keys(i),s=0,c=o.length;sthis.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function r(t,i){if(!(this instanceof r))return new r(t,i);n.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i||={};for(var a=Object.keys(i),o=0,s=a.length;o= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),Nk=U(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),Pk=U(((e,t)=>{var n=W(`fs`),r=jk(),i=Mk(),a=Nk(),o=W(`util`),s,c;typeof Symbol==`function`&&typeof Symbol.for==`function`?(s=Symbol.for(`graceful-fs.queue`),c=Symbol.for(`graceful-fs.previous`)):(s=`___graceful-fs.queue`,c=`___graceful-fs.previous`);function l(){}function u(e,t){Object.defineProperty(e,s,{get:function(){return t}})}var d=l;o.debuglog?d=o.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(d=function(){var e=o.format.apply(o,arguments);e=`GFS4: `+e.split(/\n/).join(` -GFS4: `),console.error(e)}),n[s]||(u(n,global[s]||[]),n.close=(function(e){function t(t,r){return e.call(n,t,function(e){e||h(),typeof r==`function`&&r.apply(this,arguments)})}return Object.defineProperty(t,c,{value:e}),t})(n.close),n.closeSync=(function(e){function t(t){e.apply(n,arguments),h()}return Object.defineProperty(t,c,{value:e}),t})(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){d(n[s]),W(`assert`).equal(n[s].length,0)})),global[s]||u(global,n[s]),t.exports=f(a(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(t.exports=f(n),n.__patched=!0);function f(e){r(e),e.gracefulify=f,e.createReadStream=E,e.createWriteStream=D;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?p([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var a=e.writeFile;e.writeFile=o;function o(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,o){return a(e,t,n,function(a){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([i,[e,t,n,r],a,o||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var m=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=m.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=i(e);S=g.ReadStream,w=g.WriteStream}var v=e.ReadStream;v&&(S.prototype=Object.create(v.prototype),S.prototype.open=C);var y=e.WriteStream;y&&(w.prototype=Object.create(y.prototype),w.prototype.open=T),Object.defineProperty(e,`ReadStream`,{get:function(){return S},set:function(e){S=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return w},set:function(e){w=e},enumerable:!0,configurable:!0});var b=S;Object.defineProperty(e,`FileReadStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});var x=w;Object.defineProperty(e,`FileWriteStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0});function S(e,t){return this instanceof S?(v.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function C(){var e=this;k(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function w(e,t){return this instanceof w?(y.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function T(){var e=this;k(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function E(t,n){return new e.ReadStream(t,n)}function D(t,n){return new e.WriteStream(t,n)}var O=e.open;e.open=k;function k(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return O(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function p(e){d(`ENQUEUE`,e[0].name,e[1]),n[s].push(e),g()}var m;function h(){for(var e=Date.now(),t=0;t2&&(n[s][t][3]=e,n[s][t][4]=e);g()}function g(){if(clearTimeout(m),m=void 0,n[s].length!==0){var e=n[s].shift(),t=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)d(`RETRY`,t.name,r),t.apply(null,r);else if(Date.now()-a>=6e4){d(`TIMEOUT`,t.name,r);var c=r.pop();typeof c==`function`&&c.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(d(`RETRY`,t.name,r),t.apply(null,r.concat([a]))):n[s].push(e)}m===void 0&&(m=setTimeout(g,0))}}})),Fk=U(((e,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n})),Ik=U(((e,t)=>{typeof process>`u`||!process.version||process.version.indexOf(`v0.`)===0||process.version.indexOf(`v1.`)===0&&process.version.indexOf(`v1.8.`)!==0?t.exports={nextTick:n}:t.exports=process;function n(e,t,n,r){if(typeof e!=`function`)throw TypeError(`"callback" argument must be a function`);var i=arguments.length,a,o;switch(i){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,n)});case 4:return process.nextTick(function(){e.call(null,t,n,r)});default:for(a=Array(i-1),o=0;o{var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}})),Rk=U(((e,t)=>{t.exports=W(`stream`)})),zk=U(((e,t)=>{var n=W(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Bk=U((e=>{function t(e){return Array.isArray?Array.isArray(e):h(e)===`[object Array]`}e.isArray=t;function n(e){return typeof e==`boolean`}e.isBoolean=n;function r(e){return e===null}e.isNull=r;function i(e){return e==null}e.isNullOrUndefined=i;function a(e){return typeof e==`number`}e.isNumber=a;function o(e){return typeof e==`string`}e.isString=o;function s(e){return typeof e==`symbol`}e.isSymbol=s;function c(e){return e===void 0}e.isUndefined=c;function l(e){return h(e)===`[object RegExp]`}e.isRegExp=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u;function d(e){return h(e)===`[object Date]`}e.isDate=d;function f(e){return h(e)===`[object Error]`||e instanceof Error}e.isError=f;function p(e){return typeof e==`function`}e.isFunction=p;function m(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}e.isPrimitive=m,e.isBuffer=W(`buffer`).Buffer.isBuffer;function h(e){return Object.prototype.toString.call(e)}})),Vk=U(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Hk=U(((e,t)=>{try{var n=W(`util`);if(typeof n.inherits!=`function`)throw``;t.exports=n.inherits}catch{t.exports=Vk()}})),Uk=U(((e,t)=>{function n(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var r=zk().Buffer,i=W(`util`);function a(e,t,n){e.copy(t,n)}t.exports=function(){function e(){n(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(this.length===0)return r.alloc(0);for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)a(n.data,t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+` `+e})})),Wk=U(((e,t)=>{var n=Ik();function r(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(a,r,e)):n.nextTick(a,r,e):t&&t(e)}),this)}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit(`error`,t)}t.exports={destroy:r,undestroy:i}})),Gk=U(((e,t)=>{t.exports=W(`util`).deprecate})),Kk=U(((e,t)=>{var n=Ik();t.exports=v;function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){F(t,e)}}var i=!process.browser&&[`v0.10`,`v0.9.`].indexOf(process.version.slice(0,5))>-1?setImmediate:n.nextTick,a;v.WritableState=h;var o=Object.create(Bk());o.inherits=Hk();var s={deprecate:Gk()},c=Rk(),l=zk().Buffer,u=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function d(e){return l.from(e)}function f(e){return l.isBuffer(e)||e instanceof u}var p=Wk();o.inherits(v,c);function m(){}function h(e,t){a||=qk(),e||={};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,o=e.writableHighWaterMark,s=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:n&&(o||o===0)?this.highWaterMark=o:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=e.decodeStrings!==!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){E(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(h.prototype,`buffer`,{get:s.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var g;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(g=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return g.call(this,e)?!0:this===v?e&&e._writableState instanceof h:!1}})):g=function(e){return e instanceof this};function v(e){if(a||=qk(),!g.call(v,this)&&!(this instanceof a))return new v(e);this._writableState=new h(e,this),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),c.call(this)}v.prototype.pipe=function(){this.emit(`error`,Error(`Cannot pipe, not readable`))};function y(e,t){var r=Error(`write after end`);e.emit(`error`,r),n.nextTick(t,r)}function b(e,t,r,i){var a=!0,o=!1;return r===null?o=TypeError(`May not write null values to stream`):typeof r!=`string`&&r!==void 0&&!t.objectMode&&(o=TypeError(`Invalid non-string/buffer chunk`)),o&&(e.emit(`error`,o),n.nextTick(i,o),a=!1),a}v.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&f(e);return a&&!l.isBuffer(e)&&(e=d(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=m),r.ended?y(this,n):(a||b(this,r,e,n))&&(r.pendingcb++,i=S(this,r,a,e,t,n)),i},v.prototype.cork=function(){var e=this._writableState;e.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&k(this,e))},v.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw TypeError(`Unknown encoding: `+e);return this._writableState.defaultEncoding=e,this};function x(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=l.from(t,n)),t}Object.defineProperty(v.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function S(e,t,n,r,i,a){if(!n){var o=x(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length{var n=Ik(),r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=u;var i=Object.create(Bk());i.inherits=Hk();var a=Yk(),o=Kk();i.inherits(u,a);for(var s=r(o.prototype),c=0;c{var t=zk().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):``}})),Yk=U(((e,t)=>{var n=Ik();t.exports=x;var r=Lk(),i;x.ReadableState=b,W(`events`).EventEmitter;var a=function(e,t){return e.listeners(t).length},o=Rk(),s=zk().Buffer,c=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function l(e){return s.from(e)}function u(e){return s.isBuffer(e)||e instanceof c}var d=Object.create(Bk());d.inherits=Hk();var f=W(`util`),p=void 0;p=f&&f.debuglog?f.debuglog(`stream`):function(){};var m=Uk(),h=Wk(),g;d.inherits(x,o);var v=[`error`,`close`,`destroy`,`pause`,`resume`];function y(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function b(e,t){i||=qk(),e||={};var n=t instanceof i;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,a=e.readableHighWaterMark,o=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:n&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||=Jk().StringDecoder,this.decoder=new g(e.encoding),this.encoding=e.encoding)}function x(e){if(i||=qk(),!(this instanceof x))return new x(e);this._readableState=new b(e,this),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),o.call(this)}Object.defineProperty(x.prototype,`destroyed`,{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(e,t){this.push(null),t(e)},x.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=s.from(e,t),t=``),r=!0),S(this,e,t,!1,r)},x.prototype.unshift=function(e){return S(this,e,null,!0,!1)};function S(e,t,n,r,i){var a=e._readableState;if(t===null)a.reading=!1,k(e,a);else{var o;i||(o=w(a,t)),o?e.emit(`error`,o):a.objectMode||t&&t.length>0?(typeof t!=`string`&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=l(t)),r?a.endEmitted?e.emit(`error`,Error(`stream.unshift() after end event`)):C(e,a,t,!0):a.ended?e.emit(`error`,Error(`stream.push() after EOF`)):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||t.length!==0?C(e,a,t,!1):M(e,a)):C(e,a,t,!1))):r||(a.reading=!1)}return T(a)}function C(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(e.emit(`data`,n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&A(e)),M(e,t)}function w(e,t){var n;return!u(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=TypeError(`Invalid non-string/buffer chunk`)),n}function T(e){return!e.ended&&(e.needReadable||e.length=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function O(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}x.prototype.read=function(e){p(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?V(this):A(this),null;if(e=O(e,t),e===0&&t.ended)return t.length===0&&V(this),null;var r=t.needReadable;p(`need readable`,r),(t.length===0||t.length-e0?z(e,t):null;return i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),i!==null&&this.emit(`data`,i),i};function k(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,A(e)}}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p(`emitReadable`,t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(j,e):j(e))}function j(e){p(`emit readable`),e.emit(`readable`),R(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length1&&H(i.pipes,e)!==-1)&&!u&&(p(`false write response, pause`,i.awaitDrain),i.awaitDrain++,f=!0),r.pause())}function h(t){p(`onerror`,t),b(),e.removeListener(`error`,h),a(e,`error`)===0&&e.emit(`error`,t)}y(e,`error`,h);function g(){e.removeListener(`finish`,v),b()}e.once(`close`,g);function v(){p(`onfinish`),e.removeListener(`close`,g),b()}e.once(`finish`,v);function b(){p(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),i.flowing||(p(`pipe resume`),r.resume()),e};function P(e){return function(){var t=e._readableState;p(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&a(e,`data`)&&(t.flowing=!0,R(e))}}x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=ee(e,t.buffer,t.decoder),n}function ee(e,t,n){var r;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),e-=o,e===0){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}function te(e,t){var n=s.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),e-=o,e===0){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function V(e){var t=e._readableState;if(t.length>0)throw Error(`"endReadable()" called on non-empty stream`);t.endEmitted||(t.ended=!0,n.nextTick(ne,t,e))}function ne(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`))}function H(e,t){for(var n=0,r=e.length;n{t.exports=a;var n=qk(),r=Object.create(Bk());r.inherits=Hk(),r.inherits(a,n);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit(`error`,Error(`write callback called multiple times`));n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{t.exports=i;var n=Xk(),r=Object.create(Bk());r.inherits=Hk(),r.inherits(i,n);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),Qk=U(((e,t)=>{var n=W(`stream`);process.env.READABLE_STREAM===`disable`&&n?(t.exports=n,e=t.exports=n.Readable,e.Readable=n.Readable,e.Writable=n.Writable,e.Duplex=n.Duplex,e.Transform=n.Transform,e.PassThrough=n.PassThrough,e.Stream=n):(e=t.exports=Yk(),e.Stream=n||e,e.Readable=e,e.Writable=Kk(),e.Duplex=qk(),e.Transform=Xk(),e.PassThrough=Zk())})),$k=U(((e,t)=>{t.exports=Qk().PassThrough})),eA=U(((e,t)=>{var n=W(`util`),r=$k();t.exports={Readable:a,Writable:o},n.inherits(a,r),n.inherits(o,r);function i(e,t,n){e[t]=function(){return delete e[t],n.apply(this,arguments),this[t].apply(this,arguments)}}function a(e,t){if(!(this instanceof a))return new a(e,t);r.call(this,t),i(this,`_read`,function(){var n=e.call(this,t),r=this.emit.bind(this,`error`);n.on(`error`,r),n.pipe(this)}),this.emit(`readable`)}function o(e,t){if(!(this instanceof o))return new o(e,t);r.call(this,t),i(this,`_write`,function(){var n=e.call(this,t),r=this.emit.bind(this,`error`);n.on(`error`,r),this.pipe(n)}),this.emit(`writable`)}})),tA=U(((e,t)=>{ +`+t);let[,r]=n;return r.replace(/\s/g,``).split(se).map(e=>e.replace(ce,``).trim())}function U(e,t){var n={};return Object.keys(e).forEach(t=>{var r=e[t],i,a=f(r),o=!a&&r.length===1||a&&r.length===0;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(i.length>0?s:r);else if(o)n[t]=r;else{if(i=ue(r),r.length===0&&!a&&i.length===0)throw Error(`autoInject task functions require explicit parameters.`);a||i.pop(),n[t]=i.concat(s)}function s(e,t){var n=i.map(t=>e[t]);n.push(t),h(r)(...n)}}),ie(n,t)}class de{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,--this.length,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):fe(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):fe(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function fe(e,t){e.length=1,e.head=e.tail=t}function pe(e,t,n){if(t==null)t=1;else if(t===0)throw RangeError(`Concurrency must not be zero`);var r=h(e),i=0,a=[];let o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){o[e].push(t)}function l(e,t){let n=(...r)=>{u(e,n),t(...r)};o[e].push(n)}function u(e,t){if(!e)return Object.keys(o).forEach(e=>o[e]=[]);if(!t)return o[e]=[];o[e]=o[e].filter(e=>e!==t)}function d(e,...t){o[e].forEach(e=>e(...t))}var f=!1;function p(e,t,n,r){if(r!=null&&typeof r!=`function`)throw Error(`task callback must be a function`);b.started=!0;var i,a;function o(e,...t){if(e)return n?a(e):i();if(t.length<=1)return i(t[0]);i(t)}var s=b._createTaskItem(e,n?o:r||o);if(t?b._tasks.unshift(s):b._tasks.push(s),f||(f=!0,c(()=>{f=!1,b.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function m(e){return function(t,...n){--i;for(var r=0,o=e.length;r0&&a.splice(c,1),s.callback(t,...n),t!=null&&d(`error`,t,s.data)}i<=b.concurrency-b.buffer&&d(`unsaturated`),b.idle()&&d(`drain`),b.process()}}function g(e){return e.length===0&&b.idle()?(c(()=>d(`drain`)),!0):!1}let v=e=>t=>{if(!t)return new Promise((t,n)=>{l(e,(e,r)=>{if(e)return n(e);t(r)})});u(e),s(e,t)};var y=!1,b={_tasks:new de,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*b._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!1,!1,t)):p(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!1,!0,t)):p(e,!1,!0,t)},kill(){u(),b._tasks.empty()},unshift(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!0,!1,t)):p(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?g(e)?void 0:e.map(e=>p(e,!0,!0,t)):p(e,!0,!0,t)},remove(e){b._tasks.remove(e)},process(){if(!y){for(y=!0;!b.paused&&i{i(t,e,(e,n)=>{t=n,r(e)})},e=>r(e,t))}var ge=g(he,4);function _e(...e){var t=e.map(h);return function(...e){var n=this,r=e[e.length-1];return typeof r==`function`?e.pop():r=re(),ge(t,e,(e,t,r)=>{t.apply(n,e.concat((e,...t)=>{r(e,t)}))},(e,t)=>r(e,...t)),r[H]}}function ve(...e){return _e(...e.reverse())}function ye(e,t,n,r){return y(A(t),e,n,r)}var be=g(ye,4);function xe(e,t,n,r){var i=h(n);return be(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],i=0;i{var o=!1,s;let c=h(i);n(r,(n,r,i)=>{c(n,(r,a)=>{if(r||r===!1)return i(r);if(e(a)&&!s)return o=!0,s=t(!0,n),i(null,x);i()})},e=>{if(e)return a(e);a(null,o?s:t(!1))})}}function ke(e,t,n){return Oe(e=>e,(e,t)=>t)(I,e,t,n)}var Ae=g(ke,3);function je(e,t,n,r){return Oe(e=>e,(e,t)=>t)(A(t),e,n,r)}var Me=g(je,4);function Ne(e,t,n){return Oe(e=>e,(e,t)=>t)(A(1),e,t,n)}var Pe=g(Ne,3);function Fe(e){return(t,...n)=>h(t)(...n,(t,...n)=>{typeof console==`object`&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}var Ie=Fe(`dir`);function Le(e,t,n){n=O(n);var r=h(e),i=h(t),a;function o(e,...t){if(e)return n(e);e!==!1&&(a=t,i(...t,s))}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return s(null,!0)}var Re=g(Le,3);function ze(e,t,n){let r=h(t);return Re(e,(...e)=>{let t=e.pop();r(...e,(e,n)=>t(e,!n))},n)}function Be(e){return(t,n,r)=>e(t,r)}function Ve(e,t,n){return I(e,Be(h(t)),n)}var He=g(Ve,3);function Ue(e,t,n,r){return A(t)(e,Be(h(n)),r)}var We=g(Ue,4);function Ge(e,t,n){return We(e,1,t,n)}var Ke=g(Ge,3);function qe(e){return f(e)?e:function(...t){var n=t.pop(),r=!0;t.push((...e)=>{r?c(()=>n(...e)):n(...e)}),e.apply(this,t),r=!1}}function Je(e,t,n){return Oe(e=>!e,e=>!e)(I,e,t,n)}var Ye=g(Je,3);function Xe(e,t,n,r){return Oe(e=>!e,e=>!e)(A(t),e,n,r)}var Ze=g(Xe,4);function Qe(e,t,n){return Oe(e=>!e,e=>!e)(B,e,t,n)}var $e=g(Qe,3);function et(e,t,n,r){var i=Array(t.length);e(t,(e,t,r)=>{n(e,(e,n)=>{i[t]=!!n,r(e)})},e=>{if(e)return r(e);for(var n=[],a=0;a{n(e,(n,a)=>{if(n)return r(n);a&&i.push({index:t,value:e}),r(n)})},e=>{if(e)return r(e);r(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function nt(e,t,n,r){return(b(t)?et:tt)(e,t,h(n),r)}function rt(e,t,n){return nt(I,e,t,n)}var it=g(rt,3);function at(e,t,n,r){return nt(A(t),e,n,r)}var ot=g(at,4);function st(e,t,n){return nt(B,e,t,n)}var ct=g(st,3);function lt(e,t){var n=O(t),r=h(qe(e));function i(e){if(e)return n(e);e!==!1&&r(i)}return i()}var ut=g(lt,2);function dt(e,t,n,r){var i=h(n);return be(e,t,(e,t)=>{i(e,(n,r)=>n?t(n):t(n,{key:r,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:i}=Object.prototype,a=0;a{a(e,t,(e,r)=>{if(e)return n(e);i[t]=r,n(e)})},e=>r(e,i))}var _t=g(gt,4);function vt(e,t,n){return _t(e,1/0,t,n)}function yt(e,t,n){return _t(e,1,t,n)}function bt(e,t=e=>e){var r=Object.create(null),i=Object.create(null),a=h(e),o=n((e,n)=>{var o=t(...e);o in r?c(()=>n(null,...r[o])):o in i?i[o].push(n):(i[o]=[n],a(...e,(e,...t)=>{e||(r[o]=t);var n=i[o];delete i[o];for(var a=0,s=n.length;a{var r=b(t)?[]:{};e(t,(e,t,n)=>{h(e)((e,...i)=>{i.length<2&&([i]=i),r[t]=i,n(e)})},e=>n(e,r))},3);function Ct(e,t){return St(I,e,t)}function wt(e,t,n){return St(A(t),e,n)}function Tt(e,t){var n=h(e);return pe((e,t)=>{n(e[0],t)},t,1)}class Et{constructor(){this.heap=[],this.pushCount=-(2**53-1)}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&kt(this.heap[e],this.heap[t=Ot(e)]);){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}percDown(e){let t;for(;(t=Dt(e))=0;e--)this.percDown(e);return this}}function Dt(e){return(e<<1)+1}function Ot(e){return(e+1>>1)-1}function kt(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t,callback:n});function a(e,t){return Array.isArray(e)?e.map(e=>({data:e,priority:t})):{data:e,priority:t}}return n.push=function(e,t=0,n){return r(a(e,t),n)},n.pushAsync=function(e,t=0,n){return i(a(e,t),n)},delete n.unshift,delete n.unshiftAsync,n}function jt(e,t){if(t=S(t),!Array.isArray(e))return t(TypeError(`First argument to race must be an array of functions`));if(!e.length)return t();for(var n=0,r=e.length;n{let r={};if(e&&(r.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),r.value=i}n(null,r)}),t.apply(this,e)})}function Ft(e){var t;return Array.isArray(e)?t=e.map(Pt):(t={},Object.keys(e).forEach(n=>{t[n]=Pt.call(this,e[n])})),t}function It(e,t,n,r){let i=h(n);return nt(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},r)}function Lt(e,t,n){return It(I,e,t,n)}var Rt=g(Lt,3);function zt(e,t,n,r){return It(A(t),e,n,r)}var Bt=g(zt,4);function Vt(e,t,n){return It(B,e,t,n)}var Ht=g(Vt,3);function Ut(e){return function(){return e}}function Wt(e,t,n){var r={times:5,intervalFunc:Ut(0)};if(arguments.length<3&&typeof e==`function`?(n=t||re(),t=e):(Gt(r,e),n||=re()),typeof t!=`function`)throw Error(`Invalid arguments for async.retry`);var i=h(t),a=1;function o(){i((e,...t)=>{e!==!1&&(e&&a++{(t.lengthe)(I,e,t,n)}var Yt=g(Jt,3);function Xt(e,t,n,r){return Oe(Boolean,e=>e)(A(t),e,n,r)}var Zt=g(Xt,4);function Qt(e,t,n){return Oe(Boolean,e=>e)(B,e,t,n)}var $t=g(Qt,3);function en(e,t,n){var r=h(t);return R(e,(e,t)=>{r(e,(n,r)=>{if(n)return t(n);t(n,{value:e,criteria:r})})},(e,t)=>{if(e)return n(e);n(null,t.sort(i).map(e=>e.value))});function i(e,t){var n=e.criteria,r=t.criteria;return nr?1:0}}var tn=g(en,3);function nn(e,t,r){var i=h(e);return n((n,a)=>{var o=!1,s;function c(){var t=e.name||`anonymous`,n=Error(`Callback function "`+t+`" timed out.`);n.code=`ETIMEDOUT`,r&&(n.info=r),o=!0,a(n)}n.push((...e)=>{o||(a(...e),clearTimeout(s))}),s=setTimeout(c,t),i(...n)})}function rn(e){for(var t=Array(e);e--;)t[e]=e;return t}function an(e,t,n,r){var i=h(n);return be(rn(e),t,i,r)}function on(e,t,n){return an(e,1/0,t,n)}function sn(e,t,n){return an(e,1,t,n)}function cn(e,t,n,r){arguments.length<=3&&typeof t==`function`&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=S(r||re());var i=h(n);return I(e,(e,n,r)=>{i(t,e,n,r)},e=>r(e,t)),r[H]}function ln(e,t){var n=null,r;return Ke(e,(e,t)=>{h(e)((e,...i)=>{if(e===!1)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})})},()=>t(n,r))}var un=g(ln);function dn(e){return(...t)=>(e.unmemoized||e)(...t)}function fn(e,t,n){n=O(n);var r=h(t),i=h(e),a=[];function o(e,...t){if(e)return n(e);a=t,e!==!1&&i(s)}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return i(s)}var pn=g(fn,3);function mn(e,t,n){let r=h(e);return pn(e=>r((t,n)=>e(t,!n)),t,n)}function hn(e,t){if(t=S(t),!Array.isArray(e))return t(Error(`First argument to waterfall must be an array of functions`));if(!e.length)return t();var n=0;function r(t){h(e[n++])(...t,O(i))}function i(i,...a){if(i!==!1){if(i||n===e.length)return t(i,...a);r(a)}}r([])}var gn=g(hn),_n={apply:t,applyEach:z,applyEachSeries:ne,asyncify:l,auto:ie,autoInject:U,cargo:W,cargoQueue:me,compose:ve,concat:we,concatLimit:Se,concatSeries:Ee,constant:De,detect:Ae,detectLimit:Me,detectSeries:Pe,dir:Ie,doUntil:ze,doWhilst:Re,each:He,eachLimit:We,eachOf:I,eachOfLimit:M,eachOfSeries:B,eachSeries:Ke,ensureAsync:qe,every:Ye,everyLimit:Ze,everySeries:$e,filter:it,filterLimit:ot,filterSeries:ct,forever:ut,groupBy:pt,groupByLimit:ft,groupBySeries:mt,log:ht,map:R,mapLimit:be,mapSeries:V,mapValues:vt,mapValuesLimit:_t,mapValuesSeries:yt,memoize:bt,nextTick:xt,parallel:Ct,parallelLimit:wt,priorityQueue:At,queue:Tt,race:Mt,reduce:ge,reduceRight:Nt,reflect:Pt,reflectAll:Ft,reject:Rt,rejectLimit:Bt,rejectSeries:Ht,retry:Wt,retryable:Kt,seq:_e,series:qt,setImmediate:c,some:Yt,someLimit:Zt,someSeries:$t,sortBy:tn,timeout:nn,times:on,timesLimit:an,timesSeries:sn,transform:cn,tryEach:un,unmemoize:dn,until:mn,waterfall:gn,whilst:pn,all:Ye,allLimit:Ze,allSeries:$e,any:Yt,anyLimit:Zt,anySeries:$t,find:Ae,findLimit:Me,findSeries:Pe,flatMap:we,flatMapLimit:Se,flatMapSeries:Ee,forEach:He,forEachSeries:Ke,forEachLimit:We,forEachOf:I,forEachOfSeries:B,forEachOfLimit:M,inject:ge,foldl:ge,foldr:Nt,select:it,selectLimit:ot,selectSeries:ct,wrapSync:l,during:pn,doDuring:Re};e.all=Ye,e.allLimit=Ze,e.allSeries=$e,e.any=Yt,e.anyLimit=Zt,e.anySeries=$t,e.apply=t,e.applyEach=z,e.applyEachSeries=ne,e.asyncify=l,e.auto=ie,e.autoInject=U,e.cargo=W,e.cargoQueue=me,e.compose=ve,e.concat=we,e.concatLimit=Se,e.concatSeries=Ee,e.constant=De,e.default=_n,e.detect=Ae,e.detectLimit=Me,e.detectSeries=Pe,e.dir=Ie,e.doDuring=Re,e.doUntil=ze,e.doWhilst=Re,e.during=pn,e.each=He,e.eachLimit=We,e.eachOf=I,e.eachOfLimit=M,e.eachOfSeries=B,e.eachSeries=Ke,e.ensureAsync=qe,e.every=Ye,e.everyLimit=Ze,e.everySeries=$e,e.filter=it,e.filterLimit=ot,e.filterSeries=ct,e.find=Ae,e.findLimit=Me,e.findSeries=Pe,e.flatMap=we,e.flatMapLimit=Se,e.flatMapSeries=Ee,e.foldl=ge,e.foldr=Nt,e.forEach=He,e.forEachLimit=We,e.forEachOf=I,e.forEachOfLimit=M,e.forEachOfSeries=B,e.forEachSeries=Ke,e.forever=ut,e.groupBy=pt,e.groupByLimit=ft,e.groupBySeries=mt,e.inject=ge,e.log=ht,e.map=R,e.mapLimit=be,e.mapSeries=V,e.mapValues=vt,e.mapValuesLimit=_t,e.mapValuesSeries=yt,e.memoize=bt,e.nextTick=xt,e.parallel=Ct,e.parallelLimit=wt,e.priorityQueue=At,e.queue=Tt,e.race=Mt,e.reduce=ge,e.reduceRight=Nt,e.reflect=Pt,e.reflectAll=Ft,e.reject=Rt,e.rejectLimit=Bt,e.rejectSeries=Ht,e.retry=Wt,e.retryable=Kt,e.select=it,e.selectLimit=ot,e.selectSeries=ct,e.seq=_e,e.series=qt,e.setImmediate=c,e.some=Yt,e.someLimit=Zt,e.someSeries=$t,e.sortBy=tn,e.timeout=nn,e.times=on,e.timesLimit=an,e.timesSeries=sn,e.transform=cn,e.tryEach=un,e.unmemoize=dn,e.until=mn,e.waterfall=gn,e.whilst=pn,e.wrapSync=l,Object.defineProperty(e,`__esModule`,{value:!0})}))})),kk=U(((e,t)=>{var n=W(`constants`),r=process.cwd,i=null,a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||=r.call(process),i};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var o=process.chdir;process.chdir=function(e){i=null,o.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,o)}t.exports=s;function s(e){n.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),a===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){if(t){i&&i(t);return}e.fchmod(n,r,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),a=!0,o;try{o=e.fchmodSync(i,r),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function r(e){n.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,r,i,a){e.open(t,n.O_SYMLINK,function(t,n){if(t){a&&a(t);return}e.futimes(n,r,i,function(t){e.close(n,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,r,i){var a=e.openSync(t,n.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,r,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function o(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),Ak=U(((e,t)=>{var n=W(`stream`).Stream;t.exports=r;function r(e){return{ReadStream:t,WriteStream:r};function t(r,i){if(!(this instanceof t))return new t(r,i);n.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,i||={};for(var o=Object.keys(i),s=0,c=o.length;sthis.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function r(t,i){if(!(this instanceof r))return new r(t,i);n.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i||={};for(var a=Object.keys(i),o=0,s=a.length;o= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),jk=U(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),Mk=U(((e,t)=>{var n=W(`fs`),r=kk(),i=Ak(),a=jk(),o=W(`util`),s,c;typeof Symbol==`function`&&typeof Symbol.for==`function`?(s=Symbol.for(`graceful-fs.queue`),c=Symbol.for(`graceful-fs.previous`)):(s=`___graceful-fs.queue`,c=`___graceful-fs.previous`);function l(){}function u(e,t){Object.defineProperty(e,s,{get:function(){return t}})}var d=l;o.debuglog?d=o.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(d=function(){var e=o.format.apply(o,arguments);e=`GFS4: `+e.split(/\n/).join(` +GFS4: `),console.error(e)}),n[s]||(u(n,global[s]||[]),n.close=(function(e){function t(t,r){return e.call(n,t,function(e){e||h(),typeof r==`function`&&r.apply(this,arguments)})}return Object.defineProperty(t,c,{value:e}),t})(n.close),n.closeSync=(function(e){function t(t){e.apply(n,arguments),h()}return Object.defineProperty(t,c,{value:e}),t})(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){d(n[s]),W(`assert`).equal(n[s].length,0)})),global[s]||u(global,n[s]),t.exports=f(a(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(t.exports=f(n),n.__patched=!0);function f(e){r(e),e.gracefulify=f,e.createReadStream=E,e.createWriteStream=D;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?p([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var a=e.writeFile;e.writeFile=o;function o(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,o){return a(e,t,n,function(a){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([i,[e,t,n,r],a,o||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var m=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=m.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=i(e);S=g.ReadStream,w=g.WriteStream}var v=e.ReadStream;v&&(S.prototype=Object.create(v.prototype),S.prototype.open=C);var y=e.WriteStream;y&&(w.prototype=Object.create(y.prototype),w.prototype.open=T),Object.defineProperty(e,`ReadStream`,{get:function(){return S},set:function(e){S=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return w},set:function(e){w=e},enumerable:!0,configurable:!0});var b=S;Object.defineProperty(e,`FileReadStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});var x=w;Object.defineProperty(e,`FileWriteStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0});function S(e,t){return this instanceof S?(v.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function C(){var e=this;k(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function w(e,t){return this instanceof w?(y.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function T(){var e=this;k(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function E(t,n){return new e.ReadStream(t,n)}function D(t,n){return new e.WriteStream(t,n)}var O=e.open;e.open=k;function k(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return O(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function p(e){d(`ENQUEUE`,e[0].name,e[1]),n[s].push(e),g()}var m;function h(){for(var e=Date.now(),t=0;t2&&(n[s][t][3]=e,n[s][t][4]=e);g()}function g(){if(clearTimeout(m),m=void 0,n[s].length!==0){var e=n[s].shift(),t=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)d(`RETRY`,t.name,r),t.apply(null,r);else if(Date.now()-a>=6e4){d(`TIMEOUT`,t.name,r);var c=r.pop();typeof c==`function`&&c.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(d(`RETRY`,t.name,r),t.apply(null,r.concat([a]))):n[s].push(e)}m===void 0&&(m=setTimeout(g,0))}}})),Nk=U(((e,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n})),Pk=U(((e,t)=>{typeof process>`u`||!process.version||process.version.indexOf(`v0.`)===0||process.version.indexOf(`v1.`)===0&&process.version.indexOf(`v1.8.`)!==0?t.exports={nextTick:n}:t.exports=process;function n(e,t,n,r){if(typeof e!=`function`)throw TypeError(`"callback" argument must be a function`);var i=arguments.length,a,o;switch(i){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,n)});case 4:return process.nextTick(function(){e.call(null,t,n,r)});default:for(a=Array(i-1),o=0;o{var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}})),Ik=U(((e,t)=>{t.exports=W(`stream`)})),Lk=U(((e,t)=>{var n=W(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Rk=U((e=>{function t(e){return Array.isArray?Array.isArray(e):h(e)===`[object Array]`}e.isArray=t;function n(e){return typeof e==`boolean`}e.isBoolean=n;function r(e){return e===null}e.isNull=r;function i(e){return e==null}e.isNullOrUndefined=i;function a(e){return typeof e==`number`}e.isNumber=a;function o(e){return typeof e==`string`}e.isString=o;function s(e){return typeof e==`symbol`}e.isSymbol=s;function c(e){return e===void 0}e.isUndefined=c;function l(e){return h(e)===`[object RegExp]`}e.isRegExp=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u;function d(e){return h(e)===`[object Date]`}e.isDate=d;function f(e){return h(e)===`[object Error]`||e instanceof Error}e.isError=f;function p(e){return typeof e==`function`}e.isFunction=p;function m(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}e.isPrimitive=m,e.isBuffer=W(`buffer`).Buffer.isBuffer;function h(e){return Object.prototype.toString.call(e)}})),zk=U(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Bk=U(((e,t)=>{try{var n=W(`util`);if(typeof n.inherits!=`function`)throw``;t.exports=n.inherits}catch{t.exports=zk()}})),Vk=U(((e,t)=>{function n(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var r=Lk().Buffer,i=W(`util`);function a(e,t,n){e.copy(t,n)}t.exports=function(){function e(){n(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(this.length===0)return r.alloc(0);for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)a(n.data,t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+` `+e})})),Hk=U(((e,t)=>{var n=Pk();function r(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(a,r,e)):n.nextTick(a,r,e):t&&t(e)}),this)}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit(`error`,t)}t.exports={destroy:r,undestroy:i}})),Uk=U(((e,t)=>{t.exports=W(`util`).deprecate})),Wk=U(((e,t)=>{var n=Pk();t.exports=v;function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){F(t,e)}}var i=!process.browser&&[`v0.10`,`v0.9.`].indexOf(process.version.slice(0,5))>-1?setImmediate:n.nextTick,a;v.WritableState=h;var o=Object.create(Rk());o.inherits=Bk();var s={deprecate:Uk()},c=Ik(),l=Lk().Buffer,u=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function d(e){return l.from(e)}function f(e){return l.isBuffer(e)||e instanceof u}var p=Hk();o.inherits(v,c);function m(){}function h(e,t){a||=Gk(),e||={};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,o=e.writableHighWaterMark,s=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:n&&(o||o===0)?this.highWaterMark=o:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=e.decodeStrings!==!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){E(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(h.prototype,`buffer`,{get:s.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var g;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(g=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return g.call(this,e)?!0:this===v?e&&e._writableState instanceof h:!1}})):g=function(e){return e instanceof this};function v(e){if(a||=Gk(),!g.call(v,this)&&!(this instanceof a))return new v(e);this._writableState=new h(e,this),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),c.call(this)}v.prototype.pipe=function(){this.emit(`error`,Error(`Cannot pipe, not readable`))};function y(e,t){var r=Error(`write after end`);e.emit(`error`,r),n.nextTick(t,r)}function b(e,t,r,i){var a=!0,o=!1;return r===null?o=TypeError(`May not write null values to stream`):typeof r!=`string`&&r!==void 0&&!t.objectMode&&(o=TypeError(`Invalid non-string/buffer chunk`)),o&&(e.emit(`error`,o),n.nextTick(i,o),a=!1),a}v.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&f(e);return a&&!l.isBuffer(e)&&(e=d(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=m),r.ended?y(this,n):(a||b(this,r,e,n))&&(r.pendingcb++,i=S(this,r,a,e,t,n)),i},v.prototype.cork=function(){var e=this._writableState;e.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&k(this,e))},v.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw TypeError(`Unknown encoding: `+e);return this._writableState.defaultEncoding=e,this};function x(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=l.from(t,n)),t}Object.defineProperty(v.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function S(e,t,n,r,i,a){if(!n){var o=x(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length{var n=Pk(),r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=u;var i=Object.create(Rk());i.inherits=Bk();var a=qk(),o=Wk();i.inherits(u,a);for(var s=r(o.prototype),c=0;c{var t=Lk().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):``}})),qk=U(((e,t)=>{var n=Pk();t.exports=x;var r=Fk(),i;x.ReadableState=b,W(`events`).EventEmitter;var a=function(e,t){return e.listeners(t).length},o=Ik(),s=Lk().Buffer,c=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function l(e){return s.from(e)}function u(e){return s.isBuffer(e)||e instanceof c}var d=Object.create(Rk());d.inherits=Bk();var f=W(`util`),p=void 0;p=f&&f.debuglog?f.debuglog(`stream`):function(){};var m=Vk(),h=Hk(),g;d.inherits(x,o);var v=[`error`,`close`,`destroy`,`pause`,`resume`];function y(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function b(e,t){i||=Gk(),e||={};var n=t instanceof i;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,a=e.readableHighWaterMark,o=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:n&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||=Kk().StringDecoder,this.decoder=new g(e.encoding),this.encoding=e.encoding)}function x(e){if(i||=Gk(),!(this instanceof x))return new x(e);this._readableState=new b(e,this),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),o.call(this)}Object.defineProperty(x.prototype,`destroyed`,{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(e,t){this.push(null),t(e)},x.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=s.from(e,t),t=``),r=!0),S(this,e,t,!1,r)},x.prototype.unshift=function(e){return S(this,e,null,!0,!1)};function S(e,t,n,r,i){var a=e._readableState;if(t===null)a.reading=!1,k(e,a);else{var o;i||(o=w(a,t)),o?e.emit(`error`,o):a.objectMode||t&&t.length>0?(typeof t!=`string`&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype&&(t=l(t)),r?a.endEmitted?e.emit(`error`,Error(`stream.unshift() after end event`)):C(e,a,t,!0):a.ended?e.emit(`error`,Error(`stream.push() after EOF`)):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||t.length!==0?C(e,a,t,!1):M(e,a)):C(e,a,t,!1))):r||(a.reading=!1)}return T(a)}function C(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(e.emit(`data`,n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&A(e)),M(e,t)}function w(e,t){var n;return!u(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=TypeError(`Invalid non-string/buffer chunk`)),n}function T(e){return!e.ended&&(e.needReadable||e.length=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function O(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=D(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}x.prototype.read=function(e){p(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?V(this):A(this),null;if(e=O(e,t),e===0&&t.ended)return t.length===0&&V(this),null;var r=t.needReadable;p(`need readable`,r),(t.length===0||t.length-e0?z(e,t):null;return i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),i!==null&&this.emit(`data`,i),i};function k(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,A(e)}}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p(`emitReadable`,t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(j,e):j(e))}function j(e){p(`emit readable`),e.emit(`readable`),R(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length1&&H(i.pipes,e)!==-1)&&!u&&(p(`false write response, pause`,i.awaitDrain),i.awaitDrain++,f=!0),r.pause())}function h(t){p(`onerror`,t),b(),e.removeListener(`error`,h),a(e,`error`)===0&&e.emit(`error`,t)}y(e,`error`,h);function g(){e.removeListener(`finish`,v),b()}e.once(`close`,g);function v(){p(`onfinish`),e.removeListener(`close`,g),b()}e.once(`finish`,v);function b(){p(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),i.flowing||(p(`pipe resume`),r.resume()),e};function P(e){return function(){var t=e._readableState;p(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&a(e,`data`)&&(t.flowing=!0,R(e))}}x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=ee(e,t.buffer,t.decoder),n}function ee(e,t,n){var r;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),e-=o,e===0){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}function te(e,t){var n=s.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),e-=o,e===0){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function V(e){var t=e._readableState;if(t.length>0)throw Error(`"endReadable()" called on non-empty stream`);t.endEmitted||(t.ended=!0,n.nextTick(ne,t,e))}function ne(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`))}function H(e,t){for(var n=0,r=e.length;n{t.exports=a;var n=Gk(),r=Object.create(Rk());r.inherits=Bk(),r.inherits(a,n);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit(`error`,Error(`write callback called multiple times`));n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{t.exports=i;var n=Jk(),r=Object.create(Rk());r.inherits=Bk(),r.inherits(i,n);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),Xk=U(((e,t)=>{var n=W(`stream`);process.env.READABLE_STREAM===`disable`&&n?(t.exports=n,e=t.exports=n.Readable,e.Readable=n.Readable,e.Writable=n.Writable,e.Duplex=n.Duplex,e.Transform=n.Transform,e.PassThrough=n.PassThrough,e.Stream=n):(e=t.exports=qk(),e.Stream=n||e,e.Readable=e,e.Writable=Wk(),e.Duplex=Gk(),e.Transform=Jk(),e.PassThrough=Yk())})),Zk=U(((e,t)=>{t.exports=Xk().PassThrough})),Qk=U(((e,t)=>{var n=W(`util`),r=Zk();t.exports={Readable:a,Writable:o},n.inherits(a,r),n.inherits(o,r);function i(e,t,n){e[t]=function(){return delete e[t],n.apply(this,arguments),this[t].apply(this,arguments)}}function a(e,t){if(!(this instanceof a))return new a(e,t);r.call(this,t),i(this,`_read`,function(){var n=e.call(this,t),r=this.emit.bind(this,`error`);n.on(`error`,r),n.pipe(this)}),this.emit(`readable`)}function o(e,t){if(!(this instanceof o))return new o(e,t);r.call(this,t),i(this,`_write`,function(){var n=e.call(this,t),r=this.emit.bind(this,`error`);n.on(`error`,r),this.pipe(n)}),this.emit(`writable`)}})),$k=U(((e,t)=>{ /*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */ -t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`expected path to be a string`);if(e===`\\`||e===`/`)return`/`;var n=e.length;if(n<=1)return e;var r=``;if(n>4&&e[3]===`\\`){var i=e[2];(i===`?`||i===`.`)&&e.slice(0,2)===`\\\\`&&(e=e.slice(2),r=`//`)}var a=e.split(/[/\\]+/);return t!==!1&&a[a.length-1]===``&&a.pop(),r+a.join(`/`)}})),nA=U(((e,t)=>{function n(e){return e}t.exports=n})),rA=U(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),iA=U(((e,t)=>{var n=rA(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o{function n(e){return function(){return e}}t.exports=n})),oA=U(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),sA=U(((e,t)=>{var n=oA(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),cA=U(((e,t)=>{t.exports=sA().Symbol})),lA=U(((e,t)=>{var n=cA(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),uA=U(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),dA=U(((e,t)=>{var n=cA(),r=lA(),i=uA(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),fA=U(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),pA=U(((e,t)=>{var n=dA(),r=fA(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),mA=U(((e,t)=>{t.exports=sA()[`__core-js_shared__`]})),hA=U(((e,t)=>{var n=mA(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),gA=U(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),_A=U(((e,t)=>{var n=pA(),r=hA(),i=fA(),a=gA(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),vA=U(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),yA=U(((e,t)=>{var n=_A(),r=vA();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),bA=U(((e,t)=>{var n=yA();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),xA=U(((e,t)=>{var n=aA(),r=bA(),i=nA();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),SA=U(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),CA=U(((e,t)=>{var n=xA();t.exports=SA()(n)})),wA=U(((e,t)=>{var n=nA(),r=iA(),i=CA();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),TA=U(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),EA=U(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),DA=U(((e,t)=>{var n=pA(),r=EA();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),OA=U(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e{var n=TA(),r=DA(),i=OA(),a=fA();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),AA=U(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n{function n(e){return typeof e==`object`&&!!e}t.exports=n})),MA=U(((e,t)=>{var n=dA(),r=jA(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),NA=U(((e,t)=>{var n=MA(),r=jA(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),PA=U(((e,t)=>{t.exports=Array.isArray})),FA=U(((e,t)=>{function n(){return!1}t.exports=n})),IA=U(((e,t)=>{var n=sA(),r=FA(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),LA=U(((e,t)=>{var n=dA(),r=EA(),i=jA(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,v=`[object WeakMap]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=`[object Float32Array]`,S=`[object Float64Array]`,C=`[object Int8Array]`,w=`[object Int16Array]`,T=`[object Int32Array]`,E=`[object Uint8Array]`,D=`[object Uint8ClampedArray]`,O=`[object Uint16Array]`,k=`[object Uint32Array]`,A={};A[x]=A[S]=A[C]=A[w]=A[T]=A[E]=A[D]=A[O]=A[k]=!0,A[a]=A[o]=A[y]=A[s]=A[b]=A[c]=A[l]=A[u]=A[d]=A[f]=A[p]=A[m]=A[h]=A[g]=A[v]=!1;function j(e){return i(e)&&r(e.length)&&!!A[n(e)]}t.exports=j})),RA=U(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),zA=U(((e,t)=>{var n=oA(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),BA=U(((e,t)=>{var n=LA(),r=RA(),i=zA(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),VA=U(((e,t)=>{var n=AA(),r=NA(),i=PA(),a=IA(),o=OA(),s=BA(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),HA=U(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),UA=U(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),WA=U(((e,t)=>{var n=fA(),r=HA(),i=UA(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),GA=U(((e,t)=>{var n=VA(),r=WA(),i=DA();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),KA=U(((e,t)=>{var n=wA(),r=TA(),i=kA(),a=GA(),o=Object.prototype,s=o.hasOwnProperty;t.exports=n(function(e,t){e=Object(e);var n=-1,c=t.length,l=c>2?t[2]:void 0;for(l&&i(t[0],t[1],l)&&(c=1);++n{t.exports={AggregateError:class extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t=``;for(let n=0;n{t.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[e,n]){let r=t.shift();return n===`f`?r.toFixed(6):n===`j`?JSON.stringify(r):n===`s`&&typeof r==`object`?`${r.constructor===Object?``:r.constructor.name} {}`.trim():r.toString()})},inspect(e){switch(typeof e){case`string`:if(e.includes(`'`)){if(!e.includes(`"`))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case`number`:return isNaN(e)?`NaN`:Object.is(e,-0)?String(e):e;case`bigint`:return`${String(e)}n`;case`boolean`:case`undefined`:return String(e);case`object`:return`{}`}}}})),YA=U(((e,t)=>{let{format:n,inspect:r}=JA(),{AggregateError:i}=qA(),a=globalThis.AggregateError||i,o=Symbol(`kIsNodeError`),s=[`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`],c=/^([A-Z][a-z0-9]*)+$/,l={};function u(e,t){if(!e)throw new l.ERR_INTERNAL_ASSERTION(t)}function d(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,r){if(typeof t==`function`)return u(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return u(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:n(t,...r)}function p(e,t,n){n||=Error;class r extends n{constructor(...n){super(f(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[o]=!0,l[e]=r}function m(e){let t=`__node_internal_`+e.name;return Object.defineProperty(e,`name`,{value:t}),e}function h(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let n=new a([t,e],t.message);return n.code=t.code,n}return e||t}var g=class extends Error{constructor(e=`The operation was aborted`,t=void 0){if(t!==void 0&&typeof t!=`object`)throw new l.ERR_INVALID_ARG_TYPE(`options`,`Object`,t);super(e,t),this.code=`ABORT_ERR`,this.name=`AbortError`}};p(`ERR_ASSERTION`,`%s`,Error),p(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{u(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let i=`The `;e.endsWith(` argument`)?i+=`${e} `:i+=`"${e}" ${e.includes(`.`)?`property`:`argument`} `,i+=`must be `;let a=[],o=[],l=[];for(let e of t)u(typeof e==`string`,`All expected entries have to be of type string`),s.includes(e)?a.push(e.toLowerCase()):c.test(e)?o.push(e):(u(e!==`object`,`The value "object" should be written as "Object"`),l.push(e));if(o.length>0){let e=a.indexOf(`object`);e!==-1&&(a.splice(a,e,1),o.push(`Object`))}if(a.length>0){switch(a.length){case 1:i+=`of type ${a[0]}`;break;case 2:i+=`one of type ${a[0]} or ${a[1]}`;break;default:{let e=a.pop();i+=`one of type ${a.join(`, `)}, or ${e}`}}(o.length>0||l.length>0)&&(i+=` or `)}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`an instance of ${o.join(`, `)}, or ${e}`}}l.length>0&&(i+=` or `)}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(i+=`an `),i+=`${l[0]}`;break;case 2:i+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();i+=`one of ${l.join(`, `)}, or ${e}`}}if(n==null)i+=`. Received ${n}`;else if(typeof n==`function`&&n.name)i+=`. Received function ${n.name}`;else if(typeof n==`object`){var d;if((d=n.constructor)!=null&&d.name)i+=`. Received an instance of ${n.constructor.name}`;else{let e=r(n,{depth:-1});i+=`. Received ${e}`}}else{let e=r(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof n} (${e})`}return i},TypeError),p(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let i=r(t);return i.length>128&&(i=i.slice(0,128)+`...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${i}`},TypeError),p(`ERR_INVALID_RETURN_VALUE`,(e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${n!=null&&(r=n.constructor)!=null&&r.name?`instance of ${n.constructor.name}`:`type ${typeof n}`}.`},TypeError),p(`ERR_MISSING_ARGS`,(...e)=>{u(e.length>0,`At least one arg needs to be specified`);let t,n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(` or `),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(`, `)}, and ${n} arguments`}break}return`${t} must be specified`},TypeError),p(`ERR_OUT_OF_RANGE`,(e,t,n)=>{u(t,`Missing "range" argument`);let i;if(Number.isInteger(n)&&Math.abs(n)>2**32)i=d(String(n));else if(typeof n==`bigint`){i=String(n);let e=BigInt(2)**BigInt(32);(n>e||n<-e)&&(i=d(i)),i+=`n`}else i=r(n);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),p(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`,Error),p(`ERR_METHOD_NOT_IMPLEMENTED`,`The %s method is not implemented`,Error),p(`ERR_STREAM_ALREADY_FINISHED`,`Cannot call %s after a stream was finished`,Error),p(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`,Error),p(`ERR_STREAM_DESTROYED`,`Cannot call %s after a stream was destroyed`,Error),p(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),p(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`,Error),p(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`,Error),p(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`,Error),p(`ERR_STREAM_WRITE_AFTER_END`,`write after end`,Error),p(`ERR_UNKNOWN_ENCODING`,`Unknown encoding: %s`,TypeError),t.exports={AbortError:g,aggregateTwoErrors:m(h),hideStackFrames:m,codes:l}})),XA=U(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=new WeakMap,r=new WeakMap;function i(e){let t=n.get(e);return console.assert(t!=null,`'this' is expected an Event object, but got`,e),t}function a(e){if(e.passiveListener!=null){typeof console<`u`&&typeof console.error==`function`&&console.error(`Unable to preventDefault inside passive event listener invocation.`,e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault==`function`&&e.event.preventDefault())}function o(e,t){n.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,`isTrusted`,{value:!1,enumerable:!0});let r=Object.keys(t);for(let e=0;e0){let e=Array(arguments.length);for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0});var n=XA(),r=class extends n.EventTarget{constructor(){throw super(),TypeError(`AbortSignal cannot be constructed directly`)}get aborted(){let e=o.get(this);if(typeof e!=`boolean`)throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?`null`:typeof this}`);return e}};n.defineEventAttribute(r.prototype,`abort`);function i(){let e=Object.create(r.prototype);return n.EventTarget.call(e),o.set(e,!1),e}function a(e){o.get(e)===!1&&(o.set(e,!0),e.dispatchEvent({type:`abort`}))}let o=new WeakMap;Object.defineProperties(r.prototype,{aborted:{enumerable:!0}}),typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(r.prototype,Symbol.toStringTag,{configurable:!0,value:`AbortSignal`});var s=class{constructor(){c.set(this,i())}get signal(){return l(this)}abort(){a(l(this))}};let c=new WeakMap;function l(e){let t=c.get(e);if(t==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?`null`:typeof e}`);return t}Object.defineProperties(s.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(s.prototype,Symbol.toStringTag,{configurable:!0,value:`AbortController`}),e.AbortController=s,e.AbortSignal=r,e.default=s,t.exports=s,t.exports.AbortController=t.exports.default=s,t.exports.AbortSignal=r})),QA=U(((e,t)=>{let n=W(`buffer`),{format:r,inspect:i}=JA(),{codes:{ERR_INVALID_ARG_TYPE:a}}=YA(),{kResistStopPropagation:o,AggregateError:s,SymbolDispose:c}=qA(),l=globalThis.AbortSignal||ZA().AbortSignal,u=globalThis.AbortController||ZA().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||n.Blob,p=f===void 0?function(e){return!1}:function(e){return e instanceof f},m=(e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new a(t,`AbortSignal`,e)},h=(e,t)=>{if(typeof e!=`function`)throw new a(t,`Function`,e)};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},promisify(e){return new Promise((t,n)=>{e((e,...r)=>e?n(e):t(...r))})},debuglog(){return function(){}},format:r,inspect:i,types:{isAsyncFunction(e){return e instanceof d},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:p,deprecate(e,t){return e},addAbortListener:W(`events`).addAbortListener||function(e,t){if(e===void 0)throw new a(`signal`,`AbortSignal`,e);m(e,`signal`),h(t,`listener`);let n;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener(`abort`,t,{__proto__:null,once:!0,[o]:!0}),n=()=>{e.removeEventListener(`abort`,t)}),{__proto__:null,[c](){var e;(e=n)==null||e()}}},AbortSignalAny:l.any||function(e){if(e.length===1)return e[0];let t=new u,n=()=>t.abort();return e.forEach(e=>{m(e,`signals`),e.addEventListener(`abort`,n,{once:!0})}),t.signal.addEventListener(`abort`,()=>{e.forEach(e=>e.removeEventListener(`abort`,n))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for(`nodejs.util.promisify.custom`)})),$A=U(((e,t)=>{let{ArrayIsArray:n,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:o,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:l,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:h}=qA(),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:y,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:x,ERR_UNKNOWN_SIGNAL:S}}=YA(),{normalizeEncoding:C}=QA(),{isAsyncFunction:w,isArrayBufferView:T}=QA().types,E={};function D(e){return e===(e|0)}function O(e){return e===e>>>0}let k=/^[0-7]+$/;function A(e,t,n){if(e===void 0&&(e=n),typeof e==`string`){if(f(k,e)===null)throw new b(t,e,`must be a 32-bit unsigned integer or an octal string`);e=u(e,8)}return N(e,t),e}let j=g((e,t,n=l,r=c)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);if(er)throw new x(t,`>= ${n} && <= ${r}`,e)}),M=g((e,t,n=-2147483648,r=2147483647)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);if(er)throw new x(t,`>= ${n} && <= ${r}`,e)}),N=g((e,t,n=!1)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);let r=n?1:0,i=4294967295;if(ei)throw new x(t,`>= ${r} && <= ${i}`,e)});function P(e,t){if(typeof e!=`string`)throw new y(t,`string`,e)}function F(e,t,n=void 0,r){if(typeof e!=`number`)throw new y(t,`number`,e);if(n!=null&&er||(n!=null||r!=null)&&s(e))throw new x(t,`${n==null?``:`>= ${n}`}${n!=null&&r!=null?` && `:``}${r==null?``:`<= ${r}`}`,e)}let I=g((e,t,n)=>{if(!r(n,e))throw new b(t,e,`must be one of: `+i(a(n,e=>typeof e==`string`?`'${e}'`:p(e)),`, `))});function L(e,t){if(typeof e!=`boolean`)throw new y(t,`boolean`,e)}function R(e,t,n){return e==null||!d(e,t)?n:e[t]}let z=g((e,t,r=null)=>{let i=R(r,`allowArray`,!1),a=R(r,`allowFunction`,!1);if(!R(r,`nullable`,!1)&&e===null||!i&&n(e)||typeof e!=`object`&&(!a||typeof e!=`function`))throw new y(t,`Object`,e)}),ee=g((e,t)=>{if(e!=null&&typeof e!=`object`&&typeof e!=`function`)throw new y(t,`a dictionary`,e)}),B=g((e,t,r=0)=>{if(!n(e))throw new y(t,`Array`,e);if(e.length{if(!T(e))throw new y(t,[`Buffer`,`TypedArray`,`DataView`],e)});function ie(e,t){let n=C(t),r=e.length;if(n===`hex`&&r%2!=0)throw new b(`encoding`,t,`is invalid for data of length ${r}`)}function ae(e,t=`Port`,n=!0){if(typeof e!=`number`&&typeof e!=`string`||typeof e==`string`&&h(e).length===0||+e!=e>>>0||e>65535||e===0&&!n)throw new v(t,e,n);return e|0}let oe=g((e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new y(t,`AbortSignal`,e)}),se=g((e,t)=>{if(typeof e!=`function`)throw new y(t,`Function`,e)}),ce=g((e,t)=>{if(typeof e!=`function`||w(e))throw new y(t,`Function`,e)}),le=g((e,t)=>{if(e!==void 0)throw new y(t,`undefined`,e)});function ue(e,t,n){if(!r(n,e))throw new y(t,`('${i(n,`|`)}')`,e)}let U=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function de(e,t){if(e===void 0||!f(U,e))throw new b(t,e,`must be an array or string of format "; rel=preload; as=style"`)}function fe(e){if(typeof e==`string`)return de(e,`hints`),e;if(n(e)){let t=e.length,n=``;if(t===0)return n;for(let r=0;r; rel=preload; as=style"`)}t.exports={isInt32:D,isUint32:O,parseFileMode:A,validateArray:B,validateStringArray:te,validateBooleanArray:V,validateAbortSignalArray:ne,validateBoolean:L,validateBuffer:re,validateDictionary:ee,validateEncoding:ie,validateFunction:se,validateInt32:M,validateInteger:j,validateNumber:F,validateObject:z,validateOneOf:I,validatePlainFunction:ce,validatePort:ae,validateSignalName:H,validateString:P,validateUint32:N,validateUndefined:le,validateUnion:ue,validateAbortSignal:oe,validateLinkHeaderValue:fe}})),ej=U(((e,t)=>{t.exports=global.process})),tj=U(((e,t)=>{let{SymbolAsyncIterator:n,SymbolIterator:r,SymbolFor:i}=qA(),a=i(`nodejs.stream.destroyed`),o=i(`nodejs.stream.errored`),s=i(`nodejs.stream.readable`),c=i(`nodejs.stream.writable`),l=i(`nodejs.stream.disturbed`),u=i(`nodejs.webstream.isClosedPromise`),d=i(`nodejs.webstream.controllerErrorFunction`);function f(e,t=!1){return!!(e&&typeof e.pipe==`function`&&typeof e.on==`function`&&(!t||typeof e.pause==`function`&&typeof e.resume==`function`)&&(!e._writableState||e._readableState?.readable!==!1)&&(!e._writableState||e._readableState))}function p(e){return!!(e&&typeof e.write==`function`&&typeof e.on==`function`&&(!e._readableState||e._writableState?.writable!==!1))}function m(e){return!!(e&&typeof e.pipe==`function`&&e._readableState&&typeof e.on==`function`&&typeof e.write==`function`)}function h(e){return e&&(e._readableState||e._writableState||typeof e.write==`function`&&typeof e.on==`function`||typeof e.pipe==`function`&&typeof e.on==`function`)}function g(e){return!!(e&&!h(e)&&typeof e.pipeThrough==`function`&&typeof e.getReader==`function`&&typeof e.cancel==`function`)}function v(e){return!!(e&&!h(e)&&typeof e.getWriter==`function`&&typeof e.abort==`function`)}function y(e){return!!(e&&!h(e)&&typeof e.readable==`object`&&typeof e.writable==`object`)}function b(e){return g(e)||v(e)||y(e)}function x(e,t){return e==null?!1:t===!0?typeof e[n]==`function`:t===!1?typeof e[r]==`function`:typeof e[n]==`function`||typeof e[r]==`function`}function S(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[a]||r!=null&&r.destroyed)}function C(e){if(!p(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function w(e,t){if(!p(e))return null;if(e.writableFinished===!0)return!0;let n=e._writableState;return n!=null&&n.errored?!1:typeof n?.finished==`boolean`?!!(n.finished||t===!1&&n.ended===!0&&n.length===0):null}function T(e){if(!f(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function E(e,t){if(!f(e))return null;let n=e._readableState;return n!=null&&n.errored?!1:typeof n?.endEmitted==`boolean`?!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0):null}function D(e){return e&&e[s]!=null?e[s]:typeof e?.readable==`boolean`?S(e)?!1:f(e)&&e.readable&&!E(e):null}function O(e){return e&&e[c]!=null?e[c]:typeof e?.writable==`boolean`?S(e)?!1:p(e)&&e.writable&&!C(e):null}function k(e,t){return h(e)?S(e)?!0:!(t?.readable!==!1&&D(e)||t?.writable!==!1&&O(e)):null}function A(e){return h(e)?e.writableErrored?e.writableErrored:e._writableState?.errored??null:null}function j(e){return h(e)?e.readableErrored?e.readableErrored:e._readableState?.errored??null:null}function M(e){if(!h(e))return null;if(typeof e.closed==`boolean`)return e.closed;let t=e._writableState,n=e._readableState;return typeof t?.closed==`boolean`||typeof n?.closed==`boolean`?t?.closed||n?.closed:typeof e._closed==`boolean`&&N(e)?e._closed:null}function N(e){return typeof e._closed==`boolean`&&typeof e._defaultKeepAlive==`boolean`&&typeof e._removedConnection==`boolean`&&typeof e._removedContLen==`boolean`}function P(e){return typeof e._sent100==`boolean`&&N(e)}function F(e){return typeof e._consuming==`boolean`&&typeof e._dumped==`boolean`&&e.req?.upgradeOrConnect===void 0}function I(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!r&&P(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function L(e){return!!(e&&(e[l]??(e.readableDidRead||e.readableAborted)))}function R(e){return!!(e&&(e[o]??e.readableErrored??e.writableErrored??e._readableState?.errorEmitted??e._writableState?.errorEmitted??e._readableState?.errored??e._writableState?.errored))}t.exports={isDestroyed:S,kIsDestroyed:a,isDisturbed:L,kIsDisturbed:l,isErrored:R,kIsErrored:o,isReadable:D,kIsReadable:s,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:c,isClosed:M,isDuplexNodeStream:m,isFinished:k,isIterable:x,isReadableNodeStream:f,isReadableStream:g,isReadableEnded:T,isReadableFinished:E,isReadableErrored:j,isNodeStream:h,isWebStream:b,isWritable:O,isWritableNodeStream:p,isWritableStream:v,isWritableEnded:C,isWritableFinished:w,isWritableErrored:A,isServerRequest:F,isServerResponse:P,willEmitClose:I,isTransformStream:y}})),nj=U(((e,t)=>{let n=ej(),{AbortError:r,codes:i}=YA(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:s,once:c}=QA(),{validateAbortSignal:l,validateFunction:u,validateObject:d,validateBoolean:f}=$A(),{Promise:p,PromisePrototypeThen:m,SymbolDispose:h}=qA(),{isClosed:g,isReadable:v,isReadableNodeStream:y,isReadableStream:b,isReadableFinished:x,isReadableErrored:S,isWritable:C,isWritableNodeStream:w,isWritableStream:T,isWritableFinished:E,isWritableErrored:D,isNodeStream:O,willEmitClose:k,kIsClosedPromise:A}=tj(),j;function M(e){return e.setHeader&&typeof e.abort==`function`}let N=()=>{};function P(e,t,i){if(arguments.length===2?(i=t,t=s):t==null?t=s:d(t,`options`),u(i,`callback`),l(t.signal,`options.signal`),i=c(i),b(e)||T(e))return F(e,t,i);if(!O(e))throw new a(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],e);let f=t.readable??y(e),p=t.writable??w(e),m=e._writableState,A=e._readableState,P=()=>{e.writable||R()},I=k(e)&&y(e)===f&&w(e)===p,L=E(e,!1),R=()=>{L=!0,e.destroyed&&(I=!1),!(I&&(!e.readable||f))&&(!f||z)&&i.call(e)},z=x(e,!1),ee=()=>{z=!0,e.destroyed&&(I=!1),!(I&&(!e.writable||p))&&(!p||L)&&i.call(e)},B=t=>{i.call(e,t)},te=g(e),V=()=>{te=!0;let t=D(e)||S(e);if(t&&typeof t!=`boolean`)return i.call(e,t);if(f&&!z&&y(e,!0)&&!x(e,!1)||p&&!L&&!E(e,!1))return i.call(e,new o);i.call(e)},ne=()=>{te=!0;let t=D(e)||S(e);if(t&&typeof t!=`boolean`)return i.call(e,t);i.call(e)},H=()=>{e.req.on(`finish`,R)};M(e)?(e.on(`complete`,R),I||e.on(`abort`,V),e.req?H():e.on(`request`,H)):p&&!m&&(e.on(`end`,P),e.on(`close`,P)),!I&&typeof e.aborted==`boolean`&&e.on(`aborted`,V),e.on(`end`,ee),e.on(`finish`,R),t.error!==!1&&e.on(`error`,B),e.on(`close`,V),te?n.nextTick(V):m!=null&&m.errorEmitted||A!=null&&A.errorEmitted?I||n.nextTick(ne):(!f&&(!I||v(e))&&(L||C(e)===!1)||!p&&(!I||C(e))&&(z||v(e)===!1)||A&&e.req&&e.aborted)&&n.nextTick(ne);let re=()=>{i=N,e.removeListener(`aborted`,V),e.removeListener(`complete`,R),e.removeListener(`abort`,V),e.removeListener(`request`,H),e.req&&e.req.removeListener(`finish`,R),e.removeListener(`end`,P),e.removeListener(`close`,P),e.removeListener(`finish`,R),e.removeListener(`end`,ee),e.removeListener(`error`,B),e.removeListener(`close`,V)};if(t.signal&&!te){let a=()=>{let n=i;re(),n.call(e,new r(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{j||=QA().addAbortListener;let n=j(t.signal,a),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}}return re}function F(e,t,i){let a=!1,o=N;if(t.signal)if(o=()=>{a=!0,i.call(e,new r(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(o);else{j||=QA().addAbortListener;let n=j(t.signal,o),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}let s=(...t)=>{a||n.nextTick(()=>i.apply(e,t))};return m(e[A].promise,s,s),N}function I(e,t){var n;let r=!1;return t===null&&(t=s),(n=t)!=null&&n.cleanup&&(f(t.cleanup,`cleanup`),r=t.cleanup),new p((n,i)=>{let a=P(e,t,e=>{r&&a(),e?i(e):n()})})}t.exports=P,t.exports.finished=I})),rj=U(((e,t)=>{let n=ej(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=YA(),{Symbol:o}=qA(),{kIsDestroyed:s,isDestroyed:c,isFinished:l,isServerRequest:u}=tj(),d=o(`kDestroy`),f=o(`kConstruct`);function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function m(e,t){let n=this._readableState,i=this._writableState,a=i||n;return i!=null&&i.destroyed||n!=null&&n.destroyed?(typeof t==`function`&&t(),this):(p(e,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),a.constructed?h(this,e,t):this.once(d,function(n){h(this,r(n,e),t)}),this)}function h(e,t,r){let i=!1;function a(t){if(i)return;i=!0;let a=e._readableState,o=e._writableState;p(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),typeof r==`function`&&r(t),t?n.nextTick(g,e,t):n.nextTick(v,e)}try{e._destroy(t||null,a)}catch(e){a(e)}}function g(e,t){y(e,t),v(e)}function v(e){let t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit(`close`)}function y(e,t){let n=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||n!=null&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit(`error`,t))}function b(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function x(e,t,r){let i=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(y,e,t):y(e,t))}function S(e,t){if(typeof e._construct!=`function`)return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(f,t),!(e.listenerCount(f)>1)&&n.nextTick(C,e)}function C(e){let t=!1;function r(r){if(t){x(e,r??new i);return}t=!0;let a=e._readableState,o=e._writableState,s=o||a;a&&(a.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(d,r):r?x(e,r,!0):n.nextTick(w,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function w(e){e.emit(f)}function T(e){return e?.setHeader&&typeof e.abort==`function`}function E(e){e.emit(`close`)}function D(e,t){e.emit(`error`,t),n.nextTick(E,e)}function O(e,t){!e||c(e)||(!t&&!l(e)&&(t=new a),u(e)?(e.socket=null,e.destroy(t)):T(e)?e.abort():T(e.req)?e.req.abort():typeof e.destroy==`function`?e.destroy(t):typeof e.close==`function`?e.close():t?n.nextTick(D,e,t):n.nextTick(E,e),e.destroyed||(e[s]=!0))}t.exports={construct:S,destroyer:O,destroy:m,undestroy:b,errorOrDestroy:x}})),ij=U(((e,t)=>{let{ArrayIsArray:n,ObjectSetPrototypeOf:r}=qA(),{EventEmitter:i}=W(`events`);function a(e){i.call(this,e)}r(a.prototype,i.prototype),r(a,i),a.prototype.pipe=function(e,t){let n=this;function r(t){e.writable&&e.write(t)===!1&&n.pause&&n.pause()}n.on(`data`,r);function a(){n.readable&&n.resume&&n.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(n.on(`end`,c),n.on(`close`,l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy==`function`&&e.destroy())}function u(e){d(),i.listenerCount(this,`error`)===0&&this.emit(`error`,e)}o(n,`error`,u),o(e,`error`,u);function d(){n.removeListener(`data`,r),e.removeListener(`drain`,a),n.removeListener(`end`,c),n.removeListener(`close`,l),n.removeListener(`error`,u),e.removeListener(`error`,u),n.removeListener(`end`,d),n.removeListener(`close`,d),e.removeListener(`close`,d)}return n.on(`end`,d),n.on(`close`,d),e.on(`close`,d),e.emit(`pipe`,n),e};function o(e,t,r){if(typeof e.prependListener==`function`)return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}t.exports={Stream:a,prependListener:o}})),aj=U(((e,t)=>{let{SymbolDispose:n}=qA(),{AbortError:r,codes:i}=YA(),{isNodeStream:a,isWebStream:o,kControllerErrorFunction:s}=tj(),c=nj(),{ERR_INVALID_ARG_TYPE:l}=i,u,d=(e,t)=>{if(typeof e!=`object`||!(`aborted`in e))throw new l(t,`AbortSignal`,e)};t.exports.addAbortSignal=function(e,n){if(d(e,`signal`),!a(n)&&!o(n))throw new l(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!=`object`||!(`aborted`in e))return t;let i=a(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?i():(u||=QA().addAbortListener,c(t,u(e,i)[n])),t}})),oj=U(((e,t)=>{let{StringPrototypeSlice:n,SymbolIterator:r,TypedArrayPrototypeSet:i,Uint8Array:a}=qA(),{Buffer:o}=W(`buffer`),{inspect:s}=QA();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return``;let t=this.head,n=``+t.data;for(;(t=t.next)!==null;)n+=e+t.data;return n}concat(e){if(this.length===0)return o.alloc(0);let t=o.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)i(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){let n=this.head.data;if(ea.length)t+=a,e-=a.length;else{e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){let t=o.allocUnsafe(e),n=e,r=this.head,s=0;do{let o=r.data;if(e>o.length)i(t,o,n-e),e-=o.length;else{e===o.length?(i(t,o,n-e),++s,r.next?this.head=r.next:this.head=this.tail=null):(i(t,new a(o.buffer,o.byteOffset,e),n-e),this.head=r,r.data=o.slice(e));break}++s}while((r=r.next)!==null);return this.length-=s,t}[Symbol.for(`nodejs.util.inspect.custom`)](e,t){return s(this,{...t,depth:0,customInspect:!1})}}})),sj=U(((e,t)=>{let{MathFloor:n,NumberIsInteger:r}=qA(),{validateInteger:i}=$A(),{ERR_INVALID_ARG_VALUE:a}=YA().codes,o=16*1024,s=16;function c(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function l(e){return e?s:o}function u(e,t){i(t,`value`,0),e?s=t:o=t}function d(e,t,i,o){let s=c(t,o,i);if(s!=null){if(!r(s)||s<0)throw new a(o?`options.${i}`:`options.highWaterMark`,s);return n(s)}return l(e.objectMode)}t.exports={getHighWaterMark:d,getDefaultHighWaterMark:l,setDefaultHighWaterMark:u}})),cj=U(((e,t)=>{ +t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`expected path to be a string`);if(e===`\\`||e===`/`)return`/`;var n=e.length;if(n<=1)return e;var r=``;if(n>4&&e[3]===`\\`){var i=e[2];(i===`?`||i===`.`)&&e.slice(0,2)===`\\\\`&&(e=e.slice(2),r=`//`)}var a=e.split(/[/\\]+/);return t!==!1&&a[a.length-1]===``&&a.pop(),r+a.join(`/`)}})),eA=U(((e,t)=>{function n(e){return e}t.exports=n})),tA=U(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),nA=U(((e,t)=>{var n=tA(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o{function n(e){return function(){return e}}t.exports=n})),iA=U(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),aA=U(((e,t)=>{var n=iA(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),oA=U(((e,t)=>{t.exports=aA().Symbol})),sA=U(((e,t)=>{var n=oA(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),cA=U(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),lA=U(((e,t)=>{var n=oA(),r=sA(),i=cA(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),uA=U(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),dA=U(((e,t)=>{var n=lA(),r=uA(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),fA=U(((e,t)=>{t.exports=aA()[`__core-js_shared__`]})),pA=U(((e,t)=>{var n=fA(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),mA=U(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),hA=U(((e,t)=>{var n=dA(),r=pA(),i=uA(),a=mA(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),gA=U(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),_A=U(((e,t)=>{var n=hA(),r=gA();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),vA=U(((e,t)=>{var n=_A();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),yA=U(((e,t)=>{var n=rA(),r=vA(),i=eA();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),bA=U(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),xA=U(((e,t)=>{var n=yA();t.exports=bA()(n)})),SA=U(((e,t)=>{var n=eA(),r=nA(),i=xA();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),CA=U(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),wA=U(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),TA=U(((e,t)=>{var n=dA(),r=wA();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),EA=U(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e{var n=CA(),r=TA(),i=EA(),a=uA();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),OA=U(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n{function n(e){return typeof e==`object`&&!!e}t.exports=n})),AA=U(((e,t)=>{var n=lA(),r=kA(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),jA=U(((e,t)=>{var n=AA(),r=kA(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),MA=U(((e,t)=>{t.exports=Array.isArray})),NA=U(((e,t)=>{function n(){return!1}t.exports=n})),PA=U(((e,t)=>{var n=aA(),r=NA(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),FA=U(((e,t)=>{var n=lA(),r=wA(),i=kA(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,v=`[object WeakMap]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=`[object Float32Array]`,S=`[object Float64Array]`,C=`[object Int8Array]`,w=`[object Int16Array]`,T=`[object Int32Array]`,E=`[object Uint8Array]`,D=`[object Uint8ClampedArray]`,O=`[object Uint16Array]`,k=`[object Uint32Array]`,A={};A[x]=A[S]=A[C]=A[w]=A[T]=A[E]=A[D]=A[O]=A[k]=!0,A[a]=A[o]=A[y]=A[s]=A[b]=A[c]=A[l]=A[u]=A[d]=A[f]=A[p]=A[m]=A[h]=A[g]=A[v]=!1;function j(e){return i(e)&&r(e.length)&&!!A[n(e)]}t.exports=j})),IA=U(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),LA=U(((e,t)=>{var n=iA(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),RA=U(((e,t)=>{var n=FA(),r=IA(),i=LA(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),zA=U(((e,t)=>{var n=OA(),r=jA(),i=MA(),a=PA(),o=EA(),s=RA(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),BA=U(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),VA=U(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),HA=U(((e,t)=>{var n=uA(),r=BA(),i=VA(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),UA=U(((e,t)=>{var n=zA(),r=HA(),i=TA();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),WA=U(((e,t)=>{var n=SA(),r=CA(),i=DA(),a=UA(),o=Object.prototype,s=o.hasOwnProperty;t.exports=n(function(e,t){e=Object(e);var n=-1,c=t.length,l=c>2?t[2]:void 0;for(l&&i(t[0],t[1],l)&&(c=1);++n{t.exports={AggregateError:class extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t=``;for(let n=0;n{t.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[e,n]){let r=t.shift();return n===`f`?r.toFixed(6):n===`j`?JSON.stringify(r):n===`s`&&typeof r==`object`?`${r.constructor===Object?``:r.constructor.name} {}`.trim():r.toString()})},inspect(e){switch(typeof e){case`string`:if(e.includes(`'`)){if(!e.includes(`"`))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case`number`:return isNaN(e)?`NaN`:Object.is(e,-0)?String(e):e;case`bigint`:return`${String(e)}n`;case`boolean`:case`undefined`:return String(e);case`object`:return`{}`}}}})),qA=U(((e,t)=>{let{format:n,inspect:r}=KA(),{AggregateError:i}=GA(),a=globalThis.AggregateError||i,o=Symbol(`kIsNodeError`),s=[`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`],c=/^([A-Z][a-z0-9]*)+$/,l={};function u(e,t){if(!e)throw new l.ERR_INTERNAL_ASSERTION(t)}function d(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,r){if(typeof t==`function`)return u(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return u(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:n(t,...r)}function p(e,t,n){n||=Error;class r extends n{constructor(...n){super(f(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[o]=!0,l[e]=r}function m(e){let t=`__node_internal_`+e.name;return Object.defineProperty(e,`name`,{value:t}),e}function h(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let n=new a([t,e],t.message);return n.code=t.code,n}return e||t}var g=class extends Error{constructor(e=`The operation was aborted`,t=void 0){if(t!==void 0&&typeof t!=`object`)throw new l.ERR_INVALID_ARG_TYPE(`options`,`Object`,t);super(e,t),this.code=`ABORT_ERR`,this.name=`AbortError`}};p(`ERR_ASSERTION`,`%s`,Error),p(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{u(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let i=`The `;e.endsWith(` argument`)?i+=`${e} `:i+=`"${e}" ${e.includes(`.`)?`property`:`argument`} `,i+=`must be `;let a=[],o=[],l=[];for(let e of t)u(typeof e==`string`,`All expected entries have to be of type string`),s.includes(e)?a.push(e.toLowerCase()):c.test(e)?o.push(e):(u(e!==`object`,`The value "object" should be written as "Object"`),l.push(e));if(o.length>0){let e=a.indexOf(`object`);e!==-1&&(a.splice(a,e,1),o.push(`Object`))}if(a.length>0){switch(a.length){case 1:i+=`of type ${a[0]}`;break;case 2:i+=`one of type ${a[0]} or ${a[1]}`;break;default:{let e=a.pop();i+=`one of type ${a.join(`, `)}, or ${e}`}}(o.length>0||l.length>0)&&(i+=` or `)}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`an instance of ${o.join(`, `)}, or ${e}`}}l.length>0&&(i+=` or `)}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(i+=`an `),i+=`${l[0]}`;break;case 2:i+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();i+=`one of ${l.join(`, `)}, or ${e}`}}if(n==null)i+=`. Received ${n}`;else if(typeof n==`function`&&n.name)i+=`. Received function ${n.name}`;else if(typeof n==`object`){var d;if((d=n.constructor)!=null&&d.name)i+=`. Received an instance of ${n.constructor.name}`;else{let e=r(n,{depth:-1});i+=`. Received ${e}`}}else{let e=r(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof n} (${e})`}return i},TypeError),p(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let i=r(t);return i.length>128&&(i=i.slice(0,128)+`...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${i}`},TypeError),p(`ERR_INVALID_RETURN_VALUE`,(e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${n!=null&&(r=n.constructor)!=null&&r.name?`instance of ${n.constructor.name}`:`type ${typeof n}`}.`},TypeError),p(`ERR_MISSING_ARGS`,(...e)=>{u(e.length>0,`At least one arg needs to be specified`);let t,n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(` or `),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(`, `)}, and ${n} arguments`}break}return`${t} must be specified`},TypeError),p(`ERR_OUT_OF_RANGE`,(e,t,n)=>{u(t,`Missing "range" argument`);let i;if(Number.isInteger(n)&&Math.abs(n)>2**32)i=d(String(n));else if(typeof n==`bigint`){i=String(n);let e=BigInt(2)**BigInt(32);(n>e||n<-e)&&(i=d(i)),i+=`n`}else i=r(n);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),p(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`,Error),p(`ERR_METHOD_NOT_IMPLEMENTED`,`The %s method is not implemented`,Error),p(`ERR_STREAM_ALREADY_FINISHED`,`Cannot call %s after a stream was finished`,Error),p(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`,Error),p(`ERR_STREAM_DESTROYED`,`Cannot call %s after a stream was destroyed`,Error),p(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),p(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`,Error),p(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`,Error),p(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`,Error),p(`ERR_STREAM_WRITE_AFTER_END`,`write after end`,Error),p(`ERR_UNKNOWN_ENCODING`,`Unknown encoding: %s`,TypeError),t.exports={AbortError:g,aggregateTwoErrors:m(h),hideStackFrames:m,codes:l}})),JA=U(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=new WeakMap,r=new WeakMap;function i(e){let t=n.get(e);return console.assert(t!=null,`'this' is expected an Event object, but got`,e),t}function a(e){if(e.passiveListener!=null){typeof console<`u`&&typeof console.error==`function`&&console.error(`Unable to preventDefault inside passive event listener invocation.`,e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault==`function`&&e.event.preventDefault())}function o(e,t){n.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,`isTrusted`,{value:!1,enumerable:!0});let r=Object.keys(t);for(let e=0;e0){let e=Array(arguments.length);for(let t=0;t{Object.defineProperty(e,`__esModule`,{value:!0});var n=JA(),r=class extends n.EventTarget{constructor(){throw super(),TypeError(`AbortSignal cannot be constructed directly`)}get aborted(){let e=o.get(this);if(typeof e!=`boolean`)throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?`null`:typeof this}`);return e}};n.defineEventAttribute(r.prototype,`abort`);function i(){let e=Object.create(r.prototype);return n.EventTarget.call(e),o.set(e,!1),e}function a(e){o.get(e)===!1&&(o.set(e,!0),e.dispatchEvent({type:`abort`}))}let o=new WeakMap;Object.defineProperties(r.prototype,{aborted:{enumerable:!0}}),typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(r.prototype,Symbol.toStringTag,{configurable:!0,value:`AbortSignal`});var s=class{constructor(){c.set(this,i())}get signal(){return l(this)}abort(){a(l(this))}};let c=new WeakMap;function l(e){let t=c.get(e);if(t==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?`null`:typeof e}`);return t}Object.defineProperties(s.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(s.prototype,Symbol.toStringTag,{configurable:!0,value:`AbortController`}),e.AbortController=s,e.AbortSignal=r,e.default=s,t.exports=s,t.exports.AbortController=t.exports.default=s,t.exports.AbortSignal=r})),XA=U(((e,t)=>{let n=W(`buffer`),{format:r,inspect:i}=KA(),{codes:{ERR_INVALID_ARG_TYPE:a}}=qA(),{kResistStopPropagation:o,AggregateError:s,SymbolDispose:c}=GA(),l=globalThis.AbortSignal||YA().AbortSignal,u=globalThis.AbortController||YA().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||n.Blob,p=f===void 0?function(e){return!1}:function(e){return e instanceof f},m=(e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new a(t,`AbortSignal`,e)},h=(e,t)=>{if(typeof e!=`function`)throw new a(t,`Function`,e)};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},promisify(e){return new Promise((t,n)=>{e((e,...r)=>e?n(e):t(...r))})},debuglog(){return function(){}},format:r,inspect:i,types:{isAsyncFunction(e){return e instanceof d},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:p,deprecate(e,t){return e},addAbortListener:W(`events`).addAbortListener||function(e,t){if(e===void 0)throw new a(`signal`,`AbortSignal`,e);m(e,`signal`),h(t,`listener`);let n;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener(`abort`,t,{__proto__:null,once:!0,[o]:!0}),n=()=>{e.removeEventListener(`abort`,t)}),{__proto__:null,[c](){var e;(e=n)==null||e()}}},AbortSignalAny:l.any||function(e){if(e.length===1)return e[0];let t=new u,n=()=>t.abort();return e.forEach(e=>{m(e,`signals`),e.addEventListener(`abort`,n,{once:!0})}),t.signal.addEventListener(`abort`,()=>{e.forEach(e=>e.removeEventListener(`abort`,n))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for(`nodejs.util.promisify.custom`)})),ZA=U(((e,t)=>{let{ArrayIsArray:n,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:o,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:l,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:h}=GA(),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:y,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:x,ERR_UNKNOWN_SIGNAL:S}}=qA(),{normalizeEncoding:C}=XA(),{isAsyncFunction:w,isArrayBufferView:T}=XA().types,E={};function D(e){return e===(e|0)}function O(e){return e===e>>>0}let k=/^[0-7]+$/;function A(e,t,n){if(e===void 0&&(e=n),typeof e==`string`){if(f(k,e)===null)throw new b(t,e,`must be a 32-bit unsigned integer or an octal string`);e=u(e,8)}return N(e,t),e}let j=g((e,t,n=l,r=c)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);if(er)throw new x(t,`>= ${n} && <= ${r}`,e)}),M=g((e,t,n=-2147483648,r=2147483647)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);if(er)throw new x(t,`>= ${n} && <= ${r}`,e)}),N=g((e,t,n=!1)=>{if(typeof e!=`number`)throw new y(t,`number`,e);if(!o(e))throw new x(t,`an integer`,e);let r=n?1:0,i=4294967295;if(ei)throw new x(t,`>= ${r} && <= ${i}`,e)});function P(e,t){if(typeof e!=`string`)throw new y(t,`string`,e)}function F(e,t,n=void 0,r){if(typeof e!=`number`)throw new y(t,`number`,e);if(n!=null&&er||(n!=null||r!=null)&&s(e))throw new x(t,`${n==null?``:`>= ${n}`}${n!=null&&r!=null?` && `:``}${r==null?``:`<= ${r}`}`,e)}let I=g((e,t,n)=>{if(!r(n,e))throw new b(t,e,`must be one of: `+i(a(n,e=>typeof e==`string`?`'${e}'`:p(e)),`, `))});function L(e,t){if(typeof e!=`boolean`)throw new y(t,`boolean`,e)}function R(e,t,n){return e==null||!d(e,t)?n:e[t]}let z=g((e,t,r=null)=>{let i=R(r,`allowArray`,!1),a=R(r,`allowFunction`,!1);if(!R(r,`nullable`,!1)&&e===null||!i&&n(e)||typeof e!=`object`&&(!a||typeof e!=`function`))throw new y(t,`Object`,e)}),ee=g((e,t)=>{if(e!=null&&typeof e!=`object`&&typeof e!=`function`)throw new y(t,`a dictionary`,e)}),B=g((e,t,r=0)=>{if(!n(e))throw new y(t,`Array`,e);if(e.length{if(!T(e))throw new y(t,[`Buffer`,`TypedArray`,`DataView`],e)});function ie(e,t){let n=C(t),r=e.length;if(n===`hex`&&r%2!=0)throw new b(`encoding`,t,`is invalid for data of length ${r}`)}function ae(e,t=`Port`,n=!0){if(typeof e!=`number`&&typeof e!=`string`||typeof e==`string`&&h(e).length===0||+e!=e>>>0||e>65535||e===0&&!n)throw new v(t,e,n);return e|0}let oe=g((e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new y(t,`AbortSignal`,e)}),se=g((e,t)=>{if(typeof e!=`function`)throw new y(t,`Function`,e)}),ce=g((e,t)=>{if(typeof e!=`function`||w(e))throw new y(t,`Function`,e)}),le=g((e,t)=>{if(e!==void 0)throw new y(t,`undefined`,e)});function ue(e,t,n){if(!r(n,e))throw new y(t,`('${i(n,`|`)}')`,e)}let U=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function de(e,t){if(e===void 0||!f(U,e))throw new b(t,e,`must be an array or string of format "; rel=preload; as=style"`)}function fe(e){if(typeof e==`string`)return de(e,`hints`),e;if(n(e)){let t=e.length,n=``;if(t===0)return n;for(let r=0;r; rel=preload; as=style"`)}t.exports={isInt32:D,isUint32:O,parseFileMode:A,validateArray:B,validateStringArray:te,validateBooleanArray:V,validateAbortSignalArray:ne,validateBoolean:L,validateBuffer:re,validateDictionary:ee,validateEncoding:ie,validateFunction:se,validateInt32:M,validateInteger:j,validateNumber:F,validateObject:z,validateOneOf:I,validatePlainFunction:ce,validatePort:ae,validateSignalName:H,validateString:P,validateUint32:N,validateUndefined:le,validateUnion:ue,validateAbortSignal:oe,validateLinkHeaderValue:fe}})),QA=U(((e,t)=>{t.exports=global.process})),$A=U(((e,t)=>{let{SymbolAsyncIterator:n,SymbolIterator:r,SymbolFor:i}=GA(),a=i(`nodejs.stream.destroyed`),o=i(`nodejs.stream.errored`),s=i(`nodejs.stream.readable`),c=i(`nodejs.stream.writable`),l=i(`nodejs.stream.disturbed`),u=i(`nodejs.webstream.isClosedPromise`),d=i(`nodejs.webstream.controllerErrorFunction`);function f(e,t=!1){return!!(e&&typeof e.pipe==`function`&&typeof e.on==`function`&&(!t||typeof e.pause==`function`&&typeof e.resume==`function`)&&(!e._writableState||e._readableState?.readable!==!1)&&(!e._writableState||e._readableState))}function p(e){return!!(e&&typeof e.write==`function`&&typeof e.on==`function`&&(!e._readableState||e._writableState?.writable!==!1))}function m(e){return!!(e&&typeof e.pipe==`function`&&e._readableState&&typeof e.on==`function`&&typeof e.write==`function`)}function h(e){return e&&(e._readableState||e._writableState||typeof e.write==`function`&&typeof e.on==`function`||typeof e.pipe==`function`&&typeof e.on==`function`)}function g(e){return!!(e&&!h(e)&&typeof e.pipeThrough==`function`&&typeof e.getReader==`function`&&typeof e.cancel==`function`)}function v(e){return!!(e&&!h(e)&&typeof e.getWriter==`function`&&typeof e.abort==`function`)}function y(e){return!!(e&&!h(e)&&typeof e.readable==`object`&&typeof e.writable==`object`)}function b(e){return g(e)||v(e)||y(e)}function x(e,t){return e==null?!1:t===!0?typeof e[n]==`function`:t===!1?typeof e[r]==`function`:typeof e[n]==`function`||typeof e[r]==`function`}function S(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[a]||r!=null&&r.destroyed)}function C(e){if(!p(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function w(e,t){if(!p(e))return null;if(e.writableFinished===!0)return!0;let n=e._writableState;return n!=null&&n.errored?!1:typeof n?.finished==`boolean`?!!(n.finished||t===!1&&n.ended===!0&&n.length===0):null}function T(e){if(!f(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function E(e,t){if(!f(e))return null;let n=e._readableState;return n!=null&&n.errored?!1:typeof n?.endEmitted==`boolean`?!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0):null}function D(e){return e&&e[s]!=null?e[s]:typeof e?.readable==`boolean`?S(e)?!1:f(e)&&e.readable&&!E(e):null}function O(e){return e&&e[c]!=null?e[c]:typeof e?.writable==`boolean`?S(e)?!1:p(e)&&e.writable&&!C(e):null}function k(e,t){return h(e)?S(e)?!0:!(t?.readable!==!1&&D(e)||t?.writable!==!1&&O(e)):null}function A(e){return h(e)?e.writableErrored?e.writableErrored:e._writableState?.errored??null:null}function j(e){return h(e)?e.readableErrored?e.readableErrored:e._readableState?.errored??null:null}function M(e){if(!h(e))return null;if(typeof e.closed==`boolean`)return e.closed;let t=e._writableState,n=e._readableState;return typeof t?.closed==`boolean`||typeof n?.closed==`boolean`?t?.closed||n?.closed:typeof e._closed==`boolean`&&N(e)?e._closed:null}function N(e){return typeof e._closed==`boolean`&&typeof e._defaultKeepAlive==`boolean`&&typeof e._removedConnection==`boolean`&&typeof e._removedContLen==`boolean`}function P(e){return typeof e._sent100==`boolean`&&N(e)}function F(e){return typeof e._consuming==`boolean`&&typeof e._dumped==`boolean`&&e.req?.upgradeOrConnect===void 0}function I(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!r&&P(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function L(e){return!!(e&&(e[l]??(e.readableDidRead||e.readableAborted)))}function R(e){return!!(e&&(e[o]??e.readableErrored??e.writableErrored??e._readableState?.errorEmitted??e._writableState?.errorEmitted??e._readableState?.errored??e._writableState?.errored))}t.exports={isDestroyed:S,kIsDestroyed:a,isDisturbed:L,kIsDisturbed:l,isErrored:R,kIsErrored:o,isReadable:D,kIsReadable:s,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:c,isClosed:M,isDuplexNodeStream:m,isFinished:k,isIterable:x,isReadableNodeStream:f,isReadableStream:g,isReadableEnded:T,isReadableFinished:E,isReadableErrored:j,isNodeStream:h,isWebStream:b,isWritable:O,isWritableNodeStream:p,isWritableStream:v,isWritableEnded:C,isWritableFinished:w,isWritableErrored:A,isServerRequest:F,isServerResponse:P,willEmitClose:I,isTransformStream:y}})),ej=U(((e,t)=>{let n=QA(),{AbortError:r,codes:i}=qA(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:s,once:c}=XA(),{validateAbortSignal:l,validateFunction:u,validateObject:d,validateBoolean:f}=ZA(),{Promise:p,PromisePrototypeThen:m,SymbolDispose:h}=GA(),{isClosed:g,isReadable:v,isReadableNodeStream:y,isReadableStream:b,isReadableFinished:x,isReadableErrored:S,isWritable:C,isWritableNodeStream:w,isWritableStream:T,isWritableFinished:E,isWritableErrored:D,isNodeStream:O,willEmitClose:k,kIsClosedPromise:A}=$A(),j;function M(e){return e.setHeader&&typeof e.abort==`function`}let N=()=>{};function P(e,t,i){if(arguments.length===2?(i=t,t=s):t==null?t=s:d(t,`options`),u(i,`callback`),l(t.signal,`options.signal`),i=c(i),b(e)||T(e))return F(e,t,i);if(!O(e))throw new a(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],e);let f=t.readable??y(e),p=t.writable??w(e),m=e._writableState,A=e._readableState,P=()=>{e.writable||R()},I=k(e)&&y(e)===f&&w(e)===p,L=E(e,!1),R=()=>{L=!0,e.destroyed&&(I=!1),!(I&&(!e.readable||f))&&(!f||z)&&i.call(e)},z=x(e,!1),ee=()=>{z=!0,e.destroyed&&(I=!1),!(I&&(!e.writable||p))&&(!p||L)&&i.call(e)},B=t=>{i.call(e,t)},te=g(e),V=()=>{te=!0;let t=D(e)||S(e);if(t&&typeof t!=`boolean`)return i.call(e,t);if(f&&!z&&y(e,!0)&&!x(e,!1)||p&&!L&&!E(e,!1))return i.call(e,new o);i.call(e)},ne=()=>{te=!0;let t=D(e)||S(e);if(t&&typeof t!=`boolean`)return i.call(e,t);i.call(e)},H=()=>{e.req.on(`finish`,R)};M(e)?(e.on(`complete`,R),I||e.on(`abort`,V),e.req?H():e.on(`request`,H)):p&&!m&&(e.on(`end`,P),e.on(`close`,P)),!I&&typeof e.aborted==`boolean`&&e.on(`aborted`,V),e.on(`end`,ee),e.on(`finish`,R),t.error!==!1&&e.on(`error`,B),e.on(`close`,V),te?n.nextTick(V):m!=null&&m.errorEmitted||A!=null&&A.errorEmitted?I||n.nextTick(ne):(!f&&(!I||v(e))&&(L||C(e)===!1)||!p&&(!I||C(e))&&(z||v(e)===!1)||A&&e.req&&e.aborted)&&n.nextTick(ne);let re=()=>{i=N,e.removeListener(`aborted`,V),e.removeListener(`complete`,R),e.removeListener(`abort`,V),e.removeListener(`request`,H),e.req&&e.req.removeListener(`finish`,R),e.removeListener(`end`,P),e.removeListener(`close`,P),e.removeListener(`finish`,R),e.removeListener(`end`,ee),e.removeListener(`error`,B),e.removeListener(`close`,V)};if(t.signal&&!te){let a=()=>{let n=i;re(),n.call(e,new r(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{j||=XA().addAbortListener;let n=j(t.signal,a),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}}return re}function F(e,t,i){let a=!1,o=N;if(t.signal)if(o=()=>{a=!0,i.call(e,new r(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(o);else{j||=XA().addAbortListener;let n=j(t.signal,o),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}let s=(...t)=>{a||n.nextTick(()=>i.apply(e,t))};return m(e[A].promise,s,s),N}function I(e,t){var n;let r=!1;return t===null&&(t=s),(n=t)!=null&&n.cleanup&&(f(t.cleanup,`cleanup`),r=t.cleanup),new p((n,i)=>{let a=P(e,t,e=>{r&&a(),e?i(e):n()})})}t.exports=P,t.exports.finished=I})),tj=U(((e,t)=>{let n=QA(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=qA(),{Symbol:o}=GA(),{kIsDestroyed:s,isDestroyed:c,isFinished:l,isServerRequest:u}=$A(),d=o(`kDestroy`),f=o(`kConstruct`);function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function m(e,t){let n=this._readableState,i=this._writableState,a=i||n;return i!=null&&i.destroyed||n!=null&&n.destroyed?(typeof t==`function`&&t(),this):(p(e,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),a.constructed?h(this,e,t):this.once(d,function(n){h(this,r(n,e),t)}),this)}function h(e,t,r){let i=!1;function a(t){if(i)return;i=!0;let a=e._readableState,o=e._writableState;p(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),typeof r==`function`&&r(t),t?n.nextTick(g,e,t):n.nextTick(v,e)}try{e._destroy(t||null,a)}catch(e){a(e)}}function g(e,t){y(e,t),v(e)}function v(e){let t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit(`close`)}function y(e,t){let n=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||n!=null&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit(`error`,t))}function b(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function x(e,t,r){let i=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(y,e,t):y(e,t))}function S(e,t){if(typeof e._construct!=`function`)return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(f,t),!(e.listenerCount(f)>1)&&n.nextTick(C,e)}function C(e){let t=!1;function r(r){if(t){x(e,r??new i);return}t=!0;let a=e._readableState,o=e._writableState,s=o||a;a&&(a.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(d,r):r?x(e,r,!0):n.nextTick(w,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function w(e){e.emit(f)}function T(e){return e?.setHeader&&typeof e.abort==`function`}function E(e){e.emit(`close`)}function D(e,t){e.emit(`error`,t),n.nextTick(E,e)}function O(e,t){!e||c(e)||(!t&&!l(e)&&(t=new a),u(e)?(e.socket=null,e.destroy(t)):T(e)?e.abort():T(e.req)?e.req.abort():typeof e.destroy==`function`?e.destroy(t):typeof e.close==`function`?e.close():t?n.nextTick(D,e,t):n.nextTick(E,e),e.destroyed||(e[s]=!0))}t.exports={construct:S,destroyer:O,destroy:m,undestroy:b,errorOrDestroy:x}})),nj=U(((e,t)=>{let{ArrayIsArray:n,ObjectSetPrototypeOf:r}=GA(),{EventEmitter:i}=W(`events`);function a(e){i.call(this,e)}r(a.prototype,i.prototype),r(a,i),a.prototype.pipe=function(e,t){let n=this;function r(t){e.writable&&e.write(t)===!1&&n.pause&&n.pause()}n.on(`data`,r);function a(){n.readable&&n.resume&&n.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(n.on(`end`,c),n.on(`close`,l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy==`function`&&e.destroy())}function u(e){d(),i.listenerCount(this,`error`)===0&&this.emit(`error`,e)}o(n,`error`,u),o(e,`error`,u);function d(){n.removeListener(`data`,r),e.removeListener(`drain`,a),n.removeListener(`end`,c),n.removeListener(`close`,l),n.removeListener(`error`,u),e.removeListener(`error`,u),n.removeListener(`end`,d),n.removeListener(`close`,d),e.removeListener(`close`,d)}return n.on(`end`,d),n.on(`close`,d),e.on(`close`,d),e.emit(`pipe`,n),e};function o(e,t,r){if(typeof e.prependListener==`function`)return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}t.exports={Stream:a,prependListener:o}})),rj=U(((e,t)=>{let{SymbolDispose:n}=GA(),{AbortError:r,codes:i}=qA(),{isNodeStream:a,isWebStream:o,kControllerErrorFunction:s}=$A(),c=ej(),{ERR_INVALID_ARG_TYPE:l}=i,u,d=(e,t)=>{if(typeof e!=`object`||!(`aborted`in e))throw new l(t,`AbortSignal`,e)};t.exports.addAbortSignal=function(e,n){if(d(e,`signal`),!a(n)&&!o(n))throw new l(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!=`object`||!(`aborted`in e))return t;let i=a(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?i():(u||=XA().addAbortListener,c(t,u(e,i)[n])),t}})),ij=U(((e,t)=>{let{StringPrototypeSlice:n,SymbolIterator:r,TypedArrayPrototypeSet:i,Uint8Array:a}=GA(),{Buffer:o}=W(`buffer`),{inspect:s}=XA();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return``;let t=this.head,n=``+t.data;for(;(t=t.next)!==null;)n+=e+t.data;return n}concat(e){if(this.length===0)return o.alloc(0);let t=o.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)i(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){let n=this.head.data;if(ea.length)t+=a,e-=a.length;else{e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){let t=o.allocUnsafe(e),n=e,r=this.head,s=0;do{let o=r.data;if(e>o.length)i(t,o,n-e),e-=o.length;else{e===o.length?(i(t,o,n-e),++s,r.next?this.head=r.next:this.head=this.tail=null):(i(t,new a(o.buffer,o.byteOffset,e),n-e),this.head=r,r.data=o.slice(e));break}++s}while((r=r.next)!==null);return this.length-=s,t}[Symbol.for(`nodejs.util.inspect.custom`)](e,t){return s(this,{...t,depth:0,customInspect:!1})}}})),aj=U(((e,t)=>{let{MathFloor:n,NumberIsInteger:r}=GA(),{validateInteger:i}=ZA(),{ERR_INVALID_ARG_VALUE:a}=qA().codes,o=16*1024,s=16;function c(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function l(e){return e?s:o}function u(e,t){i(t,`value`,0),e?s=t:o=t}function d(e,t,i,o){let s=c(t,o,i);if(s!=null){if(!r(s)||s<0)throw new a(o?`options.${i}`:`options.highWaterMark`,s);return n(s)}return l(e.objectMode)}t.exports={getHighWaterMark:d,getDefaultHighWaterMark:l,setDefaultHighWaterMark:u}})),oj=U(((e,t)=>{ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ -var n=W(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),lj=U((e=>{var t=cj().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):``}})),uj=U(((e,t)=>{let n=ej(),{PromisePrototypeThen:r,SymbolAsyncIterator:i,SymbolIterator:a}=qA(),{Buffer:o}=W(`buffer`),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:c}=YA().codes;function l(e,t,l){let u;if(typeof t==`string`||t instanceof o)return new e({objectMode:!0,...l,read(){this.push(t),this.push(null)}});let d;if(t&&t[i])d=!0,u=t[i]();else if(t&&t[a])d=!1,u=t[a]();else throw new s(`iterable`,[`Iterable`],t);let f=new e({objectMode:!0,highWaterMark:1,...l}),p=!1;f._read=function(){p||(p=!0,h())},f._destroy=function(e,t){r(m(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))};async function m(e){let t=e!=null,n=typeof u.throw==`function`;if(t&&n){let{value:t,done:n}=await u.throw(e);if(await t,n)return}if(typeof u.return==`function`){let{value:e}=await u.return();await e}}async function h(){for(;;){try{let{value:e,done:t}=d?await u.next():u.next();if(t)f.push(null);else{let t=e&&typeof e.then==`function`?await e:e;if(t===null)throw p=!1,new c;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}return f}t.exports=l})),dj=U(((e,t)=>{let n=ej(),{ArrayPrototypeIndexOf:r,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:o,ObjectDefineProperties:s,ObjectKeys:c,ObjectSetPrototypeOf:l,Promise:u,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:m}=qA();t.exports=H,H.ReadableState=ne;let{EventEmitter:h}=W(`events`),{Stream:g,prependListener:v}=ij(),{Buffer:y}=W(`buffer`),{addAbortSignal:b}=aj(),x=nj(),S=QA().debuglog(`stream`,e=>{S=e}),C=oj(),w=rj(),{getHighWaterMark:T,getDefaultHighWaterMark:E}=sj(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:O,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:A,ERR_STREAM_PUSH_AFTER_EOF:j,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:N}=YA(),{validateObject:P}=$A(),F=m(`kPaused`),{StringDecoder:I}=lj(),L=uj();l(H.prototype,g.prototype),l(H,g);let R=()=>{},{errorOrDestroy:z}=w,ee=2048,B=4096,te=65536;function V(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}s(ne.prototype,{objectMode:V(1),ended:V(2),endEmitted:V(4),reading:V(8),constructed:V(16),sync:V(32),needReadable:V(64),emittedReadable:V(128),readableListening:V(256),resumeScheduled:V(512),errorEmitted:V(1024),emitClose:V(ee),autoDestroy:V(B),destroyed:V(8192),closed:V(16384),closeEmitted:V(32768),multiAwaitDrain:V(te),readingMore:V(131072),dataEmitted:V(262144)});function ne(e,t,n){typeof n!=`boolean`&&(n=t instanceof mj()),this.state=6192,e&&e.objectMode&&(this.state|=1),n&&e&&e.readableObjectMode&&(this.state|=1),this.highWaterMark=e?T(this,e,`readableHighWaterMark`,n):E(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[F]=null,e&&e.emitClose===!1&&(this.state&=~ee),e&&e.autoDestroy===!1&&(this.state&=~B),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new I(e.encoding),this.encoding=e.encoding)}function H(e){if(!(this instanceof H))return new H(e);let t=this instanceof mj();this._readableState=new ne(e,this,t),e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&!t&&b(e.signal,this)),g.call(this,e),w.construct(this,()=>{this._readableState.needReadable&&ue(this,this._readableState)})}H.prototype.destroy=w.destroy,H.prototype._undestroy=w.undestroy,H.prototype._destroy=function(e,t){t(e)},H.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},H.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new N,this.destroy(e)),new u((t,n)=>x(this,r=>r&&r!==e?n(r):t(null)))},H.prototype.push=function(e,t){return re(this,e,t,!1)},H.prototype.unshift=function(e,t){return re(this,e,t,!0)};function re(e,t,n,r){S(`readableAddChunk`,t);let i=e._readableState,a;if(i.state&1||(typeof t==`string`?(n||=i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=y.from(t,n).toString(i.encoding):(t=y.from(t,n),n=``))):t instanceof y?n=``:g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),n=``):t!=null&&(a=new O(`chunk`,[`string`,`Buffer`,`Uint8Array`],t))),a)z(e,a);else if(t===null)i.state&=-9,se(e,i);else if(i.state&1||t&&t.length>0)if(r)if(i.state&4)z(e,new M);else if(i.destroyed||i.errored)return!1;else ie(e,i,t,!0);else if(i.ended)z(e,new j);else if(i.destroyed||i.errored)return!1;else i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||t.length!==0?ie(e,i,t,!1):ue(e,i)):ie(e,i,t,!1);else r||(i.state&=-9,ue(e,i));return!i.ended&&(i.length0?((t.state&te)===0?t.awaitDrainWriters=null:t.awaitDrainWriters.clear(),t.dataEmitted=!0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.state&64&&ce(e)),ue(e,t)}H.prototype.isPaused=function(){let e=this._readableState;return e[F]===!0||e.flowing===!1},H.prototype.setEncoding=function(e){let t=new I(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer,r=``;for(let e of n)r+=t.write(e);return n.clear(),r!==``&&n.push(r),this._readableState.length=r.length,this};function ae(e){if(e>1073741824)throw new A(`size`,`<= 1GiB`,e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function oe(e,t){return e<=0||t.length===0&&t.ended?0:t.state&1?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}H.prototype.read=function(e){S(`read`,e),e===void 0?e=NaN:i(e)||(e=o(e,10));let t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=ae(e)),e!==0&&(t.state&=-129),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return S(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?be(this):ce(this),null;if(e=oe(e,t),e===0&&t.ended)return t.length===0&&be(this),null;let r=(t.state&64)!=0;if(S(`need readable`,r),(t.length===0||t.length-e0?ye(e,t):null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&be(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit(`data`,a)),a};function se(e,t){if(S(`onEofChunk`),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?ce(e):(t.needReadable=!1,t.emittedReadable=!0,le(e))}}function ce(e){let t=e._readableState;S(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S(`emitReadable`,t.flowing),t.emittedReadable=!0,n.nextTick(le,e))}function le(e){let t=e._readableState;S(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ge(e)}function ue(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(U,e,t))}function U(e,t){for(;!t.reading&&!t.ended&&(t.length1&&i.pipes.includes(e)&&(S(`false write response, pause`,i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=de(r,e),e.on(`drain`,c))}r.on(`data`,p);function p(t){S(`ondata`);let n=e.write(t);S(`dest.write`,n),n===!1&&f()}function m(t){if(S(`onerror`,t),y(),e.removeListener(`error`,m),e.listenerCount(`error`)===0){let n=e._writableState||e._readableState;n&&!n.errorEmitted?z(e,t):e.emit(`error`,t)}}v(e,`error`,m);function h(){e.removeListener(`finish`,g),y()}e.once(`close`,h);function g(){S(`onfinish`),e.removeListener(`close`,h),y()}e.once(`finish`,g);function y(){S(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),e.writableNeedDrain===!0?f():i.flowing||(S(`pipe resume`),r.resume()),e};function de(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(S(`pipeOnDrain`,1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(S(`pipeOnDrain`,n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount(`data`)&&e.resume()}}H.prototype.unpipe=function(e){let t=this._readableState,n={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,i.flowing!==!1&&this.resume()):e===`readable`&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S(`on readable`,i.length,i.reading),i.length?ce(this):i.reading||n.nextTick(pe,this)),r},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(e,t){let r=g.prototype.removeListener.call(this,e,t);return e===`readable`&&n.nextTick(fe,this),r},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(e){let t=g.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&n.nextTick(fe,this),t};function fe(e){let t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&t[F]===!1?t.flowing=!0:e.listenerCount(`data`)>0?e.resume():t.readableListening||(t.flowing=null)}function pe(e){S(`readable nexttick read 0`),e.read(0)}H.prototype.resume=function(){let e=this._readableState;return e.flowing||(S(`resume`),e.flowing=!e.readableListening,me(this,e)),e[F]=!1,this};function me(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(he,e,t))}function he(e,t){S(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),ge(e),t.flowing&&!t.reading&&e.read(0)}H.prototype.pause=function(){return S(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(S(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState[F]=!0,this};function ge(e){let t=e._readableState;for(S(`flow`,t.flowing);t.flowing&&e.read()!==null;);}H.prototype.wrap=function(e){let t=!1;e.on(`data`,n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on(`end`,()=>{this.push(null)}),e.on(`error`,e=>{z(this,e)}),e.on(`close`,()=>{this.destroy()}),e.on(`destroy`,()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let n=c(e);for(let t=1;t{i=e?D(i,e):null,n(),n=R});try{for(;;){let t=e.destroyed?null:e.read();if(t!==null)yield t;else if(i)throw i;else if(i===null)return;else await new u(r)}}catch(e){throw i=D(i,e),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?w.destroyer(e,null):(e.off(`readable`,r),a())}}s(H.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ne.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[F]!==!1},set(e){this[F]=!!e}}}),H._fromList=ye;function ye(e,t){if(t.length===0)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function be(e){let t=e._readableState;S(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(xe,t,e))}function xe(e,t){if(S(`endReadableNT`,e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit(`end`),t.writable&&t.allowHalfOpen===!1)n.nextTick(Se,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||e.writable===!1))&&t.destroy()}}}function Se(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}H.from=function(e,t){return L(H,e,t)};let Ce;function we(){return Ce===void 0&&(Ce={}),Ce}H.fromWeb=function(e,t){return we().newStreamReadableFromReadableStream(e,t)},H.toWeb=function(e,t){return we().newReadableStreamFromStreamReadable(e,t)},H.wrap=function(e,t){return new H({objectMode:e.readableObjectMode??e.objectMode??!0,...t,destroy(t,n){w.destroyer(e,t),n(t)}}).wrap(e)}})),fj=U(((e,t)=>{let n=ej(),{ArrayPrototypeSlice:r,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:o,ObjectDefineProperties:s,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:l,Symbol:u,SymbolHasInstance:d}=qA();t.exports=P,P.WritableState=M;let{EventEmitter:f}=W(`events`),p=ij().Stream,{Buffer:m}=W(`buffer`),h=rj(),{addAbortSignal:g}=aj(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=sj(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:x,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:w,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:O}=YA().codes,{errorOrDestroy:k}=h;c(P.prototype,p.prototype),c(P,p);function A(){}let j=u(`kOnFinished`);function M(e,t,n){typeof n!=`boolean`&&(n=t instanceof mj()),this.objectMode=!!(e&&e.objectMode),n&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?v(this,e,`writableHighWaterMark`,n):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(e&&e.decodeStrings===!1),this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[j]=[]}function N(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}M.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},o(M.prototype,`bufferedRequestCount`,{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(e){let t=this instanceof mj();if(!t&&!a(P,this))return new P(e);this._writableState=new M(e,this,t),e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&g(e.signal,this)),p.call(this,e),h.construct(this,()=>{let e=this._writableState;e.writing||V(this,e),ie(this,e)})}o(P,d,{__proto__:null,value:function(e){return a(this,e)?!0:this===P?e&&e._writableState instanceof M:!1}}),P.prototype.pipe=function(){k(this,new C)};function F(e,t,r,i){let a=e._writableState;if(typeof r==`function`)i=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!==`buffer`&&!m.isEncoding(r))throw new O(r);typeof i!=`function`&&(i=A)}if(t===null)throw new E;if(!a.objectMode)if(typeof t==`string`)a.decodeStrings!==!1&&(t=m.from(t,r),r=`buffer`);else if(t instanceof m)r=`buffer`;else if(p._isUint8Array(t))t=p._uint8ArrayToBuffer(t),r=`buffer`;else throw new b(`chunk`,[`string`,`Buffer`,`Uint8Array`],t);let o;return a.ending?o=new D:a.destroyed&&(o=new w(`write`)),o?(n.nextTick(i,o),k(e,o,!0),o):(a.pendingcb++,I(e,a,t,r,i))}P.prototype.write=function(e,t,n){return F(this,e,t,n)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||V(this,e))},P.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=l(e)),!m.isEncoding(e))throw new O(e);return this._writableState.defaultEncoding=e,this};function I(e,t,n,r,i){let a=t.objectMode?1:n.length;t.length+=a;let o=t.lengthr.bufferedIndex&&V(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(ee,r.afterWriteTickInfo)):B(e,r,1,a))}function ee({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,B(e,t,n,r)}function B(e,t,n,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`));n-- >0;)t.pendingcb--,r();t.destroyed&&te(t),ie(e,t)}function te(e){if(e.writing)return;for(let t=e.bufferedIndex;t1&&e._writev){t.pendingcb-=o-1;let i=t.allNoop?A:e=>{for(let t=s;t256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}P.prototype._write=function(e,t,n){if(this._writev)this._writev([{chunk:e,encoding:t}],n);else throw new x(`_write()`)},P.prototype._writev=null,P.prototype.end=function(e,t,r){let a=this._writableState;typeof e==`function`?(r=e,e=null,t=null):typeof t==`function`&&(r=t,t=null);let o;if(e!=null){let n=F(this,e,t);n instanceof i&&(o=n)}return a.corked&&(a.corked=1,this.uncork()),o||(!a.errored&&!a.ending?(a.ending=!0,ie(this,a,!0),a.ended=!0):a.finished?o=new T(`end`):a.destroyed&&(o=new w(`end`))),typeof r==`function`&&(o||a.finished?n.nextTick(r,o):a[j].push(r)),this};function ne(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t){let r=!1;function i(i){if(r){k(e,i??S());return}if(r=!0,t.pendingcb--,i){let n=t[j].splice(0);for(let e=0;e{ne(t)?ae(e,t):t.pendingcb--},e,t)):ne(t)&&(t.pendingcb++,ae(e,t))))}function ae(e,t){t.pendingcb--,t.finished=!0;let n=t[j].splice(0);for(let e=0;e{let n=ej(),r=W(`buffer`),{isReadable:i,isWritable:a,isIterable:o,isNodeStream:s,isReadableNodeStream:c,isWritableNodeStream:l,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:f}=tj(),p=nj(),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:g}}=YA(),{destroyer:v}=rj(),y=mj(),b=dj(),x=fj(),{createDeferredPromise:S}=QA(),C=uj(),w=globalThis.Blob||r.Blob,T=w===void 0?function(e){return!1}:function(e){return e instanceof w},E=globalThis.AbortController||ZA().AbortController,{FunctionPrototypeCall:D}=qA();var O=class extends y{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function e(t,r){if(u(t))return t;if(c(t))return A({readable:t});if(l(t))return A({writable:t});if(s(t))return A({writable:!1,readable:!1});if(d(t))return A({readable:b.fromWeb(t)});if(f(t))return A({writable:x.fromWeb(t)});if(typeof t==`function`){let{value:e,write:i,final:a,destroy:s}=k(t);if(o(e))return C(O,e,{objectMode:!0,write:i,final:a,destroy:s});let c=e?.then;if(typeof c==`function`){let t,r=D(c,e,e=>{if(e!=null)throw new g(`nully`,`body`,e)},e=>{v(t,e)});return t=new O({objectMode:!0,readable:!1,write:i,final(e){a(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new g(`Iterable, AsyncIterable or AsyncFunction`,r,e)}if(T(t))return e(t.arrayBuffer());if(o(t))return C(O,t,{objectMode:!0,writable:!1});if(d(t?.readable)&&f(t?.writable))return O.fromWeb(t);if(typeof t?.writable==`object`||typeof t?.readable==`object`)return A({readable:t!=null&&t.readable?c(t?.readable)?t?.readable:e(t.readable):void 0,writable:t!=null&&t.writable?l(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if(typeof i==`function`){let e;return D(i,t,t=>{t!=null&&e.push(t),e.push(null)},t=>{v(e,t)}),e=new O({objectMode:!0,writable:!1,read(){}})}throw new h(r,[`Blob`,`ReadableStream`,`WritableStream`,`Stream`,`Iterable`,`AsyncIterable`,`Function`,`{ readable, writable } pair`,`Promise`],t)};function k(e){let{promise:t,resolve:r}=S(),i=new E,a=i.signal;return{value:e((async function*(){for(;;){let e=t;t=null;let{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new m(void 0,{cause:a.reason});({promise:t,resolve:r}=S()),yield i}})(),{signal:a}),write(e,t,n){let i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){let t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}function A(e){let t=e.readable&&typeof e.readable.read!=`function`?b.wrap(e.readable):e.readable,n=e.writable,r=!!i(t),o=!!a(n),s,c,l,u,d;function f(e){let t=u;u=null,t?t(e):e&&d.destroy(e)}return d=new O({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(n!=null&&n.writableObjectMode),readable:r,writable:o}),o&&(p(n,e=>{o=!1,e&&v(t,e),f(e)}),d._write=function(e,t,r){n.write(e,t)?r():s=r},d._final=function(e){n.end(),c=e},n.on(`drain`,function(){if(s){let e=s;s=null,e()}}),n.on(`finish`,function(){if(c){let e=c;c=null,e()}})),r&&(p(t,e=>{r=!1,e&&v(t,e),f(e)}),t.on(`readable`,function(){if(l){let e=l;l=null,e()}}),t.on(`end`,function(){d.push(null)}),d._read=function(){for(;;){let e=t.read();if(e===null){l=d._read;return}if(!d.push(e))return}}),d._destroy=function(e,r){!e&&u!==null&&(e=new m),l=null,s=null,c=null,u===null?r(e):(u=r,v(n,e),v(t,e))},d}})),mj=U(((e,t)=>{let{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:i,ObjectSetPrototypeOf:a}=qA();t.exports=c;let o=dj(),s=fj();a(c.prototype,o.prototype),a(c,o);{let e=i(s.prototype);for(let t=0;t{let{ObjectSetPrototypeOf:n,Symbol:r}=qA();t.exports=c;let{ERR_METHOD_NOT_IMPLEMENTED:i}=YA().codes,a=mj(),{getHighWaterMark:o}=sj();n(c.prototype,a.prototype),n(c,a);let s=r(`kCallback`);function c(e){if(!(this instanceof c))return new c(e);let t=e?o(this,e,`readableHighWaterMark`,!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[s]=null,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function l(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function u(){this._final!==l&&l.call(this)}c.prototype._final=l,c.prototype._transform=function(e,t,n){throw new i(`_transform()`)},c.prototype._write=function(e,t,n){let r=this._readableState,i=this._writableState,a=r.length;this._transform(e,t,(e,t)=>{if(e){n(e);return}t!=null&&this.push(t),i.ended||a===r.length||r.length{let{ObjectSetPrototypeOf:n}=qA();t.exports=i;let r=hj();n(i.prototype,r.prototype),n(i,r);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),_j=U(((e,t)=>{let n=ej(),{ArrayIsArray:r,Promise:i,SymbolAsyncIterator:a,SymbolDispose:o}=qA(),s=nj(),{once:c}=QA(),l=rj(),u=mj(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:v}=YA(),{validateFunction:y,validateAbortSignal:b}=$A(),{isIterable:x,isReadable:S,isReadableNodeStream:C,isNodeStream:w,isTransformStream:T,isWebStream:E,isReadableStream:D,isReadableFinished:O}=tj(),k=globalThis.AbortController||ZA().AbortController,A,j,M;function N(e,t,n){let r=!1;return e.on(`close`,()=>{r=!0}),{destroy:t=>{r||(r=!0,l.destroyer(e,t||new h(`pipe`)))},cleanup:s(e,{readable:t,writable:n},e=>{r=!e})}}function P(e){return y(e[e.length-1],`streams[stream.length - 1]`),e.pop()}function F(e){if(x(e))return e;if(C(e))return I(e);throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`],e)}async function*I(e){j||=dj(),yield*j.prototype[a].call(e)}async function L(e,t,n,{end:r}){let a,o=null,c=e=>{if(e&&(a=e),o){let e=o;o=null,e()}},l=()=>new i((e,t)=>{a?t(a):o=()=>{a?t(a):e()}});t.on(`drain`,c);let u=s(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let n of e)t.write(n)||await l();r&&(t.end(),await l()),n()}catch(e){n(a===e?e:d(a,e))}finally{u(),t.off(`drain`,c)}}async function R(e,t,n,{end:r}){T(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function z(...e){return ee(e,c(P(e)))}function ee(e,t,i){if(e.length===1&&r(e[0])&&(e=e[0]),e.length<2)throw new m(`streams`);let a=new k,s=a.signal,c=i?.signal,l=[];b(c,`options.signal`);function d(){I(new v)}M||=QA().addAbortListener;let h;c&&(h=M(c,d));let g,y,O=[],j=0;function P(e){I(e,--j===0)}function I(e,r){var i;if(e&&(!g||g.code===`ERR_STREAM_PREMATURE_CLOSE`)&&(g=e),!(!g&&!r)){for(;O.length;)O.shift()(g);(i=h)==null||i[o](),a.abort(),r&&(g||l.forEach(e=>e()),n.nextTick(t,g,y))}}let z;for(let t=0;t0,c=a||i?.end!==!1,d=t===e.length-1;if(w(r)){if(c){let{destroy:e,cleanup:t}=N(r,a,o);O.push(e),S(r)&&d&&l.push(t)}function e(e){e&&e.name!==`AbortError`&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&P(e)}r.on(`error`,e),S(r)&&d&&l.push(()=>{r.removeListener(`error`,e)})}if(t===0)if(typeof r==`function`){if(z=r({signal:s}),!x(z))throw new p(`Iterable, AsyncIterable or Stream`,`source`,z)}else z=x(r)||C(r)||T(r)?r:u.from(r);else if(typeof r==`function`)if(z=T(z)?F(z?.readable):F(z),z=r(z,{signal:s}),a){if(!x(z,!0))throw new p(`AsyncIterable`,`transform[${t-1}]`,z)}else{A||=gj();let e=new A({objectMode:!0}),t=z?.then;if(typeof t==`function`)j++,t.call(z,t=>{y=t,t!=null&&e.write(t),c&&e.end(),n.nextTick(P)},t=>{e.destroy(t),n.nextTick(P,t)});else if(x(z,!0))j++,L(z,e,P,{end:c});else if(D(z)||T(z)){let t=z.readable||z;j++,L(t,e,P,{end:c})}else throw new p(`AsyncIterable or Promise`,`destination`,z);z=e;let{destroy:r,cleanup:i}=N(z,!1,!0);O.push(r),d&&l.push(i)}else if(w(r)){if(C(z)){j+=2;let e=B(z,r,P,{end:c});S(r)&&d&&l.push(e)}else if(T(z)||D(z)){let e=z.readable||z;j++,L(e,r,P,{end:c})}else if(x(z))j++,L(z,r,P,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],z);z=r}else if(E(r)){if(C(z))j++,R(F(z),r,P,{end:c});else if(D(z)||x(z))j++,R(z,r,P,{end:c});else if(T(z))j++,R(z.readable,r,P,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],z);z=r}else z=u.from(r)}return(s!=null&&s.aborted||c!=null&&c.aborted)&&n.nextTick(d),z}function B(e,t,r,{end:i}){let a=!1;if(t.on(`close`,()=>{a||r(new g)}),e.pipe(t,{end:!1}),i){function r(){a=!0,t.end()}O(e)?n.nextTick(r):e.once(`end`,r)}else r();return s(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&t.code===`ERR_STREAM_PREMATURE_CLOSE`&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once(`end`,r).once(`error`,r):r(t)}),s(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:ee,pipeline:z}})),vj=U(((e,t)=>{let{pipeline:n}=_j(),r=mj(),{destroyer:i}=rj(),{isNodeStream:a,isReadable:o,isWritable:s,isWebStream:c,isTransformStream:l,isWritableStream:u,isReadableStream:d}=tj(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=YA(),h=nj();t.exports=function(...e){if(e.length===0)throw new m(`streams`);if(e.length===1)return r.from(e[0]);let t=[...e];if(typeof e[0]==`function`&&(e[0]=r.from(e[0])),typeof e[e.length-1]==`function`){let t=e.length-1;e[t]=r.from(e[t])}for(let n=0;n0&&!(s(e[n])||u(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be writable`)}let g,v,y,b,x;function S(e){let t=b;b=null,t?t(e):e?x.destroy(e):!E&&!T&&x.destroy()}let C=e[0],w=n(e,S),T=!!(s(C)||u(C)||l(C)),E=!!(o(w)||d(w)||l(w));if(x=new r({writableObjectMode:!!(C!=null&&C.writableObjectMode),readableObjectMode:!!(w!=null&&w.readableObjectMode),writable:T,readable:E}),T){if(a(C))x._write=function(e,t,n){C.write(e,t)?n():g=n},x._final=function(e){C.end(),v=e},C.on(`drain`,function(){if(g){let e=g;g=null,e()}});else if(c(C)){let e=(l(C)?C.writable:C).getWriter();x._write=async function(t,n,r){try{await e.ready,e.write(t).catch(()=>{}),r()}catch(e){r(e)}},x._final=async function(t){try{await e.ready,e.close().catch(()=>{}),v=t}catch(e){t(e)}}}h(l(w)?w.readable:w,()=>{if(v){let e=v;v=null,e()}})}if(E){if(a(w))w.on(`readable`,function(){if(y){let e=y;y=null,e()}}),w.on(`end`,function(){x.push(null)}),x._read=function(){for(;;){let e=w.read();if(e===null){y=x._read;return}if(!x.push(e))return}};else if(c(w)){let e=(l(w)?w.readable:w).getReader();x._read=async function(){for(;;)try{let{value:t,done:n}=await e.read();if(!x.push(t))return;if(n){x.push(null);return}}catch{return}}}}return x._destroy=function(e,t){!e&&b!==null&&(e=new f),y=null,g=null,v=null,b===null?t(e):(b=t,a(w)&&i(w,e))},x}})),yj=U(((e,t)=>{let n=globalThis.AbortController||ZA().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:o},AbortError:s}=YA(),{validateAbortSignal:c,validateInteger:l,validateObject:u}=$A(),d=qA().Symbol(`kWeak`),f=qA().Symbol(`kResistStopPropagation`),{finished:p}=nj(),m=vj(),{addAbortSignalNoValidate:h}=aj(),{isWritable:g,isNodeStream:v}=tj(),{deprecate:y}=QA(),{ArrayPrototypePush:b,Boolean:x,MathFloor:S,Number:C,NumberIsNaN:w,Promise:T,PromiseReject:E,PromiseResolve:D,PromisePrototypeThen:O,Symbol:k}=qA(),A=k(`kEmpty`),j=k(`kEof`);function M(e,t){if(t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),v(e)&&!g(e))throw new r(`stream`,e,`must be writable`);let n=m(this,e);return t!=null&&t.signal&&h(t.signal,n),n}function N(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`);let n=1;t?.concurrency!=null&&(n=S(t.concurrency));let r=n-1;return t?.highWaterMark!=null&&(r=S(t.highWaterMark)),l(n,`options.concurrency`,1),l(r,`options.highWaterMark`,0),r+=n,async function*(){let i=QA().AbortSignalAny([t?.signal].filter(x)),a=this,o=[],c={signal:i},l,u,d=!1,f=0;function p(){d=!0,m()}function m(){--f,h()}function h(){u&&!d&&f=r||f>=n)&&await new T(e=>{u=e})}o.push(j)}catch(e){let t=E(e);O(t,m,p),o.push(t)}finally{d=!0,l&&=(l(),null)}}g();try{for(;;){for(;o.length>0;){let e=await o[0];if(e===j)return;if(i.aborted)throw new s;e!==A&&(yield e),o.shift(),h()}await new T(e=>{l=e})}}finally{d=!0,u&&=(u(),null)}}.call(this)}function P(e=void 0){return e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`),async function*(){let t=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s({cause:e.signal.reason});yield[t++,r]}}.call(this)}async function F(e,t=void 0){for await(let n of z.call(this,e,t))return!0;return!1}async function I(e,t=void 0){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);return!await F.call(this,async(...t)=>!await e(...t),t)}async function L(e,t){for await(let n of z.call(this,e,t))return n}async function R(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n),A}for await(let e of N.call(this,n,t));}function z(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n)?t:A}return N.call(this,n,t)}var ee=class extends a{constructor(){super(`reduce`),this.message=`Reduce of an empty stream requires an initial value`}};async function B(e,t,r){var a;if(typeof e!=`function`)throw new i(`reducer`,[`Function`,`AsyncFunction`],e);r!=null&&u(r,`options`),r?.signal!=null&&c(r.signal,`options.signal`);let o=arguments.length>1;if(r!=null&&(a=r.signal)!=null&&a.aborted){let e=new s(void 0,{cause:r.signal.reason});throw this.once(`error`,()=>{}),await p(this.destroy(e)),e}let l=new n,m=l.signal;if(r!=null&&r.signal){let e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener(`abort`,()=>l.abort(),e)}let h=!1;try{for await(let n of this){var g;if(h=!0,r!=null&&(g=r.signal)!=null&&g.aborted)throw new s;o?t=await e(t,n,{signal:m}):(t=n,o=!0)}if(!h&&!o)throw new ee}finally{l.abort()}return t}async function te(e){e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`);let t=[];for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s(void 0,{cause:e.signal.reason});b(t,r)}return t}function V(e,t){let n=N.call(this,e,t);return async function*(){for await(let e of n)yield*e}.call(this)}function ne(e){if(e=C(e),w(e))return 0;if(e<0)throw new o(`number`,`>= 0`,e);return e}function H(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ne(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;e--<=0&&(yield n)}}.call(this)}function re(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ne(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;if(e-- >0&&(yield n),e<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:y(P,`readable.asIndexedPairs will be removed in a future version.`),drop:H,filter:z,flatMap:V,map:N,take:re,compose:M},t.exports.promiseReturningOperators={every:I,forEach:R,reduce:B,toArray:te,some:F,find:L}})),bj=U(((e,t)=>{let{ArrayPrototypePop:n,Promise:r}=qA(),{isIterable:i,isNodeStream:a,isWebStream:o}=tj(),{pipelineImpl:s}=_j(),{finished:c}=nj();xj();function l(...e){return new r((t,r)=>{let c,l,u=e[e.length-1];if(u&&typeof u==`object`&&!a(u)&&!i(u)&&!o(u)){let t=n(e);c=t.signal,l=t.end}s(e,(e,n)=>{e?r(e):t(n)},{signal:c,end:l})})}t.exports={finished:c,pipeline:l}})),xj=U(((e,t)=>{let{Buffer:n}=W(`buffer`),{ObjectDefineProperty:r,ObjectKeys:i,ReflectApply:a}=qA(),{promisify:{custom:o}}=QA(),{streamReturningOperators:s,promiseReturningOperators:c}=yj(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=YA(),u=vj(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=sj(),{pipeline:p}=_j(),{destroyer:m}=rj(),h=nj(),g=bj(),v=tj(),y=t.exports=ij().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=dj();for(let e of i(s)){let t=s[e];function n(...e){if(new.target)throw l();return y.Readable.from(a(t,this,e))}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(c)){let t=c[e];function n(...e){if(new.target)throw l();return a(t,this,e)}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}y.Writable=fj(),y.Duplex=mj(),y.Transform=hj(),y.PassThrough=gj(),y.pipeline=p;let{addAbortSignal:b}=aj();y.addAbortSignal=b,y.finished=h,y.destroy=m,y.compose=u,y.setDefaultHighWaterMark=d,y.getDefaultHighWaterMark=f,r(y,`promises`,{__proto__:null,configurable:!0,enumerable:!0,get(){return g}}),r(p,o,{__proto__:null,enumerable:!0,get(){return g.pipeline}}),r(h,o,{__proto__:null,enumerable:!0,get(){return g.finished}}),y.Stream=y,y._isUint8Array=function(e){return e instanceof Uint8Array},y._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}})),Sj=U(((e,t)=>{let n=W(`stream`);if(n&&process.env.READABLE_STREAM===`disable`){let e=n.promises;t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,`promises`,{configurable:!0,enumerable:!0,get(){return e}}),t.exports.Stream=n.Stream}else{let e=xj(),n=bj(),r=e.Readable.destroy;t.exports=e.Readable,t.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,t.exports._isUint8Array=e._isUint8Array,t.exports.isDisturbed=e.isDisturbed,t.exports.isErrored=e.isErrored,t.exports.isReadable=e.isReadable,t.exports.Readable=e.Readable,t.exports.Writable=e.Writable,t.exports.Duplex=e.Duplex,t.exports.Transform=e.Transform,t.exports.PassThrough=e.PassThrough,t.exports.addAbortSignal=e.addAbortSignal,t.exports.finished=e.finished,t.exports.destroy=e.destroy,t.exports.destroy=r,t.exports.pipeline=e.pipeline,t.exports.compose=e.compose,Object.defineProperty(e,`promises`,{configurable:!0,enumerable:!0,get(){return n}}),t.exports.Stream=e.Stream}t.exports.default=t.exports})),Cj=U(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n{var n=cA(),r=NA(),i=PA(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),Tj=U(((e,t)=>{var n=Cj(),r=wj();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),Ej=U(((e,t)=>{var n=Tj();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),Dj=U(((e,t)=>{t.exports=yA()(Object,`create`)})),Oj=U(((e,t)=>{var n=Dj();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),kj=U(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Aj=U(((e,t)=>{var n=Dj(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),jj=U(((e,t)=>{var n=Dj(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Mj=U(((e,t)=>{var n=Dj(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Nj=U(((e,t)=>{var n=Oj(),r=kj(),i=Aj(),a=jj(),o=Mj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{function n(){this.__data__=[],this.size=0}t.exports=n})),Fj=U(((e,t)=>{var n=TA();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Ij=U(((e,t)=>{var n=Fj(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Lj=U(((e,t)=>{var n=Fj();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Rj=U(((e,t)=>{var n=Fj();function r(e){return n(this.__data__,e)>-1}t.exports=r})),zj=U(((e,t)=>{var n=Fj();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Bj=U(((e,t)=>{var n=Pj(),r=Ij(),i=Lj(),a=Rj(),o=zj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{t.exports=yA()(sA(),`Map`)})),Hj=U(((e,t)=>{var n=Nj(),r=Bj(),i=Vj();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Uj=U(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Wj=U(((e,t)=>{var n=Uj();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Gj=U(((e,t)=>{var n=Wj();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Kj=U(((e,t)=>{var n=Wj();function r(e){return n(this,e).get(e)}t.exports=r})),qj=U(((e,t)=>{var n=Wj();function r(e){return n(this,e).has(e)}t.exports=r})),Jj=U(((e,t)=>{var n=Wj();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Yj=U(((e,t)=>{var n=Hj(),r=Gj(),i=Kj(),a=qj(),o=Jj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),Zj=U(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Qj=U(((e,t)=>{var n=Yj(),r=Xj(),i=Zj();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a{function n(e){return e!==e}t.exports=n})),tM=U(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r{var n=$j(),r=eM(),i=tM();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),rM=U(((e,t)=>{var n=nM();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),iM=U(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n{function n(e,t){return e.has(t)}t.exports=n})),sM=U(((e,t)=>{var n=Qj(),r=rM(),i=iM(),a=aM(),o=RA(),s=oM(),c=200;function l(e,t,l,u){var d=-1,f=r,p=!0,m=e.length,h=[],g=t.length;if(!m)return h;l&&(t=a(t,o(l))),u?(f=i,p=!1):t.length>=c&&(f=s,p=!1,t=new n(t));outer:for(;++d{var n=DA(),r=jA();function i(e){return r(e)&&n(e)}t.exports=i})),lM=U(((e,t)=>{var n=sM(),r=Tj(),i=wA(),a=cM();t.exports=i(function(e,t){return a(e)?n(e,r(t,1,a,!0)):[]})})),uM=U(((e,t)=>{t.exports=yA()(sA(),`Set`)})),dM=U(((e,t)=>{function n(){}t.exports=n})),fM=U(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),pM=U(((e,t)=>{var n=uM(),r=dM(),i=fM();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),mM=U(((e,t)=>{var n=Qj(),r=rM(),i=iM(),a=oM(),o=pM(),s=fM(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u{var n=Tj(),r=wA(),i=mM(),a=cM();t.exports=r(function(e){return i(n(e,1,a,!0))})})),gM=U(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),_M=U(((e,t)=>{t.exports=gM()(Object.getPrototypeOf,Object)})),vM=U(((e,t)=>{var n=dA(),r=_M(),i=jA(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),yM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertValidPattern=void 0,e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)}})),bM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseClass=void 0;let t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;lh?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`)})),SM=U((e=>{var t;Object.defineProperty(e,`__esModule`,{value:!0}),e.AST=void 0;let n=bM(),r=xM(),i=new Set([`!`,`?`,`+`,`*`,`@`]),a=e=>i.has(e),o=e=>a(e.type),s=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),c=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),l=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),u=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),d=`(?!\\.)`,f=new Set([`[`,`.`]),p=new Set([`..`,`.`]),m=new Set(`().*{}+?[]^$\\!`),h=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),g=`[^/]`,v=g+`*?`,y=g+`+?`;var b=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&rtypeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let n=0;n{let[r,a,o,s]=typeof n==`string`?t.#C(n,this.#t,i):n.toRegExpSource(e);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&p.has(this.#r[0]))){let t=f,r=n&&t.has(a.charAt(0))||a.startsWith(`\\.`)&&t.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&t.has(a.charAt(4)),i=!n&&!e&&t.has(a.charAt(0));o=r?`(?!(?:^|/)\\.\\.?(?:$|/))`:i?d:``}let s=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(s=`(?:$|\\/)`),[o+a+s,(0,r.unescape)(a),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,s=this.#S(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,(0,r.unescape)(this.toString()),!1,!1]}let c=!i||e||n?``:this.#S(!0);c===s&&(c=``),c&&(s=`(?:${s})(?:${c})*?`);let l=``;if(this.type===`!`&&this.#u)l=(this.isStart()&&!n?d:``)+y;else{let t=this.type===`!`?`))`+(this.isStart()&&!n&&!e?d:``)+v+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&c?`)`:this.type===`*`&&c?`)?`:`)${this.type}`;l=a+s+t}return[l,(0,r.unescape)(s),this.#t=!!this.#t,this.#n]}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,i=!1){let a=!1,o=``,s=!1,c=!1;for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),wM=U((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;let n=t(Dk()),r=yM(),i=SM(),a=CM(),o=xM();e.minimatch=(e,t,n={})=>((0,r.assertValidPattern)(t),!n.nocomment&&t.charAt(0)===`#`?!1:new N(t,n).match(e));let s=/^\*+([^+@!?\*\[\(]*)$/,c=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),l=e=>t=>t.endsWith(e),u=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),d=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),f=/^\*+\.\*+$/,p=e=>!e.startsWith(`.`)&&e.includes(`.`),m=e=>e!==`.`&&e!==`..`&&e.includes(`.`),h=/^\.\*+$/,g=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),v=/^\*+$/,y=e=>e.length!==0&&!e.startsWith(`.`),b=e=>e.length!==0&&e!==`.`&&e!==`..`,x=/^\?+([^+@!?\*\[\(]*)?$/,S=([e,t=``])=>{let n=E([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},C=([e,t=``])=>{let n=D([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},w=([e,t=``])=>{let n=D([e]);return t?e=>n(e)&&e.endsWith(t):n},T=([e,t=``])=>{let n=E([e]);return t?e=>n(e)&&e.endsWith(t):n},E=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},D=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},O=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,k={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=O===`win32`?k.win32.sep:k.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR,e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;let A=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,A(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,A(t,n))}static defaults(e){return n.defaults(A(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,A(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,A(t,r))}},unescape:(e,r={})=>n.unescape(e,A(t,r)),escape:(e,r={})=>n.escape(e,A(t,r)),filter:(e,r={})=>n.filter(e,A(t,r)),defaults:e=>n.defaults(A(t,e)),makeRe:(e,r={})=>n.makeRe(e,A(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,A(t,r)),match:(e,r,i={})=>n.match(e,r,A(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,t={})=>((0,r.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,n.default)(e)),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new N(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new N(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;let j=/[?*]|[+@!]\(.*?\)|\[|\]/,M=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var N=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){(0,r.assertValidPattern)(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||O,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!j.test(e[2]))&&!j.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;nr&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;ee.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r=2&&(t=this.levelTwoFileOptimize(t)),n.includes(e.GLOBSTAR)?this.#e(t,n,r,i,a):this.#n(t,n,r,i,a)}#e(t,n,r,i,a){let o=n.indexOf(e.GLOBSTAR,a),s=n.lastIndexOf(e.GLOBSTAR),[c,l,u]=r?[n.slice(a,o),n.slice(o+1),[]]:[n.slice(a,o),n.slice(o+1,s),n.slice(s+1)];if(c.length){let e=t.slice(i,i+c.length);if(!this.#n(e,c,r,0,0))return!1;i+=c.length}let d=0;if(u.length){if(u.length+i>t.length)return!1;let e=t.length-u.length;if(this.#n(t,u,r,e,0))d=u.length;else{if(t[t.length-1]!==``||i+u.length===t.length||(e--,!this.#n(t,u,r,e,0)))return!1;d=u.length+1}}if(!l.length){let e=!!d;for(let n=i;n{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?M(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});return n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))}),n.filter(t=>t!==e.GLOBSTAR).join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=void 0;let t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(a===void 0){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}let s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null;var u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#e=!1;static create(t){let n=l(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:r=0,ttl:a,ttlResolution:o=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:m,dispose:h,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:y,maxSize:b=0,maxEntrySize:x=0,sizeCalculation:S,fetchMethod:C,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:O,ignoreFetchAbort:k}=t;if(r!==0&&!c(r))throw TypeError(`max option must be a nonnegative integer`);let A=r?l(r):Array;if(!A)throw Error(`invalid max value: `+r);if(this.#e=r,this.#t=b,this.maxEntrySize=x||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(w!==void 0&&typeof w!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=w,C!==void 0&&typeof C!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=C,this.#x=!!C,this.#c=new Map,this.#l=Array(r).fill(void 0),this.#u=Array(r).fill(void 0),this.#d=new A(r),this.#f=new A(r),this.#p=0,this.#m=0,this.#h=d.create(r),this.#o=0,this.#s=0,typeof h==`function`&&(this.#n=h),typeof g==`function`?(this.#r=g,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!v,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=c(o)||o===0?o:1,this.ttlAutopurge=!!u,this.ttl=a||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new u(this.#e),n=new u(this.#e);this.#y=e,this.#v=n,this.#E=(r,i,a=t.now())=>{if(n[r]=i===0?0:a,e[r]=i,i!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(r)&&this.#B(this.#l[r],`expire`)},i+1);e.unref&&e.unref()}},this.#w=r=>{n[r]=e[r]===0?0:t.now()},this.#T=(t,a)=>{if(e[a]){let o=e[a],s=n[a];if(!o||!s)return;t.ttl=o,t.start=s,t.now=r||i(),t.remainingTTL=o-(t.now-s)}};let r=0,i=()=>{let e=t.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let a=this.#c.get(t);if(a===void 0)return 0;let o=e[a],s=n[a];return!o||!s?1/0:o-((r||i())-s)},this.#D=t=>{let a=n[t],o=e[t];return!!o&&!!a&&(r||i())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};#D=()=>!1;#O(){let e=new u(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let n=this.#c.get(e);if(n===void 0)return;let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0)return;let a={value:i};if(this.#y&&this.#v){let e=this.#y[n],r=this.#v[n];e&&r&&(a.ttl=e-(t.now()-r),a.start=Date.now())}return this.#_&&(a.size=this.#_[n]),a}dump(){let e=[];for(let n of this.#M({allowStale:!0})){let r=this.#l[n],i=this.#u[n],a=this.#L(i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;let o={value:a};if(this.#y&&this.#v){o.ttl=this.#y[n];let e=t.now()-this.#v[n];o.start=Math.floor(Date.now()-e)}this.#_&&(o.size=this.#_[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason);let l=p;return this.#u[t]===p&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e)),d=r=>{let{aborted:i}=o.signal,a=i&&n.allowStaleOnFetchAbort,s=a||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=p;if(this.#u[t]===p&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):a||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},f=(t,r)=>{let a=this.#i?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=m,m}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:v}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let y={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:v},b=this.#c.get(e);if(b===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,b,y,m);return t.__returned=t}else{let t=this.#u[b];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(b);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(b),r&&this.#w(b),g&&this.#T(g,b),t;let a=this.#I(e,b,y,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}else a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}})),EM=U((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;let n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=W(`node:events`),i=t(W(`node:stream`)),a=W(`node:string_decoder`);e.isStream=t=>!!t&&typeof t==`object`&&(t instanceof ie||t instanceof i.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==i.default.Writable.prototype.pipe,e.isWritable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`;let o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),v=Symbol(`flowing`),y=Symbol(`paused`),b=Symbol(`resume`),x=Symbol(`buffer`),S=Symbol(`pipes`),C=Symbol(`bufferLength`),w=Symbol(`bufferPush`),T=Symbol(`bufferShift`),E=Symbol(`objectMode`),D=Symbol(`destroyed`),O=Symbol(`error`),k=Symbol(`emitData`),A=Symbol(`emitEnd`),j=Symbol(`emitEnd2`),M=Symbol(`async`),N=Symbol(`abort`),P=Symbol(`aborted`),F=Symbol(`signal`),I=Symbol(`dataListeners`),L=Symbol(`discarded`),R=e=>Promise.resolve().then(e),z=e=>e(),ee=e=>e===`end`||e===`finish`||e===`prefinish`,B=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,te=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);var V=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[b](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ne=class extends V{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}};let H=e=>!!e.objectMode,re=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`;var ie=class extends r.EventEmitter{[v]=!1;[y]=!1;[S]=[];[x]=[];[E];[h];[M];[g];[o]=!1;[c]=!1;[l]=!1;[d]=!1;[u]=null;[C]=0;[D]=!1;[F];[P]=!1;[I]=0;[L]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);H(t)?(this[E]=!0,this[h]=null):re(t)?(this[h]=t.encoding,this[E]=!1):(this[E]=!1,this[h]=null),this[M]=!!t.async,this[g]=this[h]?new a.StringDecoder(this[h]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,`buffer`,{get:()=>this[x]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,`pipes`,{get:()=>this[S]});let{signal:n}=t;n&&(this[F]=n,n.aborted?this[N]():n.addEventListener(`abort`,()=>this[N]()))}get bufferLength(){return this[C]}get encoding(){return this[h]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[E]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[M]}set async(e){this[M]=this[M]||!!e}[N](){this[P]=!0,this.emit(`abort`,this[F]?.reason),this.destroy(this[F]?.reason)}get aborted(){return this[P]}set aborted(e){}write(e,t,n){if(this[P])return!1;if(this[o])throw Error(`write after end`);if(this[D])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[M]?R:z;if(!this[E]&&!Buffer.isBuffer(e)){if(te(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(B(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[E]?(this[v]&&this[C]!==0&&this[p](!0),this[v]?this.emit(`data`,e):this[w](e),this[C]!==0&&this.emit(`readable`),n&&r(n),this[v]):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this[v]&&this[C]!==0&&this[p](!0),this[v]?this.emit(`data`,e):this[w](e),this[C]!==0&&this.emit(`readable`),n&&r(n),this[v]):(this[C]!==0&&this.emit(`readable`),n&&r(n),this[v])}read(e){if(this[D])return null;if(this[L]=!1,this[C]===0||e===0||e&&e>this[C])return this[s](),null;this[E]&&(e=null),this[x].length>1&&!this[E]&&(this[x]=[this[h]?this[x].join(``):Buffer.concat(this[x],this[C])]);let t=this[f](e||null,this[x][0]);return this[s](),t}[f](e,t){if(this[E])this[T]();else{let n=t;e===n.length||e===null?this[T]():typeof n==`string`?(this[x][0]=n.slice(e),t=n.slice(0,e),this[C]-=e):(this[x][0]=n.subarray(e),t=n.subarray(0,e),this[C]-=e)}return this.emit(`data`,t),!this[x].length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this[v]||!this[y])&&this[s](),this}[b](){this[D]||(!this[I]&&!this[S].length&&(this[L]=!0),this[y]=!1,this[v]=!0,this.emit(`resume`),this[x].length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[b]()}pause(){this[v]=!1,this[y]=!0,this[L]=!1}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[y]}[w](e){this[E]?this[C]+=1:this[C]+=e.length,this[x].push(e)}[T](){return this[E]?--this[C]:this[C]-=this[x][0].length,this[x].shift()}[p](e=!1){do;while(this[m](this[T]())&&this[x].length);!e&&!this[x].length&&!this[o]&&this.emit(`drain`)}[m](e){return this.emit(`data`,e),this[v]}pipe(e,t){if(this[D])return e;this[L]=!1;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[S].push(t.proxyErrors?new ne(this,e,t):new V(this,e,t)),this[M]?R(()=>this[b]()):this[b]()),e}unpipe(e){let t=this[S].find(t=>t.dest===e);t&&(this[S].length===1?(this[v]&&this[I]===0&&(this[v]=!1),this[S]=[]):this[S].splice(this[S].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[L]=!1,this[I]++,!this[S].length&&!this[v]&&this[b]();else if(e===`readable`&&this[C]!==0)super.emit(`readable`);else if(ee(e)&&this[c])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[u]){let e=t;this[M]?R(()=>e.call(this,this[u])):e.call(this,this[u])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[I]=this.listeners(`data`).length,this[I]===0&&!this[L]&&!this[S].length&&(this[v]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[I]=0,!this[L]&&!this[S].length&&(this[v]=!1)),t}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[D]&&this[x].length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==D&&this[D])return!1;if(e===`data`)return!this[E]&&!n?!1:this[M]?(R(()=>this[k](n)),!0):this[k](n);if(e===`end`)return this[A]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[D])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=n,super.emit(O,n);let e=!this[F]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[s](),r}[k](e){for(let t of this[S])t.dest.write(e)===!1&&this.pause();let t=this[L]?!1:super.emit(`data`,e);return this[s](),t}[A](){return this[c]?!1:(this[c]=!0,this.readable=!1,this[M]?(R(()=>this[j]()),!0):this[j]())}[j](){if(this[g]){let e=this[g].end();if(e){for(let t of this[S])t.dest.write(e);this[L]||super.emit(`data`,e)}}for(let e of this[S])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[E]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[E]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[E])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[h]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(D,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[L]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[o])return t();let r,i,a=e=>{this.off(`data`,s),this.off(`end`,c),this.off(D,l),t(),i(e)},s=e=>{this.off(`error`,a),this.off(`end`,c),this.off(D,l),this.pause(),r({value:e,done:!!this[o]})},c=()=>{this.off(`error`,a),this.off(`data`,s),this.off(D,l),t(),r({done:!0,value:void 0})},l=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(D,l),this.once(`error`,a),this.once(`end`,c),this.once(`data`,s)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[L]=!1;let e=!1,t=()=>(this.pause(),this.off(O,t),this.off(D,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(O,t),this.once(D,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[D])return e?this.emit(`error`,e):this.emit(D),this;this[D]=!0,this[L]=!0,this[x].length=0,this[C]=0;let t=this;return typeof t.close==`function`&&!this[d]&&t.close(),e?this.emit(`error`,e):this.emit(D),this}static get isStream(){return e.isStream}};e.Minipass=ie})),DM=U((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.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;let i=TM(),a=W(`node:path`),o=W(`node:url`),s=W(`fs`),c=r(W(`node:fs`)),l=s.realpathSync.native,u=W(`node:fs/promises`),d=EM(),f={lstatSync:s.lstatSync,readdir:s.readdir,readdirSync:s.readdirSync,readlinkSync:s.readlinkSync,realpathSync:l,promises:{lstat:u.lstat,readdir:u.readdir,readlink:u.readlink,realpath:u.realpath}},p=e=>!e||e===f||e===c?f:{...f,...e,promises:{...f.promises,...e.promises||{}}},m=/^\\\\\?\\([a-z]:)\\?$/i,h=e=>e.replace(/\//g,`\\`).replace(m,`$1\\`),g=/[\\\/]/,v=e=>e.isFile()?8:e.isDirectory()?4:e.isSymbolicLink()?10:e.isCharacterDevice()?2:e.isBlockDevice()?6:e.isSocket()?12:e.isFIFO()?1:0,y=new Map,b=e=>{let t=y.get(e);if(t)return t;let n=e.normalize(`NFKD`);return y.set(e,n),n},x=new Map,S=e=>{let t=x.get(e);if(t)return t;let n=b(e.toLowerCase());return x.set(e,n),n};var C=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=C;var w=class extends i.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}};e.ChildrenCache=w;let T=Symbol(`PathScurry setAsCwd`);var E=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#c;get ino(){return this.#c}#l;get size(){return this.#l}#u;get blocks(){return this.#u}#d;get atimeMs(){return this.#d}#f;get mtimeMs(){return this.#f}#p;get ctimeMs(){return this.#p}#m;get birthtimeMs(){return this.#m}#h;get atime(){return this.#h}#g;get mtime(){return this.#g}#_;get ctime(){return this.#_}#v;get birthtime(){return this.#v}#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=0,n,r,i,a,o){this.name=e,this.#y=i?S(e):b(e),this.#T=t&1023,this.nocase=i,this.roots=r,this.root=n||this,this.#E=a,this.#x=o.fullpath,this.#C=o.relative,this.#w=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=p(o.fs)}depth(){return this.#b===void 0?this.parent?this.#b=this.parent.depth()+1:this.#b=0:this.#b}childrenCache(){return this.#E}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(n):this.#k(n)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#E.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#E.set(this,t),this.#T&=-17,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?S(e):b(e);for(let e of n)if(e.#y===r)return e;let i=this.parent?this.sep:``,a=this.#x?this.#x+i+e:void 0,o=this.newChild(e,0,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=128),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;return t?this.#x=t.fullpath()+(t.parent?this.sep:``)+e:this.#x=this.name}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep===`/`)return this.#S=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return/^[a-z]:\//i.test(e)?this.#S=`//?/${e}`:this.#S=e}let e=this.parent,t=e.fullpathPosix();return this.#S=t+(!t||!e.parent?``:`/`)+this.name}isUnknown(){return(this.#T&15)==0}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?`Unknown`:this.isDirectory()?`Directory`:this.isFile()?`File`:this.isSymbolicLink()?`SymbolicLink`:this.isFIFO()?`FIFO`:this.isCharacterDevice()?`CharacterDevice`:this.isBlockDevice()?`BlockDevice`:this.isSocket()?`Socket`:`Unknown`}isFile(){return(this.#T&15)==8}isDirectory(){return(this.#T&15)==4}isCharacterDevice(){return(this.#T&15)==2}isBlockDevice(){return(this.#T&15)==6}isFIFO(){return(this.#T&15)==1}isSocket(){return(this.#T&15)==12}isSymbolicLink(){return(this.#T&10)==10}lstatCached(){return this.#T&32?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#T&15;return!(e!==0&&e!==10||this.#T&256||this.#T&128)}calledReaddir(){return!!(this.#T&16)}isENOENT(){return!!(this.#T&128)}isNamed(e){return this.nocase?this.#y===S(e):this.#y===b(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}#A(e){this.#T|=16;for(let t=e.provisional;tt(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#U.push(e),this.#W)return;this.#W=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#F(e.code),n.provisional=0;else{for(let e of t)this.#R(e,n);this.#A(n)}this.#G(n.slice(0,n.provisional))})}#K;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#K)await this.#K;else{let n=()=>{};this.#K=new Promise(e=>n=e);try{for(let n of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}this.#K=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#T&704)return!1;let e=15&this.#T;return e===0||e===4||e===10}shouldWalk(e,t){return(this.#T&4)==4&&!(this.#T&704)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!(896&this.#T))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!(896&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[T](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#C=n.join(this.sep),r.#w=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#C=void 0,r.#w=void 0,r=r.parent}};e.PathBase=E;var D=class e extends E{sep=`\\`;splitSep=g;constructor(e,t=0,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=0,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return a.win32.parse(e).root}getRoot(e){if(e=h(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new A(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(m,`$1\\`),e===t}};e.PathWin32=D;var O=class e extends E{splitSep=`/`;sep=`/`;constructor(e,t=0,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=0,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};e.PathPosix=O;var k=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16*1024,fs:a=f}={}){this.#r=p(a),(e instanceof URL||e.startsWith(`file://`))&&(e=(0,o.fileURLToPath)(e));let s=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),this.#e=new C,this.#t=new C,this.#n=new w(i);let c=s.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw TypeError(`must provide nocase setting to PathScurryBase ctor`);this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,m=this.rootPath,h=!1;for(let e of c){let t=u--;l=l.child(e,{relative:Array(t).fill(`..`).join(d),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:m+=(h?``:d)+e}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#e.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new d.Minipass({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new d.Minipass({objectMode:!0}),s=new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[T](t)}};e.PathScurryBase=k;var A=class extends k{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,a.win32,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return a.win32.parse(e).root.toUpperCase()}newRoot(e){return new D(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}};e.PathScurryWin32=A;var j=class extends k{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,a.posix,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new O(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}};e.PathScurryPosix=j;var M=class extends j{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};e.PathScurryDarwin=M,e.Path=process.platform===`win32`?D:O,e.PathScurry=process.platform===`win32`?A:process.platform===`darwin`?M:j})),OM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pattern=void 0;let t=wM(),n=e=>e.length>=1,r=e=>e.length>=1;e.Pattern=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,i,a){if(!n(e))throw TypeError(`empty pattern list`);if(!r(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#e=e,this.#t=t,this.#n=i,this.#r=a,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#e,[a,o,s,c,...l]=this.#t;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#e=[u,...i],this.#t=[d,...l],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#e,[n,...r]=this.#t;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#e=[i,...t],this.#t=[a,...r],this.length=this.#e.length}}}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]==`string`}isGlobstar(){return this.#e[this.#n]===t.GLOBSTAR}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join(`/`):this.#t.join(`/`):this.#t.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#i===void 0?this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#n+1,this.#r),this.#i.#c=this.#c,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null:this.#i}isUNC(){let e=this.#e;return this.#s===void 0?this.#s=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#s}isDrive(){let e=this.#e;return this.#o===void 0?this.#o=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#o}isAbsolute(){let e=this.#e;return this.#c===void 0?this.#c=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#c}root(){let e=this.#e[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}}})),kM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Ignore=void 0;let t=wM(),n=OM(),r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:a,platform:o=r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let r=new t.Minimatch(e,this.mmopts);for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;let t=wM();var n=class e{store;constructor(e=new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}};e.HasWalkedCache=n;var r=class{store=new Map;add(e,t,n){let r=(t?2:0)|(n?1:0),i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};e.MatchRecord=r;var i=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};e.SubWalks=i,e.Processor=class e{hasWalkedCache;matches=new r;subwalks=new i;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new n}processPatterns(e,n){this.patterns=n;let r=n.map(t=>[e,t]);for(let[e,n]of r){this.hasWalkedCache.storeWalked(e,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){e=e.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let t=n.rest();if(t)n=t;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)e=e.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(e,n))continue;this.hasWalkedCache.storeWalked(e,n)}if(typeof a==`string`){let t=a===`..`||a===``||a===`.`;this.matches.add(e.resolve(a),i,t);continue}else if(a===t.GLOBSTAR){(!e.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(e,n);let t=o?.pattern(),r=o?.rest();if(!o||(t===``||t===`.`)&&!r)this.matches.add(e,i,t===``||t===`.`);else if(t===`..`){let t=e.parent||e;r?this.hasWalkedCache.hasWalked(t,r)||this.subwalks.add(t,r):this.matches.add(t,i,!0)}}else a instanceof RegExp&&this.subwalks.add(e,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let e of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===t.GLOBSTAR?i.testGlobstar(e,n,o,r):a instanceof RegExp?i.testRegExp(e,a,o,r):i.testString(e,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}})),jM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;let t=EM(),n=kM(),r=AM(),i=(e,t)=>typeof e==`string`?new n.Ignore([e],t):Array.isArray(e)?new n.Ignore(e,t):e;var a=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=i(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let t=`${e.relativePosix()}/**`;this.#t.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new r.Processor(this.opts),n)}walkCB2(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new r.Processor(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}};e.GlobUtil=a,e.GlobWalker=class extends a{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},e.GlobStream=class extends a{results;constructor(e,n,r){super(e,n,r),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}})),MM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Glob=void 0;let t=wM(),n=W(`node:url`),r=DM(),i=OM(),a=jM(),o=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Glob=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,a){if(!a)throw TypeError(`glob options required`);if(this.withFileTypes=!!a.withFileTypes,this.signal=a.signal,this.follow=!!a.follow,this.dot=!!a.dot,this.dotRelative=!!a.dotRelative,this.nodir=!!a.nodir,this.mark=!!a.mark,a.cwd?(a.cwd instanceof URL||a.cwd.startsWith(`file://`))&&(a.cwd=(0,n.fileURLToPath)(a.cwd)):this.cwd=``,this.cwd=a.cwd||``,this.root=a.root,this.magicalBraces=!!a.magicalBraces,this.nobrace=!!a.nobrace,this.noext=!!a.noext,this.realpath=!!a.realpath,this.absolute=a.absolute,this.includeChildMatches=a.includeChildMatches!==!1,this.noglobstar=!!a.noglobstar,this.matchBase=!!a.matchBase,this.maxDepth=typeof a.maxDepth==`number`?a.maxDepth:1/0,this.stat=!!a.stat,this.ignore=a.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(a.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=a.platform||o,this.opts={...a,platform:this.platform},a.scurry){if(this.scurry=a.scurry,a.nocase!==void 0&&a.nocase!==a.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else this.scurry=new(a.platform===`win32`?r.PathScurryWin32:a.platform===`darwin`?r.PathScurryDarwin:a.platform?r.PathScurryPosix:r.PathScurry)(this.cwd,{nocase:a.nocase,fs:a.fs});this.nocase=this.scurry.nocase;let s=this.platform===`darwin`||this.platform===`win32`,c={...a,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[l,u]=this.pattern.map(e=>new t.Minimatch(e,c)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=l.map((e,t)=>{let n=u[t];if(!n)throw Error(`invalid pattern object`);return new i.Pattern(e,n,0,this.platform)})}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}})),NM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasMagic=void 0;let t=wM();e.hasMagic=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new t.Minimatch(r,n).hasMagic())return!0;return!1}})),PM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0,e.globStreamSync=c,e.globStream=l,e.globSync=u,e.globIterateSync=f,e.globIterate=p;let t=wM(),n=MM(),r=NM();var i=wM();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return i.escape}}),Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return i.unescape}});var a=MM();Object.defineProperty(e,`Glob`,{enumerable:!0,get:function(){return a.Glob}});var o=NM();Object.defineProperty(e,`hasMagic`,{enumerable:!0,get:function(){return o.hasMagic}});var s=kM();Object.defineProperty(e,`Ignore`,{enumerable:!0,get:function(){return s.Ignore}});function c(e,t={}){return new n.Glob(e,t).streamSync()}function l(e,t={}){return new n.Glob(e,t).stream()}function u(e,t={}){return new n.Glob(e,t).walkSync()}async function d(e,t={}){return new n.Glob(e,t).walk()}function f(e,t={}){return new n.Glob(e,t).iterateSync()}function p(e,t={}){return new n.Glob(e,t).iterate()}e.streamSync=c,e.stream=Object.assign(l,{sync:c}),e.iterateSync=f,e.iterate=Object.assign(p,{sync:f}),e.sync=Object.assign(u,{stream:c,iterate:f}),e.glob=Object.assign(d,{glob:d,globSync:u,sync:e.sync,globStream:l,stream:e.stream,globStreamSync:c,streamSync:e.streamSync,globIterate:p,iterate:e.iterate,globIterateSync:f,iterateSync:e.iterateSync,Glob:n.Glob,hasMagic:r.hasMagic,escape:t.escape,unescape:t.unescape}),e.glob.glob=e.glob})),FM=U(((e,t)=>{var n=Pk(),r=W(`path`),i=Ej(),a=lM(),o=hM(),s=vM(),c=PM(),l=t.exports={},u=/[\/\\]/g,d=function(e,t){var n=[];return i(e).forEach(function(e){var r=e.indexOf(`!`)===0;r&&(e=e.slice(1));var i=t(e);n=r?a(n,i):o(n,i)}),n};l.exists=function(){var e=r.join.apply(r,arguments);return n.existsSync(e)},l.expand=function(...e){var t=s(e[0])?e.shift():{},i=Array.isArray(e[0])?e[0]:e;if(i.length===0)return[];var a=d(i,function(e){return c.sync(e,t)});return t.filter&&(a=a.filter(function(e){e=r.join(t.cwd||``,e);try{return typeof t.filter==`function`?t.filter(e):n.statSync(e)[t.filter]()}catch{return!1}})),a},l.expandMapping=function(e,t,n){n=Object.assign({rename:function(e,t){return r.join(e||``,t)}},n);var i=[],a={};return l.expand(n,e).forEach(function(e){var o=e;n.flatten&&(o=r.basename(o)),n.ext&&(o=o.replace(/(\.[^\/]*)?$/,n.ext));var s=n.rename(t,o,n);n.cwd&&(e=r.join(n.cwd,e)),s=s.replace(u,`/`),e=e.replace(u,`/`),a[s]?a[s].src.push(e):(i.push({src:[e],dest:s}),a[s]=i[i.length-1])}),i},l.normalizeFilesArray=function(e){var t=[];return e.forEach(function(e){(`src`in e||`dest`in e)&&t.push(e)}),t.length===0?[]:(t=_(t).chain().forEach(function(e){!(`src`in e)||!e.src||(Array.isArray(e.src)?e.src=i(e.src):e.src=[e.src])}).map(function(e){var t=Object.assign({},e);if(delete t.src,delete t.dest,e.expand)return l.expandMapping(e.src,e.dest,t).map(function(t){var n=Object.assign({},e);return n.orig=Object.assign({},e),n.src=t.src,n.dest=t.dest,[`expand`,`cwd`,`flatten`,`rename`,`ext`].forEach(function(e){delete n[e]}),n});var n=Object.assign({},e);return n.orig=Object.assign({},e),`src`in n&&Object.defineProperty(n,`src`,{enumerable:!0,get:function n(){var r;return`result`in n||(r=e.src,r=Array.isArray(r)?i(r):[r],n.result=l.expand(t,r)),n.result}}),`dest`in n&&(n.dest=e.dest),n}).flatten().value(),t)}})),IM=U(((e,t)=>{var n=Pk(),r=W(`path`),i=Fk(),a=eA(),o=tA(),s=KA();W(`stream`).Stream;var c=Sj().PassThrough,l=t.exports={};l.file=FM(),l.collectStream=function(e,t){var n=[],r=0;e.on(`error`,t),e.on(`data`,function(e){n.push(e),r+=e.length}),e.on(`end`,function(){var e=Buffer.alloc(r),i=0;n.forEach(function(t){t.copy(e,i),i+=t.length}),t(null,e)})},l.dateify=function(e){return e||=new Date,e=e instanceof Date?e:typeof e==`string`?new Date(e):new Date,e},l.defaults=function(e,t,n){var r=arguments;return r[0]=r[0]||{},s(...r)},l.isStream=function(e){return i(e)},l.lazyReadStream=function(e){return new a.Readable(function(){return n.createReadStream(e)})},l.normalizeInputSource=function(e){return e===null?Buffer.alloc(0):typeof e==`string`?Buffer.from(e):l.isStream(e)?e.pipe(new c):e},l.sanitizePath=function(e){return o(e,!1).replace(/^\w+:/,``).replace(/^(\.\.\/|\/)+/,``)},l.trailingSlashIt=function(e){return e.slice(-1)===`/`?e:e+`/`},l.unixifyPath=function(e){return o(e,!1).replace(/^\w+:/,``)},l.walkdir=function(e,t,i){var a=[];typeof t==`function`&&(i=t,t=e),n.readdir(e,function(o,s){var c=0,u,d;if(o)return i(o);(function o(){if(u=s[c++],!u)return i(null,a);d=r.join(e,u),n.stat(d,function(e,n){a.push({path:d,relative:r.relative(t,d).replace(/\\/g,`/`),stats:n}),n&&n.isDirectory()?l.walkdir(d,t,function(e,t){if(e)return i(e);t.forEach(function(e){a.push(e)}),o()}):o()})})()})}})),LM=U(((e,t)=>{ +var n=W(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),sj=U((e=>{var t=oj().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):``}})),cj=U(((e,t)=>{let n=QA(),{PromisePrototypeThen:r,SymbolAsyncIterator:i,SymbolIterator:a}=GA(),{Buffer:o}=W(`buffer`),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:c}=qA().codes;function l(e,t,l){let u;if(typeof t==`string`||t instanceof o)return new e({objectMode:!0,...l,read(){this.push(t),this.push(null)}});let d;if(t&&t[i])d=!0,u=t[i]();else if(t&&t[a])d=!1,u=t[a]();else throw new s(`iterable`,[`Iterable`],t);let f=new e({objectMode:!0,highWaterMark:1,...l}),p=!1;f._read=function(){p||(p=!0,h())},f._destroy=function(e,t){r(m(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))};async function m(e){let t=e!=null,n=typeof u.throw==`function`;if(t&&n){let{value:t,done:n}=await u.throw(e);if(await t,n)return}if(typeof u.return==`function`){let{value:e}=await u.return();await e}}async function h(){for(;;){try{let{value:e,done:t}=d?await u.next():u.next();if(t)f.push(null);else{let t=e&&typeof e.then==`function`?await e:e;if(t===null)throw p=!1,new c;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}return f}t.exports=l})),lj=U(((e,t)=>{let n=QA(),{ArrayPrototypeIndexOf:r,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:o,ObjectDefineProperties:s,ObjectKeys:c,ObjectSetPrototypeOf:l,Promise:u,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:m}=GA();t.exports=H,H.ReadableState=ne;let{EventEmitter:h}=W(`events`),{Stream:g,prependListener:v}=nj(),{Buffer:y}=W(`buffer`),{addAbortSignal:b}=rj(),x=ej(),S=XA().debuglog(`stream`,e=>{S=e}),C=ij(),w=tj(),{getHighWaterMark:T,getDefaultHighWaterMark:E}=aj(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:O,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:A,ERR_STREAM_PUSH_AFTER_EOF:j,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:N}=qA(),{validateObject:P}=ZA(),F=m(`kPaused`),{StringDecoder:I}=sj(),L=cj();l(H.prototype,g.prototype),l(H,g);let R=()=>{},{errorOrDestroy:z}=w,ee=2048,B=4096,te=65536;function V(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}s(ne.prototype,{objectMode:V(1),ended:V(2),endEmitted:V(4),reading:V(8),constructed:V(16),sync:V(32),needReadable:V(64),emittedReadable:V(128),readableListening:V(256),resumeScheduled:V(512),errorEmitted:V(1024),emitClose:V(ee),autoDestroy:V(B),destroyed:V(8192),closed:V(16384),closeEmitted:V(32768),multiAwaitDrain:V(te),readingMore:V(131072),dataEmitted:V(262144)});function ne(e,t,n){typeof n!=`boolean`&&(n=t instanceof fj()),this.state=6192,e&&e.objectMode&&(this.state|=1),n&&e&&e.readableObjectMode&&(this.state|=1),this.highWaterMark=e?T(this,e,`readableHighWaterMark`,n):E(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[F]=null,e&&e.emitClose===!1&&(this.state&=~ee),e&&e.autoDestroy===!1&&(this.state&=~B),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new I(e.encoding),this.encoding=e.encoding)}function H(e){if(!(this instanceof H))return new H(e);let t=this instanceof fj();this._readableState=new ne(e,this,t),e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&!t&&b(e.signal,this)),g.call(this,e),w.construct(this,()=>{this._readableState.needReadable&&ue(this,this._readableState)})}H.prototype.destroy=w.destroy,H.prototype._undestroy=w.undestroy,H.prototype._destroy=function(e,t){t(e)},H.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},H.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new N,this.destroy(e)),new u((t,n)=>x(this,r=>r&&r!==e?n(r):t(null)))},H.prototype.push=function(e,t){return re(this,e,t,!1)},H.prototype.unshift=function(e,t){return re(this,e,t,!0)};function re(e,t,n,r){S(`readableAddChunk`,t);let i=e._readableState,a;if(i.state&1||(typeof t==`string`?(n||=i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=y.from(t,n).toString(i.encoding):(t=y.from(t,n),n=``))):t instanceof y?n=``:g._isUint8Array(t)?(t=g._uint8ArrayToBuffer(t),n=``):t!=null&&(a=new O(`chunk`,[`string`,`Buffer`,`Uint8Array`],t))),a)z(e,a);else if(t===null)i.state&=-9,se(e,i);else if(i.state&1||t&&t.length>0)if(r)if(i.state&4)z(e,new M);else if(i.destroyed||i.errored)return!1;else ie(e,i,t,!0);else if(i.ended)z(e,new j);else if(i.destroyed||i.errored)return!1;else i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||t.length!==0?ie(e,i,t,!1):ue(e,i)):ie(e,i,t,!1);else r||(i.state&=-9,ue(e,i));return!i.ended&&(i.length0?((t.state&te)===0?t.awaitDrainWriters=null:t.awaitDrainWriters.clear(),t.dataEmitted=!0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.state&64&&ce(e)),ue(e,t)}H.prototype.isPaused=function(){let e=this._readableState;return e[F]===!0||e.flowing===!1},H.prototype.setEncoding=function(e){let t=new I(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer,r=``;for(let e of n)r+=t.write(e);return n.clear(),r!==``&&n.push(r),this._readableState.length=r.length,this};function ae(e){if(e>1073741824)throw new A(`size`,`<= 1GiB`,e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function oe(e,t){return e<=0||t.length===0&&t.ended?0:t.state&1?1:a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}H.prototype.read=function(e){S(`read`,e),e===void 0?e=NaN:i(e)||(e=o(e,10));let t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=ae(e)),e!==0&&(t.state&=-129),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return S(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?be(this):ce(this),null;if(e=oe(e,t),e===0&&t.ended)return t.length===0&&be(this),null;let r=(t.state&64)!=0;if(S(`need readable`,r),(t.length===0||t.length-e0?ye(e,t):null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&be(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit(`data`,a)),a};function se(e,t){if(S(`onEofChunk`),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?ce(e):(t.needReadable=!1,t.emittedReadable=!0,le(e))}}function ce(e){let t=e._readableState;S(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S(`emitReadable`,t.flowing),t.emittedReadable=!0,n.nextTick(le,e))}function le(e){let t=e._readableState;S(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ge(e)}function ue(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(U,e,t))}function U(e,t){for(;!t.reading&&!t.ended&&(t.length1&&i.pipes.includes(e)&&(S(`false write response, pause`,i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=de(r,e),e.on(`drain`,c))}r.on(`data`,p);function p(t){S(`ondata`);let n=e.write(t);S(`dest.write`,n),n===!1&&f()}function m(t){if(S(`onerror`,t),y(),e.removeListener(`error`,m),e.listenerCount(`error`)===0){let n=e._writableState||e._readableState;n&&!n.errorEmitted?z(e,t):e.emit(`error`,t)}}v(e,`error`,m);function h(){e.removeListener(`finish`,g),y()}e.once(`close`,h);function g(){S(`onfinish`),e.removeListener(`close`,h),y()}e.once(`finish`,g);function y(){S(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),e.writableNeedDrain===!0?f():i.flowing||(S(`pipe resume`),r.resume()),e};function de(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(S(`pipeOnDrain`,1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(S(`pipeOnDrain`,n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount(`data`)&&e.resume()}}H.prototype.unpipe=function(e){let t=this._readableState,n={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,i.flowing!==!1&&this.resume()):e===`readable`&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S(`on readable`,i.length,i.reading),i.length?ce(this):i.reading||n.nextTick(pe,this)),r},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(e,t){let r=g.prototype.removeListener.call(this,e,t);return e===`readable`&&n.nextTick(fe,this),r},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(e){let t=g.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&n.nextTick(fe,this),t};function fe(e){let t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&t[F]===!1?t.flowing=!0:e.listenerCount(`data`)>0?e.resume():t.readableListening||(t.flowing=null)}function pe(e){S(`readable nexttick read 0`),e.read(0)}H.prototype.resume=function(){let e=this._readableState;return e.flowing||(S(`resume`),e.flowing=!e.readableListening,me(this,e)),e[F]=!1,this};function me(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(he,e,t))}function he(e,t){S(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),ge(e),t.flowing&&!t.reading&&e.read(0)}H.prototype.pause=function(){return S(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(S(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState[F]=!0,this};function ge(e){let t=e._readableState;for(S(`flow`,t.flowing);t.flowing&&e.read()!==null;);}H.prototype.wrap=function(e){let t=!1;e.on(`data`,n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on(`end`,()=>{this.push(null)}),e.on(`error`,e=>{z(this,e)}),e.on(`close`,()=>{this.destroy()}),e.on(`destroy`,()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let n=c(e);for(let t=1;t{i=e?D(i,e):null,n(),n=R});try{for(;;){let t=e.destroyed?null:e.read();if(t!==null)yield t;else if(i)throw i;else if(i===null)return;else await new u(r)}}catch(e){throw i=D(i,e),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?w.destroyer(e,null):(e.off(`readable`,r),a())}}s(H.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ne.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[F]!==!1},set(e){this[F]=!!e}}}),H._fromList=ye;function ye(e,t){if(t.length===0)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function be(e){let t=e._readableState;S(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(xe,t,e))}function xe(e,t){if(S(`endReadableNT`,e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit(`end`),t.writable&&t.allowHalfOpen===!1)n.nextTick(Se,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||e.writable===!1))&&t.destroy()}}}function Se(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}H.from=function(e,t){return L(H,e,t)};let Ce;function we(){return Ce===void 0&&(Ce={}),Ce}H.fromWeb=function(e,t){return we().newStreamReadableFromReadableStream(e,t)},H.toWeb=function(e,t){return we().newReadableStreamFromStreamReadable(e,t)},H.wrap=function(e,t){return new H({objectMode:e.readableObjectMode??e.objectMode??!0,...t,destroy(t,n){w.destroyer(e,t),n(t)}}).wrap(e)}})),uj=U(((e,t)=>{let n=QA(),{ArrayPrototypeSlice:r,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:o,ObjectDefineProperties:s,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:l,Symbol:u,SymbolHasInstance:d}=GA();t.exports=P,P.WritableState=M;let{EventEmitter:f}=W(`events`),p=nj().Stream,{Buffer:m}=W(`buffer`),h=tj(),{addAbortSignal:g}=rj(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=aj(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:x,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:w,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:O}=qA().codes,{errorOrDestroy:k}=h;c(P.prototype,p.prototype),c(P,p);function A(){}let j=u(`kOnFinished`);function M(e,t,n){typeof n!=`boolean`&&(n=t instanceof fj()),this.objectMode=!!(e&&e.objectMode),n&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?v(this,e,`writableHighWaterMark`,n):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(e&&e.decodeStrings===!1),this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[j]=[]}function N(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}M.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},o(M.prototype,`bufferedRequestCount`,{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(e){let t=this instanceof fj();if(!t&&!a(P,this))return new P(e);this._writableState=new M(e,this,t),e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&g(e.signal,this)),p.call(this,e),h.construct(this,()=>{let e=this._writableState;e.writing||V(this,e),ie(this,e)})}o(P,d,{__proto__:null,value:function(e){return a(this,e)?!0:this===P?e&&e._writableState instanceof M:!1}}),P.prototype.pipe=function(){k(this,new C)};function F(e,t,r,i){let a=e._writableState;if(typeof r==`function`)i=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!==`buffer`&&!m.isEncoding(r))throw new O(r);typeof i!=`function`&&(i=A)}if(t===null)throw new E;if(!a.objectMode)if(typeof t==`string`)a.decodeStrings!==!1&&(t=m.from(t,r),r=`buffer`);else if(t instanceof m)r=`buffer`;else if(p._isUint8Array(t))t=p._uint8ArrayToBuffer(t),r=`buffer`;else throw new b(`chunk`,[`string`,`Buffer`,`Uint8Array`],t);let o;return a.ending?o=new D:a.destroyed&&(o=new w(`write`)),o?(n.nextTick(i,o),k(e,o,!0),o):(a.pendingcb++,I(e,a,t,r,i))}P.prototype.write=function(e,t,n){return F(this,e,t,n)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||V(this,e))},P.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=l(e)),!m.isEncoding(e))throw new O(e);return this._writableState.defaultEncoding=e,this};function I(e,t,n,r,i){let a=t.objectMode?1:n.length;t.length+=a;let o=t.lengthr.bufferedIndex&&V(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(ee,r.afterWriteTickInfo)):B(e,r,1,a))}function ee({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,B(e,t,n,r)}function B(e,t,n,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`));n-- >0;)t.pendingcb--,r();t.destroyed&&te(t),ie(e,t)}function te(e){if(e.writing)return;for(let t=e.bufferedIndex;t1&&e._writev){t.pendingcb-=o-1;let i=t.allNoop?A:e=>{for(let t=s;t256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}P.prototype._write=function(e,t,n){if(this._writev)this._writev([{chunk:e,encoding:t}],n);else throw new x(`_write()`)},P.prototype._writev=null,P.prototype.end=function(e,t,r){let a=this._writableState;typeof e==`function`?(r=e,e=null,t=null):typeof t==`function`&&(r=t,t=null);let o;if(e!=null){let n=F(this,e,t);n instanceof i&&(o=n)}return a.corked&&(a.corked=1,this.uncork()),o||(!a.errored&&!a.ending?(a.ending=!0,ie(this,a,!0),a.ended=!0):a.finished?o=new T(`end`):a.destroyed&&(o=new w(`end`))),typeof r==`function`&&(o||a.finished?n.nextTick(r,o):a[j].push(r)),this};function ne(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t){let r=!1;function i(i){if(r){k(e,i??S());return}if(r=!0,t.pendingcb--,i){let n=t[j].splice(0);for(let e=0;e{ne(t)?ae(e,t):t.pendingcb--},e,t)):ne(t)&&(t.pendingcb++,ae(e,t))))}function ae(e,t){t.pendingcb--,t.finished=!0;let n=t[j].splice(0);for(let e=0;e{let n=QA(),r=W(`buffer`),{isReadable:i,isWritable:a,isIterable:o,isNodeStream:s,isReadableNodeStream:c,isWritableNodeStream:l,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:f}=$A(),p=ej(),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:g}}=qA(),{destroyer:v}=tj(),y=fj(),b=lj(),x=uj(),{createDeferredPromise:S}=XA(),C=cj(),w=globalThis.Blob||r.Blob,T=w===void 0?function(e){return!1}:function(e){return e instanceof w},E=globalThis.AbortController||YA().AbortController,{FunctionPrototypeCall:D}=GA();var O=class extends y{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function e(t,r){if(u(t))return t;if(c(t))return A({readable:t});if(l(t))return A({writable:t});if(s(t))return A({writable:!1,readable:!1});if(d(t))return A({readable:b.fromWeb(t)});if(f(t))return A({writable:x.fromWeb(t)});if(typeof t==`function`){let{value:e,write:i,final:a,destroy:s}=k(t);if(o(e))return C(O,e,{objectMode:!0,write:i,final:a,destroy:s});let c=e?.then;if(typeof c==`function`){let t,r=D(c,e,e=>{if(e!=null)throw new g(`nully`,`body`,e)},e=>{v(t,e)});return t=new O({objectMode:!0,readable:!1,write:i,final(e){a(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new g(`Iterable, AsyncIterable or AsyncFunction`,r,e)}if(T(t))return e(t.arrayBuffer());if(o(t))return C(O,t,{objectMode:!0,writable:!1});if(d(t?.readable)&&f(t?.writable))return O.fromWeb(t);if(typeof t?.writable==`object`||typeof t?.readable==`object`)return A({readable:t!=null&&t.readable?c(t?.readable)?t?.readable:e(t.readable):void 0,writable:t!=null&&t.writable?l(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if(typeof i==`function`){let e;return D(i,t,t=>{t!=null&&e.push(t),e.push(null)},t=>{v(e,t)}),e=new O({objectMode:!0,writable:!1,read(){}})}throw new h(r,[`Blob`,`ReadableStream`,`WritableStream`,`Stream`,`Iterable`,`AsyncIterable`,`Function`,`{ readable, writable } pair`,`Promise`],t)};function k(e){let{promise:t,resolve:r}=S(),i=new E,a=i.signal;return{value:e((async function*(){for(;;){let e=t;t=null;let{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new m(void 0,{cause:a.reason});({promise:t,resolve:r}=S()),yield i}})(),{signal:a}),write(e,t,n){let i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){let t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}function A(e){let t=e.readable&&typeof e.readable.read!=`function`?b.wrap(e.readable):e.readable,n=e.writable,r=!!i(t),o=!!a(n),s,c,l,u,d;function f(e){let t=u;u=null,t?t(e):e&&d.destroy(e)}return d=new O({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(n!=null&&n.writableObjectMode),readable:r,writable:o}),o&&(p(n,e=>{o=!1,e&&v(t,e),f(e)}),d._write=function(e,t,r){n.write(e,t)?r():s=r},d._final=function(e){n.end(),c=e},n.on(`drain`,function(){if(s){let e=s;s=null,e()}}),n.on(`finish`,function(){if(c){let e=c;c=null,e()}})),r&&(p(t,e=>{r=!1,e&&v(t,e),f(e)}),t.on(`readable`,function(){if(l){let e=l;l=null,e()}}),t.on(`end`,function(){d.push(null)}),d._read=function(){for(;;){let e=t.read();if(e===null){l=d._read;return}if(!d.push(e))return}}),d._destroy=function(e,r){!e&&u!==null&&(e=new m),l=null,s=null,c=null,u===null?r(e):(u=r,v(n,e),v(t,e))},d}})),fj=U(((e,t)=>{let{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:i,ObjectSetPrototypeOf:a}=GA();t.exports=c;let o=lj(),s=uj();a(c.prototype,o.prototype),a(c,o);{let e=i(s.prototype);for(let t=0;t{let{ObjectSetPrototypeOf:n,Symbol:r}=GA();t.exports=c;let{ERR_METHOD_NOT_IMPLEMENTED:i}=qA().codes,a=fj(),{getHighWaterMark:o}=aj();n(c.prototype,a.prototype),n(c,a);let s=r(`kCallback`);function c(e){if(!(this instanceof c))return new c(e);let t=e?o(this,e,`readableHighWaterMark`,!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[s]=null,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function l(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function u(){this._final!==l&&l.call(this)}c.prototype._final=l,c.prototype._transform=function(e,t,n){throw new i(`_transform()`)},c.prototype._write=function(e,t,n){let r=this._readableState,i=this._writableState,a=r.length;this._transform(e,t,(e,t)=>{if(e){n(e);return}t!=null&&this.push(t),i.ended||a===r.length||r.length{let{ObjectSetPrototypeOf:n}=GA();t.exports=i;let r=pj();n(i.prototype,r.prototype),n(i,r);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),hj=U(((e,t)=>{let n=QA(),{ArrayIsArray:r,Promise:i,SymbolAsyncIterator:a,SymbolDispose:o}=GA(),s=ej(),{once:c}=XA(),l=tj(),u=fj(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:v}=qA(),{validateFunction:y,validateAbortSignal:b}=ZA(),{isIterable:x,isReadable:S,isReadableNodeStream:C,isNodeStream:w,isTransformStream:T,isWebStream:E,isReadableStream:D,isReadableFinished:O}=$A(),k=globalThis.AbortController||YA().AbortController,A,j,M;function N(e,t,n){let r=!1;return e.on(`close`,()=>{r=!0}),{destroy:t=>{r||(r=!0,l.destroyer(e,t||new h(`pipe`)))},cleanup:s(e,{readable:t,writable:n},e=>{r=!e})}}function P(e){return y(e[e.length-1],`streams[stream.length - 1]`),e.pop()}function F(e){if(x(e))return e;if(C(e))return I(e);throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`],e)}async function*I(e){j||=lj(),yield*j.prototype[a].call(e)}async function L(e,t,n,{end:r}){let a,o=null,c=e=>{if(e&&(a=e),o){let e=o;o=null,e()}},l=()=>new i((e,t)=>{a?t(a):o=()=>{a?t(a):e()}});t.on(`drain`,c);let u=s(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let n of e)t.write(n)||await l();r&&(t.end(),await l()),n()}catch(e){n(a===e?e:d(a,e))}finally{u(),t.off(`drain`,c)}}async function R(e,t,n,{end:r}){T(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function z(...e){return ee(e,c(P(e)))}function ee(e,t,i){if(e.length===1&&r(e[0])&&(e=e[0]),e.length<2)throw new m(`streams`);let a=new k,s=a.signal,c=i?.signal,l=[];b(c,`options.signal`);function d(){I(new v)}M||=XA().addAbortListener;let h;c&&(h=M(c,d));let g,y,O=[],j=0;function P(e){I(e,--j===0)}function I(e,r){var i;if(e&&(!g||g.code===`ERR_STREAM_PREMATURE_CLOSE`)&&(g=e),!(!g&&!r)){for(;O.length;)O.shift()(g);(i=h)==null||i[o](),a.abort(),r&&(g||l.forEach(e=>e()),n.nextTick(t,g,y))}}let z;for(let t=0;t0,c=a||i?.end!==!1,d=t===e.length-1;if(w(r)){if(c){let{destroy:e,cleanup:t}=N(r,a,o);O.push(e),S(r)&&d&&l.push(t)}function e(e){e&&e.name!==`AbortError`&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&P(e)}r.on(`error`,e),S(r)&&d&&l.push(()=>{r.removeListener(`error`,e)})}if(t===0)if(typeof r==`function`){if(z=r({signal:s}),!x(z))throw new p(`Iterable, AsyncIterable or Stream`,`source`,z)}else z=x(r)||C(r)||T(r)?r:u.from(r);else if(typeof r==`function`)if(z=T(z)?F(z?.readable):F(z),z=r(z,{signal:s}),a){if(!x(z,!0))throw new p(`AsyncIterable`,`transform[${t-1}]`,z)}else{A||=mj();let e=new A({objectMode:!0}),t=z?.then;if(typeof t==`function`)j++,t.call(z,t=>{y=t,t!=null&&e.write(t),c&&e.end(),n.nextTick(P)},t=>{e.destroy(t),n.nextTick(P,t)});else if(x(z,!0))j++,L(z,e,P,{end:c});else if(D(z)||T(z)){let t=z.readable||z;j++,L(t,e,P,{end:c})}else throw new p(`AsyncIterable or Promise`,`destination`,z);z=e;let{destroy:r,cleanup:i}=N(z,!1,!0);O.push(r),d&&l.push(i)}else if(w(r)){if(C(z)){j+=2;let e=B(z,r,P,{end:c});S(r)&&d&&l.push(e)}else if(T(z)||D(z)){let e=z.readable||z;j++,L(e,r,P,{end:c})}else if(x(z))j++,L(z,r,P,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],z);z=r}else if(E(r)){if(C(z))j++,R(F(z),r,P,{end:c});else if(D(z)||x(z))j++,R(z,r,P,{end:c});else if(T(z))j++,R(z.readable,r,P,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],z);z=r}else z=u.from(r)}return(s!=null&&s.aborted||c!=null&&c.aborted)&&n.nextTick(d),z}function B(e,t,r,{end:i}){let a=!1;if(t.on(`close`,()=>{a||r(new g)}),e.pipe(t,{end:!1}),i){function r(){a=!0,t.end()}O(e)?n.nextTick(r):e.once(`end`,r)}else r();return s(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&t.code===`ERR_STREAM_PREMATURE_CLOSE`&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once(`end`,r).once(`error`,r):r(t)}),s(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:ee,pipeline:z}})),gj=U(((e,t)=>{let{pipeline:n}=hj(),r=fj(),{destroyer:i}=tj(),{isNodeStream:a,isReadable:o,isWritable:s,isWebStream:c,isTransformStream:l,isWritableStream:u,isReadableStream:d}=$A(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=qA(),h=ej();t.exports=function(...e){if(e.length===0)throw new m(`streams`);if(e.length===1)return r.from(e[0]);let t=[...e];if(typeof e[0]==`function`&&(e[0]=r.from(e[0])),typeof e[e.length-1]==`function`){let t=e.length-1;e[t]=r.from(e[t])}for(let n=0;n0&&!(s(e[n])||u(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be writable`)}let g,v,y,b,x;function S(e){let t=b;b=null,t?t(e):e?x.destroy(e):!E&&!T&&x.destroy()}let C=e[0],w=n(e,S),T=!!(s(C)||u(C)||l(C)),E=!!(o(w)||d(w)||l(w));if(x=new r({writableObjectMode:!!(C!=null&&C.writableObjectMode),readableObjectMode:!!(w!=null&&w.readableObjectMode),writable:T,readable:E}),T){if(a(C))x._write=function(e,t,n){C.write(e,t)?n():g=n},x._final=function(e){C.end(),v=e},C.on(`drain`,function(){if(g){let e=g;g=null,e()}});else if(c(C)){let e=(l(C)?C.writable:C).getWriter();x._write=async function(t,n,r){try{await e.ready,e.write(t).catch(()=>{}),r()}catch(e){r(e)}},x._final=async function(t){try{await e.ready,e.close().catch(()=>{}),v=t}catch(e){t(e)}}}h(l(w)?w.readable:w,()=>{if(v){let e=v;v=null,e()}})}if(E){if(a(w))w.on(`readable`,function(){if(y){let e=y;y=null,e()}}),w.on(`end`,function(){x.push(null)}),x._read=function(){for(;;){let e=w.read();if(e===null){y=x._read;return}if(!x.push(e))return}};else if(c(w)){let e=(l(w)?w.readable:w).getReader();x._read=async function(){for(;;)try{let{value:t,done:n}=await e.read();if(!x.push(t))return;if(n){x.push(null);return}}catch{return}}}}return x._destroy=function(e,t){!e&&b!==null&&(e=new f),y=null,g=null,v=null,b===null?t(e):(b=t,a(w)&&i(w,e))},x}})),_j=U(((e,t)=>{let n=globalThis.AbortController||YA().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:o},AbortError:s}=qA(),{validateAbortSignal:c,validateInteger:l,validateObject:u}=ZA(),d=GA().Symbol(`kWeak`),f=GA().Symbol(`kResistStopPropagation`),{finished:p}=ej(),m=gj(),{addAbortSignalNoValidate:h}=rj(),{isWritable:g,isNodeStream:v}=$A(),{deprecate:y}=XA(),{ArrayPrototypePush:b,Boolean:x,MathFloor:S,Number:C,NumberIsNaN:w,Promise:T,PromiseReject:E,PromiseResolve:D,PromisePrototypeThen:O,Symbol:k}=GA(),A=k(`kEmpty`),j=k(`kEof`);function M(e,t){if(t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),v(e)&&!g(e))throw new r(`stream`,e,`must be writable`);let n=m(this,e);return t!=null&&t.signal&&h(t.signal,n),n}function N(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`);let n=1;t?.concurrency!=null&&(n=S(t.concurrency));let r=n-1;return t?.highWaterMark!=null&&(r=S(t.highWaterMark)),l(n,`options.concurrency`,1),l(r,`options.highWaterMark`,0),r+=n,async function*(){let i=XA().AbortSignalAny([t?.signal].filter(x)),a=this,o=[],c={signal:i},l,u,d=!1,f=0;function p(){d=!0,m()}function m(){--f,h()}function h(){u&&!d&&f=r||f>=n)&&await new T(e=>{u=e})}o.push(j)}catch(e){let t=E(e);O(t,m,p),o.push(t)}finally{d=!0,l&&=(l(),null)}}g();try{for(;;){for(;o.length>0;){let e=await o[0];if(e===j)return;if(i.aborted)throw new s;e!==A&&(yield e),o.shift(),h()}await new T(e=>{l=e})}}finally{d=!0,u&&=(u(),null)}}.call(this)}function P(e=void 0){return e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`),async function*(){let t=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s({cause:e.signal.reason});yield[t++,r]}}.call(this)}async function F(e,t=void 0){for await(let n of z.call(this,e,t))return!0;return!1}async function I(e,t=void 0){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);return!await F.call(this,async(...t)=>!await e(...t),t)}async function L(e,t){for await(let n of z.call(this,e,t))return n}async function R(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n),A}for await(let e of N.call(this,n,t));}function z(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n)?t:A}return N.call(this,n,t)}var ee=class extends a{constructor(){super(`reduce`),this.message=`Reduce of an empty stream requires an initial value`}};async function B(e,t,r){var a;if(typeof e!=`function`)throw new i(`reducer`,[`Function`,`AsyncFunction`],e);r!=null&&u(r,`options`),r?.signal!=null&&c(r.signal,`options.signal`);let o=arguments.length>1;if(r!=null&&(a=r.signal)!=null&&a.aborted){let e=new s(void 0,{cause:r.signal.reason});throw this.once(`error`,()=>{}),await p(this.destroy(e)),e}let l=new n,m=l.signal;if(r!=null&&r.signal){let e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener(`abort`,()=>l.abort(),e)}let h=!1;try{for await(let n of this){var g;if(h=!0,r!=null&&(g=r.signal)!=null&&g.aborted)throw new s;o?t=await e(t,n,{signal:m}):(t=n,o=!0)}if(!h&&!o)throw new ee}finally{l.abort()}return t}async function te(e){e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`);let t=[];for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s(void 0,{cause:e.signal.reason});b(t,r)}return t}function V(e,t){let n=N.call(this,e,t);return async function*(){for await(let e of n)yield*e}.call(this)}function ne(e){if(e=C(e),w(e))return 0;if(e<0)throw new o(`number`,`>= 0`,e);return e}function H(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ne(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;e--<=0&&(yield n)}}.call(this)}function re(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=ne(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;if(e-- >0&&(yield n),e<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:y(P,`readable.asIndexedPairs will be removed in a future version.`),drop:H,filter:z,flatMap:V,map:N,take:re,compose:M},t.exports.promiseReturningOperators={every:I,forEach:R,reduce:B,toArray:te,some:F,find:L}})),vj=U(((e,t)=>{let{ArrayPrototypePop:n,Promise:r}=GA(),{isIterable:i,isNodeStream:a,isWebStream:o}=$A(),{pipelineImpl:s}=hj(),{finished:c}=ej();yj();function l(...e){return new r((t,r)=>{let c,l,u=e[e.length-1];if(u&&typeof u==`object`&&!a(u)&&!i(u)&&!o(u)){let t=n(e);c=t.signal,l=t.end}s(e,(e,n)=>{e?r(e):t(n)},{signal:c,end:l})})}t.exports={finished:c,pipeline:l}})),yj=U(((e,t)=>{let{Buffer:n}=W(`buffer`),{ObjectDefineProperty:r,ObjectKeys:i,ReflectApply:a}=GA(),{promisify:{custom:o}}=XA(),{streamReturningOperators:s,promiseReturningOperators:c}=_j(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=qA(),u=gj(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=aj(),{pipeline:p}=hj(),{destroyer:m}=tj(),h=ej(),g=vj(),v=$A(),y=t.exports=nj().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=lj();for(let e of i(s)){let t=s[e];function n(...e){if(new.target)throw l();return y.Readable.from(a(t,this,e))}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(c)){let t=c[e];function n(...e){if(new.target)throw l();return a(t,this,e)}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}y.Writable=uj(),y.Duplex=fj(),y.Transform=pj(),y.PassThrough=mj(),y.pipeline=p;let{addAbortSignal:b}=rj();y.addAbortSignal=b,y.finished=h,y.destroy=m,y.compose=u,y.setDefaultHighWaterMark=d,y.getDefaultHighWaterMark=f,r(y,`promises`,{__proto__:null,configurable:!0,enumerable:!0,get(){return g}}),r(p,o,{__proto__:null,enumerable:!0,get(){return g.pipeline}}),r(h,o,{__proto__:null,enumerable:!0,get(){return g.finished}}),y.Stream=y,y._isUint8Array=function(e){return e instanceof Uint8Array},y._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}})),bj=U(((e,t)=>{let n=W(`stream`);if(n&&process.env.READABLE_STREAM===`disable`){let e=n.promises;t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,`promises`,{configurable:!0,enumerable:!0,get(){return e}}),t.exports.Stream=n.Stream}else{let e=yj(),n=vj(),r=e.Readable.destroy;t.exports=e.Readable,t.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,t.exports._isUint8Array=e._isUint8Array,t.exports.isDisturbed=e.isDisturbed,t.exports.isErrored=e.isErrored,t.exports.isReadable=e.isReadable,t.exports.Readable=e.Readable,t.exports.Writable=e.Writable,t.exports.Duplex=e.Duplex,t.exports.Transform=e.Transform,t.exports.PassThrough=e.PassThrough,t.exports.addAbortSignal=e.addAbortSignal,t.exports.finished=e.finished,t.exports.destroy=e.destroy,t.exports.destroy=r,t.exports.pipeline=e.pipeline,t.exports.compose=e.compose,Object.defineProperty(e,`promises`,{configurable:!0,enumerable:!0,get(){return n}}),t.exports.Stream=e.Stream}t.exports.default=t.exports})),xj=U(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n{var n=oA(),r=jA(),i=MA(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),Cj=U(((e,t)=>{var n=xj(),r=Sj();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),wj=U(((e,t)=>{var n=Cj();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),Tj=U(((e,t)=>{t.exports=_A()(Object,`create`)})),Ej=U(((e,t)=>{var n=Tj();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Dj=U(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Oj=U(((e,t)=>{var n=Tj(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),kj=U(((e,t)=>{var n=Tj(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Aj=U(((e,t)=>{var n=Tj(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),jj=U(((e,t)=>{var n=Ej(),r=Dj(),i=Oj(),a=kj(),o=Aj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{function n(){this.__data__=[],this.size=0}t.exports=n})),Nj=U(((e,t)=>{var n=CA();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Pj=U(((e,t)=>{var n=Nj(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Fj=U(((e,t)=>{var n=Nj();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Ij=U(((e,t)=>{var n=Nj();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Lj=U(((e,t)=>{var n=Nj();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Rj=U(((e,t)=>{var n=Mj(),r=Pj(),i=Fj(),a=Ij(),o=Lj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{t.exports=_A()(aA(),`Map`)})),Bj=U(((e,t)=>{var n=jj(),r=Rj(),i=zj();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Vj=U(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Hj=U(((e,t)=>{var n=Vj();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Uj=U(((e,t)=>{var n=Hj();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Wj=U(((e,t)=>{var n=Hj();function r(e){return n(this,e).get(e)}t.exports=r})),Gj=U(((e,t)=>{var n=Hj();function r(e){return n(this,e).has(e)}t.exports=r})),Kj=U(((e,t)=>{var n=Hj();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),qj=U(((e,t)=>{var n=Bj(),r=Uj(),i=Wj(),a=Gj(),o=Kj();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),Yj=U(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Xj=U(((e,t)=>{var n=qj(),r=Jj(),i=Yj();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a{function n(e){return e!==e}t.exports=n})),$j=U(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r{var n=Zj(),r=Qj(),i=$j();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),tM=U(((e,t)=>{var n=eM();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),nM=U(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n{function n(e,t){return e.has(t)}t.exports=n})),aM=U(((e,t)=>{var n=Xj(),r=tM(),i=nM(),a=rM(),o=IA(),s=iM(),c=200;function l(e,t,l,u){var d=-1,f=r,p=!0,m=e.length,h=[],g=t.length;if(!m)return h;l&&(t=a(t,o(l))),u?(f=i,p=!1):t.length>=c&&(f=s,p=!1,t=new n(t));outer:for(;++d{var n=TA(),r=kA();function i(e){return r(e)&&n(e)}t.exports=i})),sM=U(((e,t)=>{var n=aM(),r=Cj(),i=SA(),a=oM();t.exports=i(function(e,t){return a(e)?n(e,r(t,1,a,!0)):[]})})),cM=U(((e,t)=>{t.exports=_A()(aA(),`Set`)})),lM=U(((e,t)=>{function n(){}t.exports=n})),uM=U(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),dM=U(((e,t)=>{var n=cM(),r=lM(),i=uM();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),fM=U(((e,t)=>{var n=Xj(),r=tM(),i=nM(),a=iM(),o=dM(),s=uM(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u{var n=Cj(),r=SA(),i=fM(),a=oM();t.exports=r(function(e){return i(n(e,1,a,!0))})})),mM=U(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),hM=U(((e,t)=>{t.exports=mM()(Object.getPrototypeOf,Object)})),gM=U(((e,t)=>{var n=lA(),r=hM(),i=kA(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),_M=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertValidPattern=void 0,e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)}})),vM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseClass=void 0;let t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;lh?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`)})),bM=U((e=>{var t;Object.defineProperty(e,`__esModule`,{value:!0}),e.AST=void 0;let n=vM(),r=yM(),i=new Set([`!`,`?`,`+`,`*`,`@`]),a=e=>i.has(e),o=e=>a(e.type),s=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),c=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),l=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),u=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),d=`(?!\\.)`,f=new Set([`[`,`.`]),p=new Set([`..`,`.`]),m=new Set(`().*{}+?[]^$\\!`),h=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),g=`[^/]`,v=g+`*?`,y=g+`+?`;var b=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&rtypeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let n=0;n{let[r,a,o,s]=typeof n==`string`?t.#C(n,this.#t,i):n.toRegExpSource(e);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&p.has(this.#r[0]))){let t=f,r=n&&t.has(a.charAt(0))||a.startsWith(`\\.`)&&t.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&t.has(a.charAt(4)),i=!n&&!e&&t.has(a.charAt(0));o=r?`(?!(?:^|/)\\.\\.?(?:$|/))`:i?d:``}let s=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(s=`(?:$|\\/)`),[o+a+s,(0,r.unescape)(a),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,s=this.#S(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,(0,r.unescape)(this.toString()),!1,!1]}let c=!i||e||n?``:this.#S(!0);c===s&&(c=``),c&&(s=`(?:${s})(?:${c})*?`);let l=``;if(this.type===`!`&&this.#u)l=(this.isStart()&&!n?d:``)+y;else{let t=this.type===`!`?`))`+(this.isStart()&&!n&&!e?d:``)+v+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&c?`)`:this.type===`*`&&c?`)?`:`)${this.type}`;l=a+s+t}return[l,(0,r.unescape)(s),this.#t=!!this.#t,this.#n]}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,i=!1){let a=!1,o=``,s=!1,c=!1;for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),SM=U((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;let n=t(Cs()),r=_M(),i=bM(),a=xM(),o=yM();e.minimatch=(e,t,n={})=>((0,r.assertValidPattern)(t),!n.nocomment&&t.charAt(0)===`#`?!1:new N(t,n).match(e));let s=/^\*+([^+@!?\*\[\(]*)$/,c=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),l=e=>t=>t.endsWith(e),u=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),d=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),f=/^\*+\.\*+$/,p=e=>!e.startsWith(`.`)&&e.includes(`.`),m=e=>e!==`.`&&e!==`..`&&e.includes(`.`),h=/^\.\*+$/,g=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),v=/^\*+$/,y=e=>e.length!==0&&!e.startsWith(`.`),b=e=>e.length!==0&&e!==`.`&&e!==`..`,x=/^\?+([^+@!?\*\[\(]*)?$/,S=([e,t=``])=>{let n=E([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},C=([e,t=``])=>{let n=D([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},w=([e,t=``])=>{let n=D([e]);return t?e=>n(e)&&e.endsWith(t):n},T=([e,t=``])=>{let n=E([e]);return t?e=>n(e)&&e.endsWith(t):n},E=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},D=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},O=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,k={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=O===`win32`?k.win32.sep:k.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR,e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;let A=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,A(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,A(t,n))}static defaults(e){return n.defaults(A(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,A(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,A(t,r))}},unescape:(e,r={})=>n.unescape(e,A(t,r)),escape:(e,r={})=>n.escape(e,A(t,r)),filter:(e,r={})=>n.filter(e,A(t,r)),defaults:e=>n.defaults(A(t,e)),makeRe:(e,r={})=>n.makeRe(e,A(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,A(t,r)),match:(e,r,i={})=>n.match(e,r,A(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,t={})=>((0,r.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,n.default)(e)),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new N(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new N(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;let j=/[?*]|[+@!]\(.*?\)|\[|\]/,M=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var N=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){(0,r.assertValidPattern)(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||O,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!j.test(e[2]))&&!j.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;nr&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;ee.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r=2&&(t=this.levelTwoFileOptimize(t)),n.includes(e.GLOBSTAR)?this.#e(t,n,r,i,a):this.#n(t,n,r,i,a)}#e(t,n,r,i,a){let o=n.indexOf(e.GLOBSTAR,a),s=n.lastIndexOf(e.GLOBSTAR),[c,l,u]=r?[n.slice(a,o),n.slice(o+1),[]]:[n.slice(a,o),n.slice(o+1,s),n.slice(s+1)];if(c.length){let e=t.slice(i,i+c.length);if(!this.#n(e,c,r,0,0))return!1;i+=c.length}let d=0;if(u.length){if(u.length+i>t.length)return!1;let e=t.length-u.length;if(this.#n(t,u,r,e,0))d=u.length;else{if(t[t.length-1]!==``||i+u.length===t.length||(e--,!this.#n(t,u,r,e,0)))return!1;d=u.length+1}}if(!l.length){let e=!!d;for(let n=i;n{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?M(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});return n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))}),n.filter(t=>t!==e.GLOBSTAR).join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=void 0;let t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(a===void 0){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}let s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null;var u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#e=!1;static create(t){let n=l(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:r=0,ttl:a,ttlResolution:o=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:m,dispose:h,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:y,maxSize:b=0,maxEntrySize:x=0,sizeCalculation:S,fetchMethod:C,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:O,ignoreFetchAbort:k}=t;if(r!==0&&!c(r))throw TypeError(`max option must be a nonnegative integer`);let A=r?l(r):Array;if(!A)throw Error(`invalid max value: `+r);if(this.#e=r,this.#t=b,this.maxEntrySize=x||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(w!==void 0&&typeof w!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=w,C!==void 0&&typeof C!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=C,this.#x=!!C,this.#c=new Map,this.#l=Array(r).fill(void 0),this.#u=Array(r).fill(void 0),this.#d=new A(r),this.#f=new A(r),this.#p=0,this.#m=0,this.#h=d.create(r),this.#o=0,this.#s=0,typeof h==`function`&&(this.#n=h),typeof g==`function`?(this.#r=g,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!v,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=c(o)||o===0?o:1,this.ttlAutopurge=!!u,this.ttl=a||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new u(this.#e),n=new u(this.#e);this.#y=e,this.#v=n,this.#E=(r,i,a=t.now())=>{if(n[r]=i===0?0:a,e[r]=i,i!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(r)&&this.#B(this.#l[r],`expire`)},i+1);e.unref&&e.unref()}},this.#w=r=>{n[r]=e[r]===0?0:t.now()},this.#T=(t,a)=>{if(e[a]){let o=e[a],s=n[a];if(!o||!s)return;t.ttl=o,t.start=s,t.now=r||i(),t.remainingTTL=o-(t.now-s)}};let r=0,i=()=>{let e=t.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let a=this.#c.get(t);if(a===void 0)return 0;let o=e[a],s=n[a];return!o||!s?1/0:o-((r||i())-s)},this.#D=t=>{let a=n[t],o=e[t];return!!o&&!!a&&(r||i())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};#D=()=>!1;#O(){let e=new u(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let n=this.#c.get(e);if(n===void 0)return;let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0)return;let a={value:i};if(this.#y&&this.#v){let e=this.#y[n],r=this.#v[n];e&&r&&(a.ttl=e-(t.now()-r),a.start=Date.now())}return this.#_&&(a.size=this.#_[n]),a}dump(){let e=[];for(let n of this.#M({allowStale:!0})){let r=this.#l[n],i=this.#u[n],a=this.#L(i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;let o={value:a};if(this.#y&&this.#v){o.ttl=this.#y[n];let e=t.now()-this.#v[n];o.start=Math.floor(Date.now()-e)}this.#_&&(o.size=this.#_[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason);let l=p;return this.#u[t]===p&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e)),d=r=>{let{aborted:i}=o.signal,a=i&&n.allowStaleOnFetchAbort,s=a||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=p;if(this.#u[t]===p&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):a||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},f=(t,r)=>{let a=this.#i?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=m,m}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:v}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let y={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:v},b=this.#c.get(e);if(b===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,b,y,m);return t.__returned=t}else{let t=this.#u[b];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(b);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(b),r&&this.#w(b),g&&this.#T(g,b),t;let a=this.#I(e,b,y,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}else a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}})),wM=U((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;let n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=W(`node:events`),i=t(W(`node:stream`)),a=W(`node:string_decoder`);e.isStream=t=>!!t&&typeof t==`object`&&(t instanceof ie||t instanceof i.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==i.default.Writable.prototype.pipe,e.isWritable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`;let o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),v=Symbol(`flowing`),y=Symbol(`paused`),b=Symbol(`resume`),x=Symbol(`buffer`),S=Symbol(`pipes`),C=Symbol(`bufferLength`),w=Symbol(`bufferPush`),T=Symbol(`bufferShift`),E=Symbol(`objectMode`),D=Symbol(`destroyed`),O=Symbol(`error`),k=Symbol(`emitData`),A=Symbol(`emitEnd`),j=Symbol(`emitEnd2`),M=Symbol(`async`),N=Symbol(`abort`),P=Symbol(`aborted`),F=Symbol(`signal`),I=Symbol(`dataListeners`),L=Symbol(`discarded`),R=e=>Promise.resolve().then(e),z=e=>e(),ee=e=>e===`end`||e===`finish`||e===`prefinish`,B=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,te=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);var V=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[b](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ne=class extends V{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}};let H=e=>!!e.objectMode,re=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`;var ie=class extends r.EventEmitter{[v]=!1;[y]=!1;[S]=[];[x]=[];[E];[h];[M];[g];[o]=!1;[c]=!1;[l]=!1;[d]=!1;[u]=null;[C]=0;[D]=!1;[F];[P]=!1;[I]=0;[L]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);H(t)?(this[E]=!0,this[h]=null):re(t)?(this[h]=t.encoding,this[E]=!1):(this[E]=!1,this[h]=null),this[M]=!!t.async,this[g]=this[h]?new a.StringDecoder(this[h]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,`buffer`,{get:()=>this[x]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,`pipes`,{get:()=>this[S]});let{signal:n}=t;n&&(this[F]=n,n.aborted?this[N]():n.addEventListener(`abort`,()=>this[N]()))}get bufferLength(){return this[C]}get encoding(){return this[h]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[E]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[M]}set async(e){this[M]=this[M]||!!e}[N](){this[P]=!0,this.emit(`abort`,this[F]?.reason),this.destroy(this[F]?.reason)}get aborted(){return this[P]}set aborted(e){}write(e,t,n){if(this[P])return!1;if(this[o])throw Error(`write after end`);if(this[D])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[M]?R:z;if(!this[E]&&!Buffer.isBuffer(e)){if(te(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(B(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[E]?(this[v]&&this[C]!==0&&this[p](!0),this[v]?this.emit(`data`,e):this[w](e),this[C]!==0&&this.emit(`readable`),n&&r(n),this[v]):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this[v]&&this[C]!==0&&this[p](!0),this[v]?this.emit(`data`,e):this[w](e),this[C]!==0&&this.emit(`readable`),n&&r(n),this[v]):(this[C]!==0&&this.emit(`readable`),n&&r(n),this[v])}read(e){if(this[D])return null;if(this[L]=!1,this[C]===0||e===0||e&&e>this[C])return this[s](),null;this[E]&&(e=null),this[x].length>1&&!this[E]&&(this[x]=[this[h]?this[x].join(``):Buffer.concat(this[x],this[C])]);let t=this[f](e||null,this[x][0]);return this[s](),t}[f](e,t){if(this[E])this[T]();else{let n=t;e===n.length||e===null?this[T]():typeof n==`string`?(this[x][0]=n.slice(e),t=n.slice(0,e),this[C]-=e):(this[x][0]=n.subarray(e),t=n.subarray(0,e),this[C]-=e)}return this.emit(`data`,t),!this[x].length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this[v]||!this[y])&&this[s](),this}[b](){this[D]||(!this[I]&&!this[S].length&&(this[L]=!0),this[y]=!1,this[v]=!0,this.emit(`resume`),this[x].length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[b]()}pause(){this[v]=!1,this[y]=!0,this[L]=!1}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[y]}[w](e){this[E]?this[C]+=1:this[C]+=e.length,this[x].push(e)}[T](){return this[E]?--this[C]:this[C]-=this[x][0].length,this[x].shift()}[p](e=!1){do;while(this[m](this[T]())&&this[x].length);!e&&!this[x].length&&!this[o]&&this.emit(`drain`)}[m](e){return this.emit(`data`,e),this[v]}pipe(e,t){if(this[D])return e;this[L]=!1;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[S].push(t.proxyErrors?new ne(this,e,t):new V(this,e,t)),this[M]?R(()=>this[b]()):this[b]()),e}unpipe(e){let t=this[S].find(t=>t.dest===e);t&&(this[S].length===1?(this[v]&&this[I]===0&&(this[v]=!1),this[S]=[]):this[S].splice(this[S].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[L]=!1,this[I]++,!this[S].length&&!this[v]&&this[b]();else if(e===`readable`&&this[C]!==0)super.emit(`readable`);else if(ee(e)&&this[c])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[u]){let e=t;this[M]?R(()=>e.call(this,this[u])):e.call(this,this[u])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[I]=this.listeners(`data`).length,this[I]===0&&!this[L]&&!this[S].length&&(this[v]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[I]=0,!this[L]&&!this[S].length&&(this[v]=!1)),t}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[D]&&this[x].length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==D&&this[D])return!1;if(e===`data`)return!this[E]&&!n?!1:this[M]?(R(()=>this[k](n)),!0):this[k](n);if(e===`end`)return this[A]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[D])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=n,super.emit(O,n);let e=!this[F]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[s](),r}[k](e){for(let t of this[S])t.dest.write(e)===!1&&this.pause();let t=this[L]?!1:super.emit(`data`,e);return this[s](),t}[A](){return this[c]?!1:(this[c]=!0,this.readable=!1,this[M]?(R(()=>this[j]()),!0):this[j]())}[j](){if(this[g]){let e=this[g].end();if(e){for(let t of this[S])t.dest.write(e);this[L]||super.emit(`data`,e)}}for(let e of this[S])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[E]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[E]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[E])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[h]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(D,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[L]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[o])return t();let r,i,a=e=>{this.off(`data`,s),this.off(`end`,c),this.off(D,l),t(),i(e)},s=e=>{this.off(`error`,a),this.off(`end`,c),this.off(D,l),this.pause(),r({value:e,done:!!this[o]})},c=()=>{this.off(`error`,a),this.off(`data`,s),this.off(D,l),t(),r({done:!0,value:void 0})},l=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(D,l),this.once(`error`,a),this.once(`end`,c),this.once(`data`,s)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[L]=!1;let e=!1,t=()=>(this.pause(),this.off(O,t),this.off(D,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(O,t),this.once(D,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[D])return e?this.emit(`error`,e):this.emit(D),this;this[D]=!0,this[L]=!0,this[x].length=0,this[C]=0;let t=this;return typeof t.close==`function`&&!this[d]&&t.close(),e?this.emit(`error`,e):this.emit(D),this}static get isStream(){return e.isStream}};e.Minipass=ie})),TM=U((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.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;let i=CM(),a=W(`node:path`),o=W(`node:url`),s=W(`fs`),c=r(W(`node:fs`)),l=s.realpathSync.native,u=W(`node:fs/promises`),d=wM(),f={lstatSync:s.lstatSync,readdir:s.readdir,readdirSync:s.readdirSync,readlinkSync:s.readlinkSync,realpathSync:l,promises:{lstat:u.lstat,readdir:u.readdir,readlink:u.readlink,realpath:u.realpath}},p=e=>!e||e===f||e===c?f:{...f,...e,promises:{...f.promises,...e.promises||{}}},m=/^\\\\\?\\([a-z]:)\\?$/i,h=e=>e.replace(/\//g,`\\`).replace(m,`$1\\`),g=/[\\\/]/,v=e=>e.isFile()?8:e.isDirectory()?4:e.isSymbolicLink()?10:e.isCharacterDevice()?2:e.isBlockDevice()?6:e.isSocket()?12:e.isFIFO()?1:0,y=new Map,b=e=>{let t=y.get(e);if(t)return t;let n=e.normalize(`NFKD`);return y.set(e,n),n},x=new Map,S=e=>{let t=x.get(e);if(t)return t;let n=b(e.toLowerCase());return x.set(e,n),n};var C=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=C;var w=class extends i.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}};e.ChildrenCache=w;let T=Symbol(`PathScurry setAsCwd`);var E=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#c;get ino(){return this.#c}#l;get size(){return this.#l}#u;get blocks(){return this.#u}#d;get atimeMs(){return this.#d}#f;get mtimeMs(){return this.#f}#p;get ctimeMs(){return this.#p}#m;get birthtimeMs(){return this.#m}#h;get atime(){return this.#h}#g;get mtime(){return this.#g}#_;get ctime(){return this.#_}#v;get birthtime(){return this.#v}#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=0,n,r,i,a,o){this.name=e,this.#y=i?S(e):b(e),this.#T=t&1023,this.nocase=i,this.roots=r,this.root=n||this,this.#E=a,this.#x=o.fullpath,this.#C=o.relative,this.#w=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=p(o.fs)}depth(){return this.#b===void 0?this.parent?this.#b=this.parent.depth()+1:this.#b=0:this.#b}childrenCache(){return this.#E}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(n):this.#k(n)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#E.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#E.set(this,t),this.#T&=-17,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?S(e):b(e);for(let e of n)if(e.#y===r)return e;let i=this.parent?this.sep:``,a=this.#x?this.#x+i+e:void 0,o=this.newChild(e,0,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#T|=128),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;return t?this.#x=t.fullpath()+(t.parent?this.sep:``)+e:this.#x=this.name}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep===`/`)return this.#S=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return/^[a-z]:\//i.test(e)?this.#S=`//?/${e}`:this.#S=e}let e=this.parent,t=e.fullpathPosix();return this.#S=t+(!t||!e.parent?``:`/`)+this.name}isUnknown(){return(this.#T&15)==0}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?`Unknown`:this.isDirectory()?`Directory`:this.isFile()?`File`:this.isSymbolicLink()?`SymbolicLink`:this.isFIFO()?`FIFO`:this.isCharacterDevice()?`CharacterDevice`:this.isBlockDevice()?`BlockDevice`:this.isSocket()?`Socket`:`Unknown`}isFile(){return(this.#T&15)==8}isDirectory(){return(this.#T&15)==4}isCharacterDevice(){return(this.#T&15)==2}isBlockDevice(){return(this.#T&15)==6}isFIFO(){return(this.#T&15)==1}isSocket(){return(this.#T&15)==12}isSymbolicLink(){return(this.#T&10)==10}lstatCached(){return this.#T&32?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#T&15;return!(e!==0&&e!==10||this.#T&256||this.#T&128)}calledReaddir(){return!!(this.#T&16)}isENOENT(){return!!(this.#T&128)}isNamed(e){return this.nocase?this.#y===S(e):this.#y===b(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#D=t}catch(e){this.#L(e.code);return}}#A(e){this.#T|=16;for(let t=e.provisional;tt(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#U.push(e),this.#W)return;this.#W=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#F(e.code),n.provisional=0;else{for(let e of t)this.#R(e,n);this.#A(n)}this.#G(n.slice(0,n.provisional))})}#K;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#K)await this.#K;else{let n=()=>{};this.#K=new Promise(e=>n=e);try{for(let n of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}this.#K=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#R(n,e);this.#A(e)}catch(t){this.#F(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#T&704)return!1;let e=15&this.#T;return e===0||e===4||e===10}shouldWalk(e,t){return(this.#T&4)==4&&!(this.#T&704)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!(896&this.#T))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#O)return this.#O;if(!(896&this.#T))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#N()}}[T](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#C=n.join(this.sep),r.#w=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#C=void 0,r.#w=void 0,r=r.parent}};e.PathBase=E;var D=class e extends E{sep=`\\`;splitSep=g;constructor(e,t=0,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=0,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return a.win32.parse(e).root}getRoot(e){if(e=h(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new A(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(m,`$1\\`),e===t}};e.PathWin32=D;var O=class e extends E{splitSep=`/`;sep=`/`;constructor(e,t=0,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=0,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};e.PathPosix=O;var k=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16*1024,fs:a=f}={}){this.#r=p(a),(e instanceof URL||e.startsWith(`file://`))&&(e=(0,o.fileURLToPath)(e));let s=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),this.#e=new C,this.#t=new C,this.#n=new w(i);let c=s.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw TypeError(`must provide nocase setting to PathScurryBase ctor`);this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,m=this.rootPath,h=!1;for(let e of c){let t=u--;l=l.child(e,{relative:Array(t).fill(`..`).join(d),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:m+=(h?``:d)+e}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#e.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new d.Minipass({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof E||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new d.Minipass({objectMode:!0}),s=new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[T](t)}};e.PathScurryBase=k;var A=class extends k{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,a.win32,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return a.win32.parse(e).root.toUpperCase()}newRoot(e){return new D(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}};e.PathScurryWin32=A;var j=class extends k{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,a.posix,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new O(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}};e.PathScurryPosix=j;var M=class extends j{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};e.PathScurryDarwin=M,e.Path=process.platform===`win32`?D:O,e.PathScurry=process.platform===`win32`?A:process.platform===`darwin`?M:j})),EM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pattern=void 0;let t=SM(),n=e=>e.length>=1,r=e=>e.length>=1;e.Pattern=class e{#e;#t;#n;length;#r;#i;#a;#o;#s;#c;#l=!0;constructor(e,t,i,a){if(!n(e))throw TypeError(`empty pattern list`);if(!r(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#e=e,this.#t=t,this.#n=i,this.#r=a,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#e,[a,o,s,c,...l]=this.#t;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#e=[u,...i],this.#t=[d,...l],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#e,[n,...r]=this.#t;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#e=[i,...t],this.#t=[a,...r],this.length=this.#e.length}}}pattern(){return this.#e[this.#n]}isString(){return typeof this.#e[this.#n]==`string`}isGlobstar(){return this.#e[this.#n]===t.GLOBSTAR}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join(`/`):this.#t.join(`/`):this.#t.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#i===void 0?this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#n+1,this.#r),this.#i.#c=this.#c,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null:this.#i}isUNC(){let e=this.#e;return this.#s===void 0?this.#s=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#s}isDrive(){let e=this.#e;return this.#o===void 0?this.#o=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#o}isAbsolute(){let e=this.#e;return this.#c===void 0?this.#c=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#c}root(){let e=this.#e[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}}})),DM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Ignore=void 0;let t=SM(),n=EM(),r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:a,platform:o=r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let r=new t.Minimatch(e,this.mmopts);for(let e=0;e{Object.defineProperty(e,`__esModule`,{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;let t=SM();var n=class e{store;constructor(e=new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}};e.HasWalkedCache=n;var r=class{store=new Map;add(e,t,n){let r=(t?2:0)|(n?1:0),i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};e.MatchRecord=r;var i=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};e.SubWalks=i,e.Processor=class e{hasWalkedCache;matches=new r;subwalks=new i;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new n}processPatterns(e,n){this.patterns=n;let r=n.map(t=>[e,t]);for(let[e,n]of r){this.hasWalkedCache.storeWalked(e,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){e=e.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let t=n.rest();if(t)n=t;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)e=e.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(e,n))continue;this.hasWalkedCache.storeWalked(e,n)}if(typeof a==`string`){let t=a===`..`||a===``||a===`.`;this.matches.add(e.resolve(a),i,t);continue}else if(a===t.GLOBSTAR){(!e.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(e,n);let t=o?.pattern(),r=o?.rest();if(!o||(t===``||t===`.`)&&!r)this.matches.add(e,i,t===``||t===`.`);else if(t===`..`){let t=e.parent||e;r?this.hasWalkedCache.hasWalked(t,r)||this.subwalks.add(t,r):this.matches.add(t,i,!0)}}else a instanceof RegExp&&this.subwalks.add(e,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let e of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===t.GLOBSTAR?i.testGlobstar(e,n,o,r):a instanceof RegExp?i.testRegExp(e,a,o,r):i.testString(e,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}})),kM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;let t=wM(),n=DM(),r=OM(),i=(e,t)=>typeof e==`string`?new n.Ignore([e],t):Array.isArray(e)?new n.Ignore(e,t):e;var a=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=i(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let t=`${e.relativePosix()}/**`;this.#t.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new r.Processor(this.opts),n)}walkCB2(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new r.Processor(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#i(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}};e.GlobUtil=a,e.GlobWalker=class extends a{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},e.GlobStream=class extends a{results;constructor(e,n,r){super(e,n,r),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}})),AM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Glob=void 0;let t=SM(),n=W(`node:url`),r=TM(),i=EM(),a=kM(),o=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Glob=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,a){if(!a)throw TypeError(`glob options required`);if(this.withFileTypes=!!a.withFileTypes,this.signal=a.signal,this.follow=!!a.follow,this.dot=!!a.dot,this.dotRelative=!!a.dotRelative,this.nodir=!!a.nodir,this.mark=!!a.mark,a.cwd?(a.cwd instanceof URL||a.cwd.startsWith(`file://`))&&(a.cwd=(0,n.fileURLToPath)(a.cwd)):this.cwd=``,this.cwd=a.cwd||``,this.root=a.root,this.magicalBraces=!!a.magicalBraces,this.nobrace=!!a.nobrace,this.noext=!!a.noext,this.realpath=!!a.realpath,this.absolute=a.absolute,this.includeChildMatches=a.includeChildMatches!==!1,this.noglobstar=!!a.noglobstar,this.matchBase=!!a.matchBase,this.maxDepth=typeof a.maxDepth==`number`?a.maxDepth:1/0,this.stat=!!a.stat,this.ignore=a.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(a.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=a.platform||o,this.opts={...a,platform:this.platform},a.scurry){if(this.scurry=a.scurry,a.nocase!==void 0&&a.nocase!==a.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else this.scurry=new(a.platform===`win32`?r.PathScurryWin32:a.platform===`darwin`?r.PathScurryDarwin:a.platform?r.PathScurryPosix:r.PathScurry)(this.cwd,{nocase:a.nocase,fs:a.fs});this.nocase=this.scurry.nocase;let s=this.platform===`darwin`||this.platform===`win32`,c={...a,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[l,u]=this.pattern.map(e=>new t.Minimatch(e,c)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=l.map((e,t)=>{let n=u[t];if(!n)throw Error(`invalid pattern object`);return new i.Pattern(e,n,0,this.platform)})}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}})),jM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasMagic=void 0;let t=SM();e.hasMagic=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new t.Minimatch(r,n).hasMagic())return!0;return!1}})),MM=U((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0,e.globStreamSync=c,e.globStream=l,e.globSync=u,e.globIterateSync=f,e.globIterate=p;let t=SM(),n=AM(),r=jM();var i=SM();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return i.escape}}),Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return i.unescape}});var a=AM();Object.defineProperty(e,`Glob`,{enumerable:!0,get:function(){return a.Glob}});var o=jM();Object.defineProperty(e,`hasMagic`,{enumerable:!0,get:function(){return o.hasMagic}});var s=DM();Object.defineProperty(e,`Ignore`,{enumerable:!0,get:function(){return s.Ignore}});function c(e,t={}){return new n.Glob(e,t).streamSync()}function l(e,t={}){return new n.Glob(e,t).stream()}function u(e,t={}){return new n.Glob(e,t).walkSync()}async function d(e,t={}){return new n.Glob(e,t).walk()}function f(e,t={}){return new n.Glob(e,t).iterateSync()}function p(e,t={}){return new n.Glob(e,t).iterate()}e.streamSync=c,e.stream=Object.assign(l,{sync:c}),e.iterateSync=f,e.iterate=Object.assign(p,{sync:f}),e.sync=Object.assign(u,{stream:c,iterate:f}),e.glob=Object.assign(d,{glob:d,globSync:u,sync:e.sync,globStream:l,stream:e.stream,globStreamSync:c,streamSync:e.streamSync,globIterate:p,iterate:e.iterate,globIterateSync:f,iterateSync:e.iterateSync,Glob:n.Glob,hasMagic:r.hasMagic,escape:t.escape,unescape:t.unescape}),e.glob.glob=e.glob})),NM=U(((e,t)=>{var n=Mk(),r=W(`path`),i=wj(),a=sM(),o=pM(),s=gM(),c=MM(),l=t.exports={},u=/[\/\\]/g,d=function(e,t){var n=[];return i(e).forEach(function(e){var r=e.indexOf(`!`)===0;r&&(e=e.slice(1));var i=t(e);n=r?a(n,i):o(n,i)}),n};l.exists=function(){var e=r.join.apply(r,arguments);return n.existsSync(e)},l.expand=function(...e){var t=s(e[0])?e.shift():{},i=Array.isArray(e[0])?e[0]:e;if(i.length===0)return[];var a=d(i,function(e){return c.sync(e,t)});return t.filter&&(a=a.filter(function(e){e=r.join(t.cwd||``,e);try{return typeof t.filter==`function`?t.filter(e):n.statSync(e)[t.filter]()}catch{return!1}})),a},l.expandMapping=function(e,t,n){n=Object.assign({rename:function(e,t){return r.join(e||``,t)}},n);var i=[],a={};return l.expand(n,e).forEach(function(e){var o=e;n.flatten&&(o=r.basename(o)),n.ext&&(o=o.replace(/(\.[^\/]*)?$/,n.ext));var s=n.rename(t,o,n);n.cwd&&(e=r.join(n.cwd,e)),s=s.replace(u,`/`),e=e.replace(u,`/`),a[s]?a[s].src.push(e):(i.push({src:[e],dest:s}),a[s]=i[i.length-1])}),i},l.normalizeFilesArray=function(e){var t=[];return e.forEach(function(e){(`src`in e||`dest`in e)&&t.push(e)}),t.length===0?[]:(t=_(t).chain().forEach(function(e){!(`src`in e)||!e.src||(Array.isArray(e.src)?e.src=i(e.src):e.src=[e.src])}).map(function(e){var t=Object.assign({},e);if(delete t.src,delete t.dest,e.expand)return l.expandMapping(e.src,e.dest,t).map(function(t){var n=Object.assign({},e);return n.orig=Object.assign({},e),n.src=t.src,n.dest=t.dest,[`expand`,`cwd`,`flatten`,`rename`,`ext`].forEach(function(e){delete n[e]}),n});var n=Object.assign({},e);return n.orig=Object.assign({},e),`src`in n&&Object.defineProperty(n,`src`,{enumerable:!0,get:function n(){var r;return`result`in n||(r=e.src,r=Array.isArray(r)?i(r):[r],n.result=l.expand(t,r)),n.result}}),`dest`in n&&(n.dest=e.dest),n}).flatten().value(),t)}})),PM=U(((e,t)=>{var n=Mk(),r=W(`path`),i=Nk(),a=Qk(),o=$k(),s=WA();W(`stream`).Stream;var c=bj().PassThrough,l=t.exports={};l.file=NM(),l.collectStream=function(e,t){var n=[],r=0;e.on(`error`,t),e.on(`data`,function(e){n.push(e),r+=e.length}),e.on(`end`,function(){var e=Buffer.alloc(r),i=0;n.forEach(function(t){t.copy(e,i),i+=t.length}),t(null,e)})},l.dateify=function(e){return e||=new Date,e=e instanceof Date?e:typeof e==`string`?new Date(e):new Date,e},l.defaults=function(e,t,n){var r=arguments;return r[0]=r[0]||{},s(...r)},l.isStream=function(e){return i(e)},l.lazyReadStream=function(e){return new a.Readable(function(){return n.createReadStream(e)})},l.normalizeInputSource=function(e){return e===null?Buffer.alloc(0):typeof e==`string`?Buffer.from(e):l.isStream(e)?e.pipe(new c):e},l.sanitizePath=function(e){return o(e,!1).replace(/^\w+:/,``).replace(/^(\.\.\/|\/)+/,``)},l.trailingSlashIt=function(e){return e.slice(-1)===`/`?e:e+`/`},l.unixifyPath=function(e){return o(e,!1).replace(/^\w+:/,``)},l.walkdir=function(e,t,i){var a=[];typeof t==`function`&&(i=t,t=e),n.readdir(e,function(o,s){var c=0,u,d;if(o)return i(o);(function o(){if(u=s[c++],!u)return i(null,a);d=r.join(e,u),n.stat(d,function(e,n){a.push({path:d,relative:r.relative(t,d).replace(/\\/g,`/`),stats:n}),n&&n.isDirectory()?l.walkdir(d,t,function(e,t){if(e)return i(e);t.forEach(function(e){a.push(e)}),o()}):o()})})()})}})),FM=U(((e,t)=>{ /** * Archiver Core * @@ -89,7 +89,7 @@ var n=W(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r. * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=W(`util`);let r={ABORTED:`archive was aborted`,DIRECTORYDIRPATHREQUIRED:`diretory dirpath argument must be a non-empty string value`,DIRECTORYFUNCTIONINVALIDDATA:`invalid data returned by directory custom data function`,ENTRYNAMEREQUIRED:`entry name must be a non-empty string value`,FILEFILEPATHREQUIRED:`file filepath argument must be a non-empty string value`,FINALIZING:`archive already finalizing`,QUEUECLOSED:`queue closed`,NOENDMETHOD:`no suitable finalize/end method defined by module`,DIRECTORYNOTSUPPORTED:`support for directory entries not defined by module`,FORMATSET:`archive format already set`,INPUTSTEAMBUFFERREQUIRED:`input source must be valid Stream or Buffer instance`,MODULESET:`module already set`,SYMLINKNOTSUPPORTED:`support for symlink entries not defined by module`,SYMLINKFILEPATHREQUIRED:`symlink filepath argument must be a non-empty string value`,SYMLINKTARGETREQUIRED:`symlink target argument must be a non-empty string value`,ENTRYNOTSUPPORTED:`entry not supported`};function i(e,t){Error.captureStackTrace(this,this.constructor),this.message=r[e]||e,this.code=e,this.data=t}n.inherits(i,Error),e=t.exports=i})),RM=U(((e,t)=>{ +var n=W(`util`);let r={ABORTED:`archive was aborted`,DIRECTORYDIRPATHREQUIRED:`diretory dirpath argument must be a non-empty string value`,DIRECTORYFUNCTIONINVALIDDATA:`invalid data returned by directory custom data function`,ENTRYNAMEREQUIRED:`entry name must be a non-empty string value`,FILEFILEPATHREQUIRED:`file filepath argument must be a non-empty string value`,FINALIZING:`archive already finalizing`,QUEUECLOSED:`queue closed`,NOENDMETHOD:`no suitable finalize/end method defined by module`,DIRECTORYNOTSUPPORTED:`support for directory entries not defined by module`,FORMATSET:`archive format already set`,INPUTSTEAMBUFFERREQUIRED:`input source must be valid Stream or Buffer instance`,MODULESET:`module already set`,SYMLINKNOTSUPPORTED:`support for symlink entries not defined by module`,SYMLINKFILEPATHREQUIRED:`symlink filepath argument must be a non-empty string value`,SYMLINKTARGETREQUIRED:`symlink target argument must be a non-empty string value`,ENTRYNOTSUPPORTED:`entry not supported`};function i(e,t){Error.captureStackTrace(this,this.constructor),this.message=r[e]||e,this.code=e,this.data=t}n.inherits(i,Error),e=t.exports=i})),IM=U(((e,t)=>{ /** * Archiver Core * @@ -97,7 +97,7 @@ var n=W(`util`);let r={ABORTED:`archive was aborted`,DIRECTORYDIRPATHREQUIRED:`d * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=W(`fs`),r=kk(),i=Ak(),a=W(`path`),o=IM(),s=W(`util`).inherits,c=LM(),l=Sj().Transform,u=process.platform===`win32`,d=function(e,t){if(!(this instanceof d))return new d(e,t);typeof e!=`string`&&(t=e,e=`zip`),t=this.options=o.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),l.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=i.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=i.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};s(d,l),d.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()},d.prototype._append=function(e,t){t||={};var r={source:null,filepath:e};t.name||=e,t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof n.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)},d.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)},d.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1},d.prototype._moduleAppend=function(e,t,n){if(this._state.aborted){n();return}this._module.append(e,t,function(e){if(this._task=null,this._state.aborted){this._shutdown();return}if(e){this.emit(`error`,e),setImmediate(n);return}this.emit(`entry`,t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit(`progress`,{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(n)}.bind(this))},d.prototype._moduleFinalize=function(){typeof this._module.finalize==`function`?this._module.finalize():typeof this._module.end==`function`?this._module.end():this.emit(`error`,new c(`NOENDMETHOD`))},d.prototype._modulePipe=function(){this._module.on(`error`,this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0},d.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]},d.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1},d.prototype._normalizeEntryData=function(e,t){e=o.defaults(e,{type:`file`,name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var n=e.type===`directory`;return e.name&&(typeof e.prefix==`string`&&e.prefix!==``&&(e.name=e.prefix+`/`+e.name,e.prefix=null),e.name=o.sanitizePath(e.name),e.type!==`symlink`&&e.name.slice(-1)===`/`?(n=!0,e.type=`directory`):n&&(e.name+=`/`)),typeof e.mode==`number`?u?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(u?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,u&&n&&(e.mode=493)):e.mode===null&&(e.mode=n?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=o.dateify(e.date),e},d.prototype._onModuleError=function(e){this.emit(`error`,e)},d.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()},d.prototype._onQueueTask=function(e,t){var n=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){n();return}this._task=e,this._moduleAppend(e.source,e.data,n)},d.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}n.lstat(e.filepath,function(n,r){if(this._state.aborted){setImmediate(t);return}if(n){this._entriesCount--,this.emit(`warning`,n),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,r),e&&(r.size&&(this._fsEntriesTotalBytes+=r.size),this._queue.push(e)),setImmediate(t)}.bind(this))},d.prototype._shutdown=function(){this._moduleUnpipe(),this.end()},d.prototype._transform=function(e,t,n){e&&(this._pointer+=e.length),n(null,e)},d.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type=`file`,e.data.sourceType=`stream`,e.source=o.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports(`directory`))e.data.name=o.trailingSlashIt(e.data.name),e.data.type=`directory`,e.data.sourcePath=o.trailingSlashIt(e.filepath),e.data.sourceType=`buffer`,e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports(`symlink`)){var r=n.readlinkSync(e.filepath),i=a.dirname(e.filepath);e.data.type=`symlink`,e.data.linkname=a.relative(i,a.resolve(i,r)),e.data.sourceType=`buffer`,e.source=Buffer.concat([])}else return t.isDirectory()?this.emit(`warning`,new c(`DIRECTORYNOTSUPPORTED`,e.data)):t.isSymbolicLink()?this.emit(`warning`,new c(`SYMLINKNOTSUPPORTED`,e.data)):this.emit(`warning`,new c(`ENTRYNOTSUPPORTED`,e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e},d.prototype.abort=function(){return this._state.aborted||this._state.finalized||this._abort(),this},d.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(t=this._normalizeEntryData(t),typeof t.name!=`string`||t.name.length===0)return this.emit(`error`,new c(`ENTRYNAMEREQUIRED`)),this;if(t.type===`directory`&&!this._moduleSupports(`directory`))return this.emit(`error`,new c(`DIRECTORYNOTSUPPORTED`,{name:t.name})),this;if(e=o.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType=`buffer`;else if(o.isStream(e))t.sourceType=`stream`;else return this.emit(`error`,new c(`INPUTSTEAMBUFFERREQUIRED`,{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this},d.prototype.directory=function(e,t,n){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(typeof e!=`string`||e.length===0)return this.emit(`error`,new c(`DIRECTORYDIRPATHREQUIRED`)),this;this._pending++,t===!1?t=``:typeof t!=`string`&&(t=e);var i=!1;typeof n==`function`?(i=n,n={}):typeof n!=`object`&&(n={});var a={stat:!0,dot:!0};function o(){this._pending--,this._maybeFinalize()}function s(e){this.emit(`error`,e)}function l(r){u.pause();var a=!1,o=Object.assign({},n);o.name=r.relative,o.prefix=t,o.stats=r.stat,o.callback=u.resume.bind(u);try{if(i){if(o=i(o),o===!1)a=!0;else if(typeof o!=`object`)throw new c(`DIRECTORYFUNCTIONINVALIDDATA`,{dirpath:e})}}catch(e){this.emit(`error`,e);return}if(a){u.resume();return}this._append(r.absolute,o)}var u=r(e,a);return u.on(`error`,s.bind(this)),u.on(`match`,l.bind(this)),u.on(`end`,o.bind(this)),this},d.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit(`error`,new c(`QUEUECLOSED`)),this):typeof e!=`string`||e.length===0?(this.emit(`error`,new c(`FILEFILEPATHREQUIRED`)),this):(this._append(e,t),this)},d.prototype.glob=function(e,t,n){this._pending++,t=o.defaults(t,{stat:!0,pattern:e});function i(){this._pending--,this._maybeFinalize()}function a(e){this.emit(`error`,e)}function s(e){c.pause();var t=Object.assign({},n);t.callback=c.resume.bind(c),t.stats=e.stat,t.name=e.relative,this._append(e.absolute,t)}var c=r(t.cwd||`.`,t);return c.on(`error`,a.bind(this)),c.on(`match`,s.bind(this)),c.on(`end`,i.bind(this)),this},d.prototype.finalize=function(){if(this._state.aborted){var e=new c(`ABORTED`);return this.emit(`error`,e),Promise.reject(e)}if(this._state.finalize){var t=new c(`FINALIZING`);return this.emit(`error`,t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var n=this;return new Promise(function(e,t){var r;n._module.on(`end`,function(){r||e()}),n._module.on(`error`,function(e){r=!0,t(e)})})},d.prototype.setFormat=function(e){return this._format?(this.emit(`error`,new c(`FORMATSET`)),this):(this._format=e,this)},d.prototype.setModule=function(e){return this._state.aborted?(this.emit(`error`,new c(`ABORTED`)),this):this._state.module?(this.emit(`error`,new c(`MODULESET`)),this):(this._module=e,this._modulePipe(),this)},d.prototype.symlink=function(e,t,n){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(typeof e!=`string`||e.length===0)return this.emit(`error`,new c(`SYMLINKFILEPATHREQUIRED`)),this;if(typeof t!=`string`||t.length===0)return this.emit(`error`,new c(`SYMLINKTARGETREQUIRED`,{filepath:e})),this;if(!this._moduleSupports(`symlink`))return this.emit(`error`,new c(`SYMLINKNOTSUPPORTED`,{filepath:e})),this;var r={};return r.type=`symlink`,r.name=e.replace(/\\/g,`/`),r.linkname=t.replace(/\\/g,`/`),r.sourceType=`buffer`,typeof n==`number`&&(r.mode=n),this._entriesCount++,this._queue.push({data:r,source:Buffer.concat([])}),this},d.prototype.pointer=function(){return this._pointer},d.prototype.use=function(e){return this._streams.push(e),this},t.exports=d})),zM=U(((e,t)=>{var n=t.exports=function(){};n.prototype.getName=function(){},n.prototype.getSize=function(){},n.prototype.getLastModifiedDate=function(){},n.prototype.isDirectory=function(){}})),BM=U(((e,t)=>{var n=t.exports={};n.dateToDos=function(e,t){t||=!1;var n=t?e.getFullYear():e.getUTCFullYear();if(n<1980)return 2162688;if(n>=2044)return 2141175677;var r={year:n,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return r.year-1980<<25|r.month+1<<21|r.date<<16|r.hours<<11|r.minutes<<5|r.seconds/2},n.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)},n.fromDosTime=function(e){return n.dosToDate(e.readUInt32LE(0))},n.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t},n.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t},n.getShortBytesValue=function(e,t){return e.readUInt16LE(t)},n.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t},n.getLongBytesValue=function(e,t){return e.readUInt32LE(t)},n.toDosTime=function(e){return n.getLongBytes(n.dateToDos(e))}})),VM=U(((e,t)=>{var n=BM(),r=8,i=1,a=4,o=2,s=64,c=2048,l=t.exports=function(){return this instanceof l?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new l};l.prototype.encode=function(){return n.getShortBytes((this.descriptor?r:0)|(this.utf8?c:0)|(this.encryption?i:0)|(this.strongEncryption?s:0))},l.prototype.parse=function(e,t){var u=n.getShortBytesValue(e,t),d=new l;return d.useDataDescriptor((u&r)!==0),d.useUTF8ForNames((u&c)!==0),d.useStrongEncryption((u&s)!==0),d.useEncryption((u&i)!==0),d.setSlidingDictionarySize((u&o)===0?4096:8192),d.setNumberOfShannonFanoTrees((u&a)===0?2:3),d},l.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e},l.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees},l.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e},l.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize},l.prototype.useDataDescriptor=function(e){this.descriptor=e},l.prototype.usesDataDescriptor=function(){return this.descriptor},l.prototype.useEncryption=function(e){this.encryption=e},l.prototype.usesEncryption=function(){return this.encryption},l.prototype.useStrongEncryption=function(e){this.strongEncryption=e},l.prototype.usesStrongEncryption=function(){return this.strongEncryption},l.prototype.useUTF8ForNames=function(e){this.utf8=e},l.prototype.usesUTF8ForNames=function(){return this.utf8}})),HM=U(((e,t)=>{t.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}})),UM=U(((e,t)=>{t.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from([,,]),LONG:4,LONG_ZERO:Buffer.from([,,,,]),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}})),WM=U(((e,t)=>{var n=W(`util`).inherits,r=tA(),i=zM(),a=VM(),o=HM(),s=UM(),c=BM(),l=t.exports=function(e){if(!(this instanceof l))return new l(e);i.call(this),this.platform=s.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new a,this.crc=0,this.time=-1,this.minver=s.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};n(l,i),l.prototype.getCentralDirectoryExtra=function(){return this.getExtra()},l.prototype.getComment=function(){return this.comment===null?``:this.comment},l.prototype.getCompressedSize=function(){return this.csize},l.prototype.getCrc=function(){return this.crc},l.prototype.getExternalAttributes=function(){return this.exattr},l.prototype.getExtra=function(){return this.extra===null?s.EMPTY:this.extra},l.prototype.getGeneralPurposeBit=function(){return this.gpb},l.prototype.getInternalAttributes=function(){return this.inattr},l.prototype.getLastModifiedDate=function(){return this.getTime()},l.prototype.getLocalFileDataExtra=function(){return this.getExtra()},l.prototype.getMethod=function(){return this.method},l.prototype.getName=function(){return this.name},l.prototype.getPlatform=function(){return this.platform},l.prototype.getSize=function(){return this.size},l.prototype.getTime=function(){return this.time===-1?-1:c.dosToDate(this.time)},l.prototype.getTimeDos=function(){return this.time===-1?0:this.time},l.prototype.getUnixMode=function(){return this.platform===s.PLATFORM_UNIX?this.getExternalAttributes()>>s.SHORT_SHIFT&s.SHORT_MASK:0},l.prototype.getVersionNeededToExtract=function(){return this.minver},l.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e},l.prototype.setCompressedSize=function(e){if(e<0)throw Error(`invalid entry compressed size`);this.csize=e},l.prototype.setCrc=function(e){if(e<0)throw Error(`invalid entry crc32`);this.crc=e},l.prototype.setExternalAttributes=function(e){this.exattr=e>>>0},l.prototype.setExtra=function(e){this.extra=e},l.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof a))throw Error(`invalid entry GeneralPurposeBit`);this.gpb=e},l.prototype.setInternalAttributes=function(e){this.inattr=e},l.prototype.setMethod=function(e){if(e<0)throw Error(`invalid entry compression method`);this.method=e},l.prototype.setName=function(e,t=!1){e=r(e,!1).replace(/^\w+:/,``).replace(/^(\.\.\/|\/)+/,``),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e},l.prototype.setPlatform=function(e){this.platform=e},l.prototype.setSize=function(e){if(e<0)throw Error(`invalid entry size`);this.size=e},l.prototype.setTime=function(e,t){if(!(e instanceof Date))throw Error(`invalid entry time`);this.time=c.dateToDos(e,t)},l.prototype.setUnixMode=function(e){e|=this.isDirectory()?s.S_IFDIR:s.S_IFREG;var t=0;t|=e<s.ZIP64_MAGIC||this.size>s.ZIP64_MAGIC}})),GM=U(((e,t)=>{W(`stream`).Stream;var n=Sj().PassThrough,r=Fk(),i=t.exports={};i.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e==`string`)return Buffer.from(e);if(r(e)&&!e._readableState){var t=new n;return e.pipe(t),t}return e}})),KM=U(((e,t)=>{var n=W(`util`).inherits,r=Fk(),i=Sj().Transform,a=zM(),o=GM(),s=t.exports=function(e){if(!(this instanceof s))return new s(e);i.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};n(s,i),s.prototype._appendBuffer=function(e,t,n){},s.prototype._appendStream=function(e,t,n){},s.prototype._emitErrorCallback=function(e){e&&this.emit(`error`,e)},s.prototype._finish=function(e){},s.prototype._normalizeEntry=function(e){},s.prototype._transform=function(e,t,n){n(null,e)},s.prototype.entry=function(e,t,n){if(t||=null,typeof n!=`function`&&(n=this._emitErrorCallback.bind(this)),!(e instanceof a)){n(Error(`not a valid instance of ArchiveEntry`));return}if(this._archive.finish||this._archive.finished){n(Error(`unacceptable entry after finish`));return}if(this._archive.processing){n(Error(`already processing an entry`));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=o.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,n);else if(r(t))this._appendStream(e,t,n);else{this._archive.processing=!1,n(Error(`input source must be valid Stream or Buffer instance`));return}return this},s.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()},s.prototype.getBytesWritten=function(){return this.offset},s.prototype.write=function(e,t){return e&&(this.offset+=e.length),i.prototype.write.call(this,e,t)}})),qM=U((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],v=i[12],y=i[13],b=i[14];function x(e,t){for(var r=t^-1,i=0,a=e.length;i>>8^n[(r^e.charCodeAt(i++))&255];return~r}function S(e,t){for(var r=t^-1,i=e.length-15,x=0;x>8&255]^v[e[x++]^r>>16&255]^g[e[x++]^r>>>24]^h[e[x++]]^m[e[x++]]^p[e[x++]]^f[e[x++]]^d[e[x++]]^u[e[x++]]^l[e[x++]]^c[e[x++]]^s[e[x++]]^o[e[x++]]^a[e[x++]]^n[e[x++]];for(i+=15;x>>8^n[(r^e[x++])&255];return~r}function C(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=x,e.buf=S,e.str=C})})),JM=U(((e,t)=>{let{Transform:n}=Sj(),r=qM();t.exports=class extends n{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,t,n){e&&(this.checksum=r.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest(`hex`).toUpperCase()}size(){return this.rawSize}}})),YM=U(((e,t)=>{let{DeflateRaw:n}=W(`zlib`),r=qM();t.exports=class extends n{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,t){return e&&(this.compressedSize+=e.length),super.push(e,t)}_transform(e,t,n){e&&(this.checksum=r.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,t,n)}digest(e){let t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest(`hex`).toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}}})),XM=U(((e,t)=>{t.exports={CRC32Stream:JM(),DeflateCRC32Stream:YM()}})),ZM=U(((e,t)=>{var n=W(`util`).inherits,r=qM(),{CRC32Stream:i}=XM(),{DeflateCRC32Stream:a}=XM(),o=KM();WM(),VM();var s=UM();GM();var c=BM(),l=t.exports=function(e){if(!(this instanceof l))return new l(e);e=this.options=this._defaults(e),o.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:``,finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};n(l,o),l.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()},l.prototype._appendBuffer=function(e,t,n){t.length===0&&e.setMethod(s.METHOD_STORED);var i=e.getMethod();if(i===s.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(r.buf(t)>>>0)),this._writeLocalFileHeader(e),i===s.METHOD_STORED){this.write(t),this._afterAppend(e),n(null,e);return}else if(i===s.METHOD_DEFLATED){this._smartStream(e,n).end(t);return}else{n(Error(`compression method `+i+` not implemented`));return}},l.prototype._appendStream=function(e,t,n){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var r=this._smartStream(e,n);t.once(`error`,function(e){r.emit(`error`,e),r.end()}),t.pipe(r)},l.prototype._defaults=function(e){return typeof e!=`object`&&(e={}),typeof e.zlib!=`object`&&(e.zlib={}),typeof e.zlib.level!=`number`&&(e.zlib.level=s.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e},l.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()},l.prototype._normalizeEntry=function(e){e.getMethod()===-1&&e.setMethod(s.METHOD_DEFLATED),e.getMethod()===s.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR)),e.getTime()===-1&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}},l.prototype._smartStream=function(e,t){var n=e.getMethod()===s.METHOD_DEFLATED?new a(this.options.zlib):new i,r=null;function o(){var i=n.digest().readUInt32BE(0);e.setCrc(i),e.setSize(n.size()),e.setCompressedSize(n.size(!0)),this._afterAppend(e),t(r,e)}return n.once(`end`,o.bind(this)),n.once(`error`,function(e){r=e}),n.pipe(this,{end:!1}),n},l.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,n=this._archive.centralOffset;this.isZip64()&&(e=s.ZIP64_MAGIC_SHORT,t=s.ZIP64_MAGIC,n=s.ZIP64_MAGIC),this.write(c.getLongBytes(s.SIG_EOCD)),this.write(s.SHORT_ZERO),this.write(s.SHORT_ZERO),this.write(c.getShortBytes(e)),this.write(c.getShortBytes(e)),this.write(c.getLongBytes(t)),this.write(c.getLongBytes(n));var r=this.getComment(),i=Buffer.byteLength(r);this.write(c.getShortBytes(i)),this.write(r)},l.prototype._writeCentralDirectoryZip64=function(){this.write(c.getLongBytes(s.SIG_ZIP64_EOCD)),this.write(c.getEightBytes(44)),this.write(c.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(c.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(c.getEightBytes(this._entries.length)),this.write(c.getEightBytes(this._entries.length)),this.write(c.getEightBytes(this._archive.centralLength)),this.write(c.getEightBytes(this._archive.centralOffset)),this.write(c.getLongBytes(s.SIG_ZIP64_EOCD_LOC)),this.write(s.LONG_ZERO),this.write(c.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(c.getLongBytes(1))},l.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),n=e.getMethod(),r=e._offsets.file,i=e.getSize(),a=e.getCompressedSize();if(e.isZip64()||r>s.ZIP64_MAGIC){i=s.ZIP64_MAGIC,a=s.ZIP64_MAGIC,r=s.ZIP64_MAGIC,e.setVersionNeededToExtract(s.MIN_VERSION_ZIP64);var o=Buffer.concat([c.getShortBytes(s.ZIP64_EXTRA_ID),c.getShortBytes(24),c.getEightBytes(e.getSize()),c.getEightBytes(e.getCompressedSize()),c.getEightBytes(e._offsets.file)],28);e.setExtra(o)}this.write(c.getLongBytes(s.SIG_CFH)),this.write(c.getShortBytes(e.getPlatform()<<8|s.VERSION_MADEBY)),this.write(c.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(c.getShortBytes(n)),this.write(c.getLongBytes(e.getTimeDos())),this.write(c.getLongBytes(e.getCrc())),this.write(c.getLongBytes(a)),this.write(c.getLongBytes(i));var l=e.getName(),u=e.getComment(),d=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(l=Buffer.from(l),u=Buffer.from(u)),this.write(c.getShortBytes(l.length)),this.write(c.getShortBytes(d.length)),this.write(c.getShortBytes(u.length)),this.write(s.SHORT_ZERO),this.write(c.getShortBytes(e.getInternalAttributes())),this.write(c.getLongBytes(e.getExternalAttributes())),this.write(c.getLongBytes(r)),this.write(l),this.write(d),this.write(u)},l.prototype._writeDataDescriptor=function(e){this.write(c.getLongBytes(s.SIG_DD)),this.write(c.getLongBytes(e.getCrc())),e.isZip64()?(this.write(c.getEightBytes(e.getCompressedSize())),this.write(c.getEightBytes(e.getSize()))):(this.write(c.getLongBytes(e.getCompressedSize())),this.write(c.getLongBytes(e.getSize())))},l.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),n=e.getMethod(),r=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(r=Buffer.from(r)),e._offsets.file=this.offset,this.write(c.getLongBytes(s.SIG_LFH)),this.write(c.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(c.getShortBytes(n)),this.write(c.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO)):(this.write(c.getLongBytes(e.getCrc())),this.write(c.getLongBytes(e.getCompressedSize())),this.write(c.getLongBytes(e.getSize()))),this.write(c.getShortBytes(r.length)),this.write(c.getShortBytes(i.length)),this.write(r),this.write(i),e._offsets.contents=this.offset},l.prototype.getComment=function(e){return this._archive.comment===null?``:this._archive.comment},l.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>s.ZIP64_MAGIC_SHORT||this._archive.centralLength>s.ZIP64_MAGIC||this._archive.centralOffset>s.ZIP64_MAGIC},l.prototype.setComment=function(e){this._archive.comment=e}})),QM=U(((e,t)=>{t.exports={ArchiveEntry:zM(),ZipArchiveEntry:WM(),ArchiveOutputStream:KM(),ZipArchiveOutputStream:ZM()}})),$M=U(((e,t)=>{ +var n=W(`fs`),r=Dk(),i=Ok(),a=W(`path`),o=PM(),s=W(`util`).inherits,c=FM(),l=bj().Transform,u=process.platform===`win32`,d=function(e,t){if(!(this instanceof d))return new d(e,t);typeof e!=`string`&&(t=e,e=`zip`),t=this.options=o.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),l.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=i.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=i.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};s(d,l),d.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()},d.prototype._append=function(e,t){t||={};var r={source:null,filepath:e};t.name||=e,t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof n.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)},d.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)},d.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1},d.prototype._moduleAppend=function(e,t,n){if(this._state.aborted){n();return}this._module.append(e,t,function(e){if(this._task=null,this._state.aborted){this._shutdown();return}if(e){this.emit(`error`,e),setImmediate(n);return}this.emit(`entry`,t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit(`progress`,{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(n)}.bind(this))},d.prototype._moduleFinalize=function(){typeof this._module.finalize==`function`?this._module.finalize():typeof this._module.end==`function`?this._module.end():this.emit(`error`,new c(`NOENDMETHOD`))},d.prototype._modulePipe=function(){this._module.on(`error`,this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0},d.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]},d.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1},d.prototype._normalizeEntryData=function(e,t){e=o.defaults(e,{type:`file`,name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var n=e.type===`directory`;return e.name&&(typeof e.prefix==`string`&&e.prefix!==``&&(e.name=e.prefix+`/`+e.name,e.prefix=null),e.name=o.sanitizePath(e.name),e.type!==`symlink`&&e.name.slice(-1)===`/`?(n=!0,e.type=`directory`):n&&(e.name+=`/`)),typeof e.mode==`number`?u?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(u?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,u&&n&&(e.mode=493)):e.mode===null&&(e.mode=n?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=o.dateify(e.date),e},d.prototype._onModuleError=function(e){this.emit(`error`,e)},d.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()},d.prototype._onQueueTask=function(e,t){var n=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){n();return}this._task=e,this._moduleAppend(e.source,e.data,n)},d.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}n.lstat(e.filepath,function(n,r){if(this._state.aborted){setImmediate(t);return}if(n){this._entriesCount--,this.emit(`warning`,n),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,r),e&&(r.size&&(this._fsEntriesTotalBytes+=r.size),this._queue.push(e)),setImmediate(t)}.bind(this))},d.prototype._shutdown=function(){this._moduleUnpipe(),this.end()},d.prototype._transform=function(e,t,n){e&&(this._pointer+=e.length),n(null,e)},d.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type=`file`,e.data.sourceType=`stream`,e.source=o.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports(`directory`))e.data.name=o.trailingSlashIt(e.data.name),e.data.type=`directory`,e.data.sourcePath=o.trailingSlashIt(e.filepath),e.data.sourceType=`buffer`,e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports(`symlink`)){var r=n.readlinkSync(e.filepath),i=a.dirname(e.filepath);e.data.type=`symlink`,e.data.linkname=a.relative(i,a.resolve(i,r)),e.data.sourceType=`buffer`,e.source=Buffer.concat([])}else return t.isDirectory()?this.emit(`warning`,new c(`DIRECTORYNOTSUPPORTED`,e.data)):t.isSymbolicLink()?this.emit(`warning`,new c(`SYMLINKNOTSUPPORTED`,e.data)):this.emit(`warning`,new c(`ENTRYNOTSUPPORTED`,e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e},d.prototype.abort=function(){return this._state.aborted||this._state.finalized||this._abort(),this},d.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(t=this._normalizeEntryData(t),typeof t.name!=`string`||t.name.length===0)return this.emit(`error`,new c(`ENTRYNAMEREQUIRED`)),this;if(t.type===`directory`&&!this._moduleSupports(`directory`))return this.emit(`error`,new c(`DIRECTORYNOTSUPPORTED`,{name:t.name})),this;if(e=o.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType=`buffer`;else if(o.isStream(e))t.sourceType=`stream`;else return this.emit(`error`,new c(`INPUTSTEAMBUFFERREQUIRED`,{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this},d.prototype.directory=function(e,t,n){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(typeof e!=`string`||e.length===0)return this.emit(`error`,new c(`DIRECTORYDIRPATHREQUIRED`)),this;this._pending++,t===!1?t=``:typeof t!=`string`&&(t=e);var i=!1;typeof n==`function`?(i=n,n={}):typeof n!=`object`&&(n={});var a={stat:!0,dot:!0};function o(){this._pending--,this._maybeFinalize()}function s(e){this.emit(`error`,e)}function l(r){u.pause();var a=!1,o=Object.assign({},n);o.name=r.relative,o.prefix=t,o.stats=r.stat,o.callback=u.resume.bind(u);try{if(i){if(o=i(o),o===!1)a=!0;else if(typeof o!=`object`)throw new c(`DIRECTORYFUNCTIONINVALIDDATA`,{dirpath:e})}}catch(e){this.emit(`error`,e);return}if(a){u.resume();return}this._append(r.absolute,o)}var u=r(e,a);return u.on(`error`,s.bind(this)),u.on(`match`,l.bind(this)),u.on(`end`,o.bind(this)),this},d.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit(`error`,new c(`QUEUECLOSED`)),this):typeof e!=`string`||e.length===0?(this.emit(`error`,new c(`FILEFILEPATHREQUIRED`)),this):(this._append(e,t),this)},d.prototype.glob=function(e,t,n){this._pending++,t=o.defaults(t,{stat:!0,pattern:e});function i(){this._pending--,this._maybeFinalize()}function a(e){this.emit(`error`,e)}function s(e){c.pause();var t=Object.assign({},n);t.callback=c.resume.bind(c),t.stats=e.stat,t.name=e.relative,this._append(e.absolute,t)}var c=r(t.cwd||`.`,t);return c.on(`error`,a.bind(this)),c.on(`match`,s.bind(this)),c.on(`end`,i.bind(this)),this},d.prototype.finalize=function(){if(this._state.aborted){var e=new c(`ABORTED`);return this.emit(`error`,e),Promise.reject(e)}if(this._state.finalize){var t=new c(`FINALIZING`);return this.emit(`error`,t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var n=this;return new Promise(function(e,t){var r;n._module.on(`end`,function(){r||e()}),n._module.on(`error`,function(e){r=!0,t(e)})})},d.prototype.setFormat=function(e){return this._format?(this.emit(`error`,new c(`FORMATSET`)),this):(this._format=e,this)},d.prototype.setModule=function(e){return this._state.aborted?(this.emit(`error`,new c(`ABORTED`)),this):this._state.module?(this.emit(`error`,new c(`MODULESET`)),this):(this._module=e,this._modulePipe(),this)},d.prototype.symlink=function(e,t,n){if(this._state.finalize||this._state.aborted)return this.emit(`error`,new c(`QUEUECLOSED`)),this;if(typeof e!=`string`||e.length===0)return this.emit(`error`,new c(`SYMLINKFILEPATHREQUIRED`)),this;if(typeof t!=`string`||t.length===0)return this.emit(`error`,new c(`SYMLINKTARGETREQUIRED`,{filepath:e})),this;if(!this._moduleSupports(`symlink`))return this.emit(`error`,new c(`SYMLINKNOTSUPPORTED`,{filepath:e})),this;var r={};return r.type=`symlink`,r.name=e.replace(/\\/g,`/`),r.linkname=t.replace(/\\/g,`/`),r.sourceType=`buffer`,typeof n==`number`&&(r.mode=n),this._entriesCount++,this._queue.push({data:r,source:Buffer.concat([])}),this},d.prototype.pointer=function(){return this._pointer},d.prototype.use=function(e){return this._streams.push(e),this},t.exports=d})),LM=U(((e,t)=>{var n=t.exports=function(){};n.prototype.getName=function(){},n.prototype.getSize=function(){},n.prototype.getLastModifiedDate=function(){},n.prototype.isDirectory=function(){}})),RM=U(((e,t)=>{var n=t.exports={};n.dateToDos=function(e,t){t||=!1;var n=t?e.getFullYear():e.getUTCFullYear();if(n<1980)return 2162688;if(n>=2044)return 2141175677;var r={year:n,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return r.year-1980<<25|r.month+1<<21|r.date<<16|r.hours<<11|r.minutes<<5|r.seconds/2},n.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)},n.fromDosTime=function(e){return n.dosToDate(e.readUInt32LE(0))},n.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t},n.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t},n.getShortBytesValue=function(e,t){return e.readUInt16LE(t)},n.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t},n.getLongBytesValue=function(e,t){return e.readUInt32LE(t)},n.toDosTime=function(e){return n.getLongBytes(n.dateToDos(e))}})),zM=U(((e,t)=>{var n=RM(),r=8,i=1,a=4,o=2,s=64,c=2048,l=t.exports=function(){return this instanceof l?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new l};l.prototype.encode=function(){return n.getShortBytes((this.descriptor?r:0)|(this.utf8?c:0)|(this.encryption?i:0)|(this.strongEncryption?s:0))},l.prototype.parse=function(e,t){var u=n.getShortBytesValue(e,t),d=new l;return d.useDataDescriptor((u&r)!==0),d.useUTF8ForNames((u&c)!==0),d.useStrongEncryption((u&s)!==0),d.useEncryption((u&i)!==0),d.setSlidingDictionarySize((u&o)===0?4096:8192),d.setNumberOfShannonFanoTrees((u&a)===0?2:3),d},l.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e},l.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees},l.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e},l.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize},l.prototype.useDataDescriptor=function(e){this.descriptor=e},l.prototype.usesDataDescriptor=function(){return this.descriptor},l.prototype.useEncryption=function(e){this.encryption=e},l.prototype.usesEncryption=function(){return this.encryption},l.prototype.useStrongEncryption=function(e){this.strongEncryption=e},l.prototype.usesStrongEncryption=function(){return this.strongEncryption},l.prototype.useUTF8ForNames=function(e){this.utf8=e},l.prototype.usesUTF8ForNames=function(){return this.utf8}})),BM=U(((e,t)=>{t.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}})),VM=U(((e,t)=>{t.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from([,,]),LONG:4,LONG_ZERO:Buffer.from([,,,,]),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}})),HM=U(((e,t)=>{var n=W(`util`).inherits,r=$k(),i=LM(),a=zM(),o=BM(),s=VM(),c=RM(),l=t.exports=function(e){if(!(this instanceof l))return new l(e);i.call(this),this.platform=s.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new a,this.crc=0,this.time=-1,this.minver=s.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};n(l,i),l.prototype.getCentralDirectoryExtra=function(){return this.getExtra()},l.prototype.getComment=function(){return this.comment===null?``:this.comment},l.prototype.getCompressedSize=function(){return this.csize},l.prototype.getCrc=function(){return this.crc},l.prototype.getExternalAttributes=function(){return this.exattr},l.prototype.getExtra=function(){return this.extra===null?s.EMPTY:this.extra},l.prototype.getGeneralPurposeBit=function(){return this.gpb},l.prototype.getInternalAttributes=function(){return this.inattr},l.prototype.getLastModifiedDate=function(){return this.getTime()},l.prototype.getLocalFileDataExtra=function(){return this.getExtra()},l.prototype.getMethod=function(){return this.method},l.prototype.getName=function(){return this.name},l.prototype.getPlatform=function(){return this.platform},l.prototype.getSize=function(){return this.size},l.prototype.getTime=function(){return this.time===-1?-1:c.dosToDate(this.time)},l.prototype.getTimeDos=function(){return this.time===-1?0:this.time},l.prototype.getUnixMode=function(){return this.platform===s.PLATFORM_UNIX?this.getExternalAttributes()>>s.SHORT_SHIFT&s.SHORT_MASK:0},l.prototype.getVersionNeededToExtract=function(){return this.minver},l.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e},l.prototype.setCompressedSize=function(e){if(e<0)throw Error(`invalid entry compressed size`);this.csize=e},l.prototype.setCrc=function(e){if(e<0)throw Error(`invalid entry crc32`);this.crc=e},l.prototype.setExternalAttributes=function(e){this.exattr=e>>>0},l.prototype.setExtra=function(e){this.extra=e},l.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof a))throw Error(`invalid entry GeneralPurposeBit`);this.gpb=e},l.prototype.setInternalAttributes=function(e){this.inattr=e},l.prototype.setMethod=function(e){if(e<0)throw Error(`invalid entry compression method`);this.method=e},l.prototype.setName=function(e,t=!1){e=r(e,!1).replace(/^\w+:/,``).replace(/^(\.\.\/|\/)+/,``),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e},l.prototype.setPlatform=function(e){this.platform=e},l.prototype.setSize=function(e){if(e<0)throw Error(`invalid entry size`);this.size=e},l.prototype.setTime=function(e,t){if(!(e instanceof Date))throw Error(`invalid entry time`);this.time=c.dateToDos(e,t)},l.prototype.setUnixMode=function(e){e|=this.isDirectory()?s.S_IFDIR:s.S_IFREG;var t=0;t|=e<s.ZIP64_MAGIC||this.size>s.ZIP64_MAGIC}})),UM=U(((e,t)=>{W(`stream`).Stream;var n=bj().PassThrough,r=Nk(),i=t.exports={};i.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e==`string`)return Buffer.from(e);if(r(e)&&!e._readableState){var t=new n;return e.pipe(t),t}return e}})),WM=U(((e,t)=>{var n=W(`util`).inherits,r=Nk(),i=bj().Transform,a=LM(),o=UM(),s=t.exports=function(e){if(!(this instanceof s))return new s(e);i.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};n(s,i),s.prototype._appendBuffer=function(e,t,n){},s.prototype._appendStream=function(e,t,n){},s.prototype._emitErrorCallback=function(e){e&&this.emit(`error`,e)},s.prototype._finish=function(e){},s.prototype._normalizeEntry=function(e){},s.prototype._transform=function(e,t,n){n(null,e)},s.prototype.entry=function(e,t,n){if(t||=null,typeof n!=`function`&&(n=this._emitErrorCallback.bind(this)),!(e instanceof a)){n(Error(`not a valid instance of ArchiveEntry`));return}if(this._archive.finish||this._archive.finished){n(Error(`unacceptable entry after finish`));return}if(this._archive.processing){n(Error(`already processing an entry`));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=o.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,n);else if(r(t))this._appendStream(e,t,n);else{this._archive.processing=!1,n(Error(`input source must be valid Stream or Buffer instance`));return}return this},s.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()},s.prototype.getBytesWritten=function(){return this.offset},s.prototype.write=function(e,t){return e&&(this.offset+=e.length),i.prototype.write.call(this,e,t)}})),GM=U((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],v=i[12],y=i[13],b=i[14];function x(e,t){for(var r=t^-1,i=0,a=e.length;i>>8^n[(r^e.charCodeAt(i++))&255];return~r}function S(e,t){for(var r=t^-1,i=e.length-15,x=0;x>8&255]^v[e[x++]^r>>16&255]^g[e[x++]^r>>>24]^h[e[x++]]^m[e[x++]]^p[e[x++]]^f[e[x++]]^d[e[x++]]^u[e[x++]]^l[e[x++]]^c[e[x++]]^s[e[x++]]^o[e[x++]]^a[e[x++]]^n[e[x++]];for(i+=15;x>>8^n[(r^e[x++])&255];return~r}function C(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=x,e.buf=S,e.str=C})})),KM=U(((e,t)=>{let{Transform:n}=bj(),r=GM();t.exports=class extends n{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,t,n){e&&(this.checksum=r.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest(`hex`).toUpperCase()}size(){return this.rawSize}}})),qM=U(((e,t)=>{let{DeflateRaw:n}=W(`zlib`),r=GM();t.exports=class extends n{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,t){return e&&(this.compressedSize+=e.length),super.push(e,t)}_transform(e,t,n){e&&(this.checksum=r.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,t,n)}digest(e){let t=Buffer.allocUnsafe(4);return t.writeUInt32BE(this.checksum>>>0,0),e?t.toString(e):t}hex(){return this.digest(`hex`).toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}}})),JM=U(((e,t)=>{t.exports={CRC32Stream:KM(),DeflateCRC32Stream:qM()}})),YM=U(((e,t)=>{var n=W(`util`).inherits,r=GM(),{CRC32Stream:i}=JM(),{DeflateCRC32Stream:a}=JM(),o=WM();HM(),zM();var s=VM();UM();var c=RM(),l=t.exports=function(e){if(!(this instanceof l))return new l(e);e=this.options=this._defaults(e),o.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:``,finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};n(l,o),l.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()},l.prototype._appendBuffer=function(e,t,n){t.length===0&&e.setMethod(s.METHOD_STORED);var i=e.getMethod();if(i===s.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(r.buf(t)>>>0)),this._writeLocalFileHeader(e),i===s.METHOD_STORED){this.write(t),this._afterAppend(e),n(null,e);return}else if(i===s.METHOD_DEFLATED){this._smartStream(e,n).end(t);return}else{n(Error(`compression method `+i+` not implemented`));return}},l.prototype._appendStream=function(e,t,n){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var r=this._smartStream(e,n);t.once(`error`,function(e){r.emit(`error`,e),r.end()}),t.pipe(r)},l.prototype._defaults=function(e){return typeof e!=`object`&&(e={}),typeof e.zlib!=`object`&&(e.zlib={}),typeof e.zlib.level!=`number`&&(e.zlib.level=s.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e},l.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()},l.prototype._normalizeEntry=function(e){e.getMethod()===-1&&e.setMethod(s.METHOD_DEFLATED),e.getMethod()===s.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR)),e.getTime()===-1&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}},l.prototype._smartStream=function(e,t){var n=e.getMethod()===s.METHOD_DEFLATED?new a(this.options.zlib):new i,r=null;function o(){var i=n.digest().readUInt32BE(0);e.setCrc(i),e.setSize(n.size()),e.setCompressedSize(n.size(!0)),this._afterAppend(e),t(r,e)}return n.once(`end`,o.bind(this)),n.once(`error`,function(e){r=e}),n.pipe(this,{end:!1}),n},l.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,n=this._archive.centralOffset;this.isZip64()&&(e=s.ZIP64_MAGIC_SHORT,t=s.ZIP64_MAGIC,n=s.ZIP64_MAGIC),this.write(c.getLongBytes(s.SIG_EOCD)),this.write(s.SHORT_ZERO),this.write(s.SHORT_ZERO),this.write(c.getShortBytes(e)),this.write(c.getShortBytes(e)),this.write(c.getLongBytes(t)),this.write(c.getLongBytes(n));var r=this.getComment(),i=Buffer.byteLength(r);this.write(c.getShortBytes(i)),this.write(r)},l.prototype._writeCentralDirectoryZip64=function(){this.write(c.getLongBytes(s.SIG_ZIP64_EOCD)),this.write(c.getEightBytes(44)),this.write(c.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(c.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(c.getEightBytes(this._entries.length)),this.write(c.getEightBytes(this._entries.length)),this.write(c.getEightBytes(this._archive.centralLength)),this.write(c.getEightBytes(this._archive.centralOffset)),this.write(c.getLongBytes(s.SIG_ZIP64_EOCD_LOC)),this.write(s.LONG_ZERO),this.write(c.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(c.getLongBytes(1))},l.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),n=e.getMethod(),r=e._offsets.file,i=e.getSize(),a=e.getCompressedSize();if(e.isZip64()||r>s.ZIP64_MAGIC){i=s.ZIP64_MAGIC,a=s.ZIP64_MAGIC,r=s.ZIP64_MAGIC,e.setVersionNeededToExtract(s.MIN_VERSION_ZIP64);var o=Buffer.concat([c.getShortBytes(s.ZIP64_EXTRA_ID),c.getShortBytes(24),c.getEightBytes(e.getSize()),c.getEightBytes(e.getCompressedSize()),c.getEightBytes(e._offsets.file)],28);e.setExtra(o)}this.write(c.getLongBytes(s.SIG_CFH)),this.write(c.getShortBytes(e.getPlatform()<<8|s.VERSION_MADEBY)),this.write(c.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(c.getShortBytes(n)),this.write(c.getLongBytes(e.getTimeDos())),this.write(c.getLongBytes(e.getCrc())),this.write(c.getLongBytes(a)),this.write(c.getLongBytes(i));var l=e.getName(),u=e.getComment(),d=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(l=Buffer.from(l),u=Buffer.from(u)),this.write(c.getShortBytes(l.length)),this.write(c.getShortBytes(d.length)),this.write(c.getShortBytes(u.length)),this.write(s.SHORT_ZERO),this.write(c.getShortBytes(e.getInternalAttributes())),this.write(c.getLongBytes(e.getExternalAttributes())),this.write(c.getLongBytes(r)),this.write(l),this.write(d),this.write(u)},l.prototype._writeDataDescriptor=function(e){this.write(c.getLongBytes(s.SIG_DD)),this.write(c.getLongBytes(e.getCrc())),e.isZip64()?(this.write(c.getEightBytes(e.getCompressedSize())),this.write(c.getEightBytes(e.getSize()))):(this.write(c.getLongBytes(e.getCompressedSize())),this.write(c.getLongBytes(e.getSize())))},l.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),n=e.getMethod(),r=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(s.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(r=Buffer.from(r)),e._offsets.file=this.offset,this.write(c.getLongBytes(s.SIG_LFH)),this.write(c.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(c.getShortBytes(n)),this.write(c.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO)):(this.write(c.getLongBytes(e.getCrc())),this.write(c.getLongBytes(e.getCompressedSize())),this.write(c.getLongBytes(e.getSize()))),this.write(c.getShortBytes(r.length)),this.write(c.getShortBytes(i.length)),this.write(r),this.write(i),e._offsets.contents=this.offset},l.prototype.getComment=function(e){return this._archive.comment===null?``:this._archive.comment},l.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>s.ZIP64_MAGIC_SHORT||this._archive.centralLength>s.ZIP64_MAGIC||this._archive.centralOffset>s.ZIP64_MAGIC},l.prototype.setComment=function(e){this._archive.comment=e}})),XM=U(((e,t)=>{t.exports={ArchiveEntry:LM(),ZipArchiveEntry:HM(),ArchiveOutputStream:WM(),ZipArchiveOutputStream:YM()}})),ZM=U(((e,t)=>{ /** * ZipStream * @@ -105,7 +105,7 @@ var n=W(`fs`),r=kk(),i=Ak(),a=W(`path`),o=IM(),s=W(`util`).inherits,c=LM(),l=Sj( * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE} * @copyright (c) 2014 Chris Talkington, contributors. */ -var n=W(`util`).inherits,r=QM().ZipArchiveOutputStream,i=QM().ZipArchiveEntry,a=IM(),o=t.exports=function(e){if(!(this instanceof o))return new o(e);e=this.options=e||{},e.zlib=e.zlib||{},r.call(this,e),typeof e.level==`number`&&e.level>=0&&(e.zlib.level=e.level,delete e.level),!e.forceZip64&&typeof e.zlib.level==`number`&&e.zlib.level===0&&(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};n(o,r),o.prototype._normalizeFileData=function(e){e=a.defaults(e,{type:`file`,name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:``});var t=e.type===`directory`,n=e.type===`symlink`;return e.name&&(e.name=a.sanitizePath(e.name),!n&&e.name.slice(-1)===`/`?(t=!0,e.type=`directory`):t&&(e.name+=`/`)),(t||n)&&(e.store=!0),e.date=a.dateify(e.date),e},o.prototype.entry=function(e,t,n){if(typeof n!=`function`&&(n=this._emitErrorCallback.bind(this)),t=this._normalizeFileData(t),t.type!==`file`&&t.type!==`directory`&&t.type!==`symlink`){n(Error(t.type+` entries not currently supported`));return}if(typeof t.name!=`string`||t.name.length===0){n(Error(`entry name must be a non-empty string value`));return}if(t.type===`symlink`&&typeof t.linkname!=`string`){n(Error(`entry linkname must be a non-empty string value when type equals symlink`));return}var a=new i(t.name);return a.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&a.setName(t.name,!0),t.store&&a.setMethod(0),t.comment.length>0&&a.setComment(t.comment),t.type===`symlink`&&typeof t.mode!=`number`&&(t.mode=40960),typeof t.mode==`number`&&(t.type===`symlink`&&(t.mode|=40960),a.setUnixMode(t.mode)),t.type===`symlink`&&typeof t.linkname==`string`&&(e=Buffer.from(t.linkname)),r.prototype.entry.call(this,a,e,n)},o.prototype.finalize=function(){this.finish()}})),eN=U(((e,t)=>{ +var n=W(`util`).inherits,r=XM().ZipArchiveOutputStream,i=XM().ZipArchiveEntry,a=PM(),o=t.exports=function(e){if(!(this instanceof o))return new o(e);e=this.options=e||{},e.zlib=e.zlib||{},r.call(this,e),typeof e.level==`number`&&e.level>=0&&(e.zlib.level=e.level,delete e.level),!e.forceZip64&&typeof e.zlib.level==`number`&&e.zlib.level===0&&(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};n(o,r),o.prototype._normalizeFileData=function(e){e=a.defaults(e,{type:`file`,name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:``});var t=e.type===`directory`,n=e.type===`symlink`;return e.name&&(e.name=a.sanitizePath(e.name),!n&&e.name.slice(-1)===`/`?(t=!0,e.type=`directory`):t&&(e.name+=`/`)),(t||n)&&(e.store=!0),e.date=a.dateify(e.date),e},o.prototype.entry=function(e,t,n){if(typeof n!=`function`&&(n=this._emitErrorCallback.bind(this)),t=this._normalizeFileData(t),t.type!==`file`&&t.type!==`directory`&&t.type!==`symlink`){n(Error(t.type+` entries not currently supported`));return}if(typeof t.name!=`string`||t.name.length===0){n(Error(`entry name must be a non-empty string value`));return}if(t.type===`symlink`&&typeof t.linkname!=`string`){n(Error(`entry linkname must be a non-empty string value when type equals symlink`));return}var a=new i(t.name);return a.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&a.setName(t.name,!0),t.store&&a.setMethod(0),t.comment.length>0&&a.setComment(t.comment),t.type===`symlink`&&typeof t.mode!=`number`&&(t.mode=40960),typeof t.mode==`number`&&(t.type===`symlink`&&(t.mode|=40960),a.setUnixMode(t.mode)),t.type===`symlink`&&typeof t.linkname==`string`&&(e=Buffer.from(t.linkname)),r.prototype.entry.call(this,a,e,n)},o.prototype.finalize=function(){this.finish()}})),QM=U(((e,t)=>{ /** * ZIP Format Plugin * @@ -113,10 +113,10 @@ var n=W(`util`).inherits,r=QM().ZipArchiveOutputStream,i=QM().ZipArchiveEntry,a= * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=$M(),r=IM(),i=function(e){if(!(this instanceof i))return new i(e);e=this.options=r.defaults(e,{comment:``,forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new n(e)};i.prototype.append=function(e,t,n){this.engine.entry(e,t,n)},i.prototype.finalize=function(){this.engine.finalize()},i.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},i.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)},i.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)},t.exports=i})),tN=U(((e,t)=>{t.exports=W(`events`)})),nN=U(((e,t)=>{t.exports=class{constructor(e){if(!(e>0)||e-1&e)throw Error(`Max size for a FixedFIFO should be a power of two`);this.buffer=Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return this.buffer[this.top]===void 0?(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0):!1}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===void 0}}})),rN=U(((e,t)=>{let n=nN();t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){this.length!==0&&this.length--;let e=this.tail.shift();if(e===void 0&&this.tail.next){let e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){let e=this.tail.peek();return e===void 0&&this.tail.next?this.tail.next.peek():e}isEmpty(){return this.length===0}}})),iN=U(((e,t)=>{function n(e){return Buffer.isBuffer(e)||e instanceof Uint8Array}function r(e){return Buffer.isEncoding(e)}function i(e,t,n){return Buffer.alloc(e,t,n)}function a(e){return Buffer.allocUnsafe(e)}function o(e){return Buffer.allocUnsafeSlow(e)}function s(e,t){return Buffer.byteLength(e,t)}function c(e,t){return Buffer.compare(e,t)}function l(e,t){return Buffer.concat(e,t)}function u(e,t,n,r,i){return x(e).copy(t,n,r,i)}function d(e,t){return x(e).equals(t)}function f(e,t,n,r,i){return x(e).fill(t,n,r,i)}function p(e,t,n){return Buffer.from(e,t,n)}function m(e,t,n,r){return x(e).includes(t,n,r)}function h(e,t,n,r){return x(e).indexOf(t,n,r)}function g(e,t,n,r){return x(e).lastIndexOf(t,n,r)}function v(e){return x(e).swap16()}function y(e){return x(e).swap32()}function b(e){return x(e).swap64()}function x(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function S(e,t,n,r){return x(e).toString(t,n,r)}function C(e,t,n,r,i){return x(e).write(t,n,r,i)}function w(e,t){return x(e).readDoubleBE(t)}function T(e,t){return x(e).readDoubleLE(t)}function E(e,t){return x(e).readFloatBE(t)}function D(e,t){return x(e).readFloatLE(t)}function O(e,t){return x(e).readInt32BE(t)}function k(e,t){return x(e).readInt32LE(t)}function A(e,t){return x(e).readUInt32BE(t)}function j(e,t){return x(e).readUInt32LE(t)}function M(e,t,n){return x(e).writeDoubleBE(t,n)}function N(e,t,n){return x(e).writeDoubleLE(t,n)}function P(e,t,n){return x(e).writeFloatBE(t,n)}function F(e,t,n){return x(e).writeFloatLE(t,n)}function I(e,t,n){return x(e).writeInt32BE(t,n)}function L(e,t,n){return x(e).writeInt32LE(t,n)}function R(e,t,n){return x(e).writeUInt32BE(t,n)}function z(e,t,n){return x(e).writeUInt32LE(t,n)}t.exports={isBuffer:n,isEncoding:r,alloc:i,allocUnsafe:a,allocUnsafeSlow:o,byteLength:s,compare:c,concat:l,copy:u,equals:d,fill:f,from:p,includes:m,indexOf:h,lastIndexOf:g,swap16:v,swap32:y,swap64:b,toBuffer:x,toString:S,write:C,readDoubleBE:w,readDoubleLE:T,readFloatBE:E,readFloatLE:D,readInt32BE:O,readInt32LE:k,readUInt32BE:A,readUInt32LE:j,writeDoubleBE:M,writeDoubleLE:N,writeFloatBE:P,writeFloatLE:F,writeInt32BE:I,writeInt32LE:L,writeUInt32BE:R,writeUInt32LE:z}})),aN=U(((e,t)=>{let n=iN();t.exports=class{constructor(e){this.encoding=e}get remaining(){return 0}decode(e){return n.toString(e,this.encoding)}flush(){return``}}})),oN=U(((e,t)=>{let n=iN();t.exports=class{constructor(){this._reset()}get remaining(){return this.bytesSeen}decode(e){if(e.byteLength===0)return``;if(this.bytesNeeded===0&&r(e,0)===0)return this.bytesSeen=i(e),n.toString(e,`utf8`);let t=``,a=0;if(this.bytesNeeded>0){for(;athis.upperBoundary){t+=`�`,this._reset();break}if(this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|n&63,this.bytesSeen++,a++,this.bytesSeen===this.bytesNeeded){t+=String.fromCodePoint(this.codePoint),this._reset();break}}if(this.bytesNeeded>0)return t}let o=r(e,a),s=e.byteLength-o;s>a&&(t+=n.toString(e,`utf8`,a,s));for(let n=s;n=194&&r<=223?(this.bytesNeeded=2,this.bytesSeen=1,this.codePoint=r&31):r>=224&&r<=239?(r===224?this.lowerBoundary=160:r===237&&(this.upperBoundary=159),this.bytesNeeded=3,this.bytesSeen=1,this.codePoint=r&15):r>=240&&r<=244?(r===240?this.lowerBoundary=144:r===244&&(this.upperBoundary=143),this.bytesNeeded=4,this.bytesSeen=1,this.codePoint=r&7):(this.bytesSeen=1,t+=`�`);continue}if(rthis.upperBoundary){t+=`�`,n--,this._reset();continue}this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|r&63,this.bytesSeen++,this.bytesSeen===this.bytesNeeded&&(t+=String.fromCodePoint(this.codePoint),this._reset())}return t}flush(){let e=this.bytesNeeded>0?`�`:``;return this._reset(),e}_reset(){this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191}};function r(e,t){let n=e.byteLength;if(n<=t)return 0;let r=Math.max(t,n-4),i=n-1;for(;i>r&&(e[i]&192)==128;)i--;if(i=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 0;let s=n-i;return s=r&&(e[i]&192)==128;)i--;if(i<0)return 1;let a=e[i],o;if(a>=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 1;if(t-i!==o)return 1;if(o>=3){let t=e[i+1];if(a===224&&t<160||a===237&&t>159||a===240&&t<144||a===244&&t>143)return 1}return 0}})),sN=U(((e,t)=>{let n=aN(),r=oN();t.exports=class{constructor(e=`utf8`){switch(this.encoding=i(e),this.encoding){case`utf8`:this.decoder=new r;break;case`utf16le`:case`base64`:throw Error(`Unsupported encoding: `+this.encoding);default:this.decoder=new n(this.encoding)}}get remaining(){return this.decoder.remaining}push(e){return typeof e==`string`?e:this.decoder.decode(e)}write(e){return this.push(e)}end(e){let t=``;return e&&(t=this.push(e)),t+=this.decoder.flush(),t}};function i(e){switch(e=e.toLowerCase(),e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:throw Error(`Unknown encoding: `+e)}}})),cN=U(((e,t)=>{let{EventEmitter:n}=tN(),r=Error(`Stream was destroyed`),i=Error(`Premature close`),a=rN(),o=sN(),s=typeof queueMicrotask>`u`?e=>global.process.nextTick(e):queueMicrotask,c=(1<<29)-1,l=c^1;c^2;let u=1024,d=2048,f=4096,p=8192,m=16384,h=32768,g=65536,v=131072;16|g,f|128;let y=256|v;c^16,c^64,c^(64|g);let b=c^g;c^256,c^(128|p),c^u;let x=c^768,S=c^h;c^32;let C=c^v;c^y;let w=1<<18,T=2<<18,E=4<<18,D=8<<18,O=16<<18,k=32<<18,A=64<<18,j=128<<18,M=256<<18,N=512<<18,P=1024<<18;c^(w|M);let F=c^E;c^(w|N),c^O,c^D;let I=c^j;c^T;let L=c^P,R=16|w,z=c^R,ee=m|k,B=14|ee;F&536870847;let te=j|h,V=15|te&z;u|16399;let ne=m|143;u|143,u|16398,h|1,N|8388623,D|O,D|w;let H=270794767;E|w,w|M,k|134217742;let re=Symbol.asyncIterator||Symbol(`asyncIterator`);var ie=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:r,byteLength:i,byteLengthWritable:o}={}){this.stream=e,this.queue=new a,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||i||Le,this.map=r||n,this.afterWrite=U.bind(this),this.afterUpdateNextTick=pe.bind(this)}get ending(){return(this.stream._duplexState&N)!==0}get ended(){return(this.stream._duplexState&k)!==0}push(e){return this.stream._duplexState&142606350?!1:(this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered0,this.error=null,this.pipeline=null,this.byteLength=o||i||Le,this.map=r||n,this.pipeTo=null,this.afterRead=de.bind(this),this.afterUpdateNextTick=fe.bind(this)}get ending(){return(this.stream._duplexState&u)!==0}get ended(){return(this.stream._duplexState&m)!==0}pipe(e,t){if(this.pipeTo!==null)throw Error(`Can only pipe to one destination`);if(typeof t!=`function`&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new se(this.stream,e,t),t&&this.stream.on(`error`,Re),Oe(e))e._writableState.pipeline=this.pipeline,t&&e.on(`error`,Re),e.on(`finish`,this.pipeline.finished.bind(this.pipeline));else{let t=this.pipeline.done.bind(this.pipeline,e),n=this.pipeline.done.bind(this.pipeline,e,null);e.on(`error`,t),e.on(`close`,n),e.on(`finish`,this.pipeline.finished.bind(this.pipeline))}e.on(`drain`,ce.bind(this)),this.stream.emit(`piping`,e),e.emit(`pipe`,this.stream)}push(e){let t=this.stream;return e===null?(this.highWaterMark=0,t._duplexState=(t._duplexState|u)&536805311,!1):this.map!==null&&(e=this.map(e),e===null)?(t._duplexState&=b,this.buffered0;)t.push(this.shift());for(let e=0;e0;)i.drains.shift().resolve(!1);i.pipeline!==null&&i.pipeline.done(t,e)}}function U(e){let t=this.stream;e&&t.destroy(e),t._duplexState&=469499903,this.drains!==null&&W(this.drains),(t._duplexState&6553615)===O&&(t._duplexState&=532676607,(t._duplexState&A)===A&&t.emit(`drain`)),this.updateCallback()}function de(e){e&&this.stream.destroy(e),this.stream._duplexState&=536870895,this.readAhead===!1&&!(this.stream._duplexState&256)&&(this.stream._duplexState&=C),this.updateCallback()}function fe(){this.stream._duplexState&32||(this.stream._duplexState&=S,this.update())}function pe(){(this.stream._duplexState&T)===0&&(this.stream._duplexState&=I,this.update())}function W(e){for(let t=0;t0)?null:n(r)}}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTickIfOpen(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTickIfOpen(),this._readableState.unshift(e)}resume(){return this._duplexState|=y,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=this._readableState.readAhead===!1?536739583:536870655,this}static _fromAsyncIterator(t,n){let r,i=new e({...n,read(e){t.next().then(a).then(e.bind(null,null)).catch(e)},predestroy(){r=t.return()},destroy(e){if(!r)return e(null);r.then(e.bind(null,null)).catch(e)}});return i;function a(e){e.done?i.push(null):i.push(e.value)}}static from(t,n){if(Pe(t))return t;if(t[re])return this._fromAsyncIterator(t[re](),n);Array.isArray(t)||(t=t===void 0?[]:[t]);let r=0;return new e({...n,read(e){this.push(r===t.length?null:t[r++]),e(null)}})}static isBackpressured(e){return(e._duplexState&17422)!=0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(e._duplexState&256)==0}[re](){let e=this,t=null,n=null,i=null;return this.on(`error`,e=>{t=e}),this.on(`readable`,a),this.on(`close`,o),{[re](){return this},next(){return new Promise(function(t,r){n=t,i=r;let a=e.read();a===null?e._duplexState&8&&s(null):s(a)})},return(){return c(null)},throw(e){return c(e)}};function a(){n!==null&&s(e.read())}function o(){n!==null&&s(null)}function s(a){i!==null&&(t?i(t):a===null&&(e._duplexState&m)===0?i(r):n({value:a,done:a===null}),i=n=null)}function c(t){return e.destroy(t),new Promise((n,r)=>{if(e._duplexState&8)return n({value:void 0,done:!0});e.once(`close`,function(){t?r(t):n({value:void 0,done:!0})})})}}},ye=class extends _e{constructor(e){super(e),this._duplexState|=1|m,this._writableState=new ie(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}cork(){this._duplexState|=P}uncork(){this._duplexState&=L,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(e._duplexState&146800654)!=0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,n=(Be(e)?Math.min(1,t.queue.length):t.queue.length)+(e._duplexState&M?1:0);return n===0?Promise.resolve(!0):(t.drains===null&&(t.drains=[]),new Promise(e=>{t.drains.push({writes:n,resolve:e})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},be=class extends ve{constructor(e){super(e),this._duplexState=1|this._duplexState&v,this._writableState=new ie(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}cork(){this._duplexState|=P}uncork(){this._duplexState&=L,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},xe=class extends be{constructor(e){super(e),this._transformState=new oe(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(this._transformState.data!==null){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),this._transformState.data!==null&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(Ce.bind(this))}},Se=class extends xe{};function Ce(e,t){let n=this._transformState.afterFinal;if(e)return n(e);t!=null&&this.push(t),this.push(null),n(null)}function we(...e){return new Promise((t,n)=>Te(...e,e=>{if(e)return n(e);t()}))}function Te(e,...t){let n=Array.isArray(e)?[...e,...t]:[e,...t],r=n.length&&typeof n[n.length-1]==`function`?n.pop():null;if(n.length<2)throw Error(`Pipeline requires at least 2 streams`);let a=n[0],o=null,s=null;for(let e=1;e1,l),a.pipe(o)),a=o;if(r){let e=!1,t=Oe(o)||!!(o._writableState&&o._writableState.autoDestroy);o.on(`error`,e=>{s===null&&(s=e)}),o.on(`finish`,()=>{e=!0,t||r(s)}),t&&o.on(`close`,()=>r(s||(e?null:i)))}return o;function c(e,t,n,r){e.on(`error`,r),e.on(`close`,a);function a(){if(t&&e._readableState&&!e._readableState.ended||n&&e._writableState&&!e._writableState.ended)return r(i)}}function l(e){if(!(!e||s)){s=e;for(let t of n)t.destroy(e)}}}function Ee(e){return e}function De(e){return!!e._readableState||!!e._writableState}function Oe(e){return typeof e._duplexState==`number`&&De(e)}function ke(e){return!!e._readableState&&e._readableState.ending}function Ae(e){return!!e._readableState&&e._readableState.ended}function je(e){return!!e._writableState&&e._writableState.ending}function Me(e){return!!e._writableState&&e._writableState.ended}function Ne(e,t={}){let n=e._readableState&&e._readableState.error||e._writableState&&e._writableState.error;return!t.all&&n===r?null:n}function Pe(e){return Oe(e)&&e.readable}function Fe(e){return(e._duplexState&1)!=1||(e._duplexState&4)==4||(e._duplexState&te)!==0}function Ie(e){return typeof e==`object`&&!!e&&typeof e.byteLength==`number`}function Le(e){return Ie(e)?e.byteLength:1024}function Re(){}function ze(){this.destroy(Error(`Stream aborted.`))}function Be(e){return e._writev!==ye.prototype._writev&&e._writev!==be.prototype._writev}t.exports={pipeline:Te,pipelinePromise:we,isStream:De,isStreamx:Oe,isEnding:ke,isEnded:Ae,isFinishing:je,isFinished:Me,isDisturbed:Fe,getStreamError:Ne,Stream:_e,Writable:ye,Readable:ve,Duplex:be,Transform:xe,PassThrough:Se}})),lN=U((e=>{let t=iN(),n=t.from([117,115,116,97,114,0]),r=t.from([48,48]),i=t.from([117,115,116,97,114,32]),a=t.from([32,0]);e.decodeLongPath=function(e,t){return y(e,0,e.length,t)},e.encodePax=function(e){let n=``;e.name&&(n+=b(` path=`+e.name+` +var n=ZM(),r=PM(),i=function(e){if(!(this instanceof i))return new i(e);e=this.options=r.defaults(e,{comment:``,forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new n(e)};i.prototype.append=function(e,t,n){this.engine.entry(e,t,n)},i.prototype.finalize=function(){this.engine.finalize()},i.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},i.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)},i.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)},t.exports=i})),$M=U(((e,t)=>{t.exports=W(`events`)})),eN=U(((e,t)=>{t.exports=class{constructor(e){if(!(e>0)||e-1&e)throw Error(`Max size for a FixedFIFO should be a power of two`);this.buffer=Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return this.buffer[this.top]===void 0?(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0):!1}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===void 0}}})),tN=U(((e,t)=>{let n=eN();t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){this.length!==0&&this.length--;let e=this.tail.shift();if(e===void 0&&this.tail.next){let e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){let e=this.tail.peek();return e===void 0&&this.tail.next?this.tail.next.peek():e}isEmpty(){return this.length===0}}})),nN=U(((e,t)=>{function n(e){return Buffer.isBuffer(e)||e instanceof Uint8Array}function r(e){return Buffer.isEncoding(e)}function i(e,t,n){return Buffer.alloc(e,t,n)}function a(e){return Buffer.allocUnsafe(e)}function o(e){return Buffer.allocUnsafeSlow(e)}function s(e,t){return Buffer.byteLength(e,t)}function c(e,t){return Buffer.compare(e,t)}function l(e,t){return Buffer.concat(e,t)}function u(e,t,n,r,i){return x(e).copy(t,n,r,i)}function d(e,t){return x(e).equals(t)}function f(e,t,n,r,i){return x(e).fill(t,n,r,i)}function p(e,t,n){return Buffer.from(e,t,n)}function m(e,t,n,r){return x(e).includes(t,n,r)}function h(e,t,n,r){return x(e).indexOf(t,n,r)}function g(e,t,n,r){return x(e).lastIndexOf(t,n,r)}function v(e){return x(e).swap16()}function y(e){return x(e).swap32()}function b(e){return x(e).swap64()}function x(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function S(e,t,n,r){return x(e).toString(t,n,r)}function C(e,t,n,r,i){return x(e).write(t,n,r,i)}function w(e,t){return x(e).readDoubleBE(t)}function T(e,t){return x(e).readDoubleLE(t)}function E(e,t){return x(e).readFloatBE(t)}function D(e,t){return x(e).readFloatLE(t)}function O(e,t){return x(e).readInt32BE(t)}function k(e,t){return x(e).readInt32LE(t)}function A(e,t){return x(e).readUInt32BE(t)}function j(e,t){return x(e).readUInt32LE(t)}function M(e,t,n){return x(e).writeDoubleBE(t,n)}function N(e,t,n){return x(e).writeDoubleLE(t,n)}function P(e,t,n){return x(e).writeFloatBE(t,n)}function F(e,t,n){return x(e).writeFloatLE(t,n)}function I(e,t,n){return x(e).writeInt32BE(t,n)}function L(e,t,n){return x(e).writeInt32LE(t,n)}function R(e,t,n){return x(e).writeUInt32BE(t,n)}function z(e,t,n){return x(e).writeUInt32LE(t,n)}t.exports={isBuffer:n,isEncoding:r,alloc:i,allocUnsafe:a,allocUnsafeSlow:o,byteLength:s,compare:c,concat:l,copy:u,equals:d,fill:f,from:p,includes:m,indexOf:h,lastIndexOf:g,swap16:v,swap32:y,swap64:b,toBuffer:x,toString:S,write:C,readDoubleBE:w,readDoubleLE:T,readFloatBE:E,readFloatLE:D,readInt32BE:O,readInt32LE:k,readUInt32BE:A,readUInt32LE:j,writeDoubleBE:M,writeDoubleLE:N,writeFloatBE:P,writeFloatLE:F,writeInt32BE:I,writeInt32LE:L,writeUInt32BE:R,writeUInt32LE:z}})),rN=U(((e,t)=>{let n=nN();t.exports=class{constructor(e){this.encoding=e}get remaining(){return 0}decode(e){return n.toString(e,this.encoding)}flush(){return``}}})),iN=U(((e,t)=>{let n=nN();t.exports=class{constructor(){this._reset()}get remaining(){return this.bytesSeen}decode(e){if(e.byteLength===0)return``;if(this.bytesNeeded===0&&r(e,0)===0)return this.bytesSeen=i(e),n.toString(e,`utf8`);let t=``,a=0;if(this.bytesNeeded>0){for(;athis.upperBoundary){t+=`�`,this._reset();break}if(this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|n&63,this.bytesSeen++,a++,this.bytesSeen===this.bytesNeeded){t+=String.fromCodePoint(this.codePoint),this._reset();break}}if(this.bytesNeeded>0)return t}let o=r(e,a),s=e.byteLength-o;s>a&&(t+=n.toString(e,`utf8`,a,s));for(let n=s;n=194&&r<=223?(this.bytesNeeded=2,this.bytesSeen=1,this.codePoint=r&31):r>=224&&r<=239?(r===224?this.lowerBoundary=160:r===237&&(this.upperBoundary=159),this.bytesNeeded=3,this.bytesSeen=1,this.codePoint=r&15):r>=240&&r<=244?(r===240?this.lowerBoundary=144:r===244&&(this.upperBoundary=143),this.bytesNeeded=4,this.bytesSeen=1,this.codePoint=r&7):(this.bytesSeen=1,t+=`�`);continue}if(rthis.upperBoundary){t+=`�`,n--,this._reset();continue}this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|r&63,this.bytesSeen++,this.bytesSeen===this.bytesNeeded&&(t+=String.fromCodePoint(this.codePoint),this._reset())}return t}flush(){let e=this.bytesNeeded>0?`�`:``;return this._reset(),e}_reset(){this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191}};function r(e,t){let n=e.byteLength;if(n<=t)return 0;let r=Math.max(t,n-4),i=n-1;for(;i>r&&(e[i]&192)==128;)i--;if(i=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 0;let s=n-i;return s=r&&(e[i]&192)==128;)i--;if(i<0)return 1;let a=e[i],o;if(a>=194&&a<=223)o=2;else if(a>=224&&a<=239)o=3;else if(a>=240&&a<=244)o=4;else return 1;if(t-i!==o)return 1;if(o>=3){let t=e[i+1];if(a===224&&t<160||a===237&&t>159||a===240&&t<144||a===244&&t>143)return 1}return 0}})),aN=U(((e,t)=>{let n=rN(),r=iN();t.exports=class{constructor(e=`utf8`){switch(this.encoding=i(e),this.encoding){case`utf8`:this.decoder=new r;break;case`utf16le`:case`base64`:throw Error(`Unsupported encoding: `+this.encoding);default:this.decoder=new n(this.encoding)}}get remaining(){return this.decoder.remaining}push(e){return typeof e==`string`?e:this.decoder.decode(e)}write(e){return this.push(e)}end(e){let t=``;return e&&(t=this.push(e)),t+=this.decoder.flush(),t}};function i(e){switch(e=e.toLowerCase(),e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:throw Error(`Unknown encoding: `+e)}}})),oN=U(((e,t)=>{let{EventEmitter:n}=$M(),r=Error(`Stream was destroyed`),i=Error(`Premature close`),a=tN(),o=aN(),s=typeof queueMicrotask>`u`?e=>global.process.nextTick(e):queueMicrotask,c=(1<<29)-1,l=c^1;c^2;let u=1024,d=2048,f=4096,p=8192,m=16384,h=32768,g=65536,v=131072;16|g,f|128;let y=256|v;c^16,c^64,c^(64|g);let b=c^g;c^256,c^(128|p),c^u;let x=c^768,S=c^h;c^32;let C=c^v;c^y;let w=1<<18,T=2<<18,E=4<<18,D=8<<18,O=16<<18,k=32<<18,A=64<<18,j=128<<18,M=256<<18,N=512<<18,P=1024<<18;c^(w|M);let F=c^E;c^(w|N),c^O,c^D;let I=c^j;c^T;let L=c^P,R=16|w,z=c^R,ee=m|k,B=14|ee;F&536870847;let te=j|h,V=15|te&z;u|16399;let ne=m|143;u|143,u|16398,h|1,N|8388623,D|O,D|w;let H=270794767;E|w,w|M,k|134217742;let re=Symbol.asyncIterator||Symbol(`asyncIterator`);var ie=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:r,byteLength:i,byteLengthWritable:o}={}){this.stream=e,this.queue=new a,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||i||Le,this.map=r||n,this.afterWrite=U.bind(this),this.afterUpdateNextTick=pe.bind(this)}get ending(){return(this.stream._duplexState&N)!==0}get ended(){return(this.stream._duplexState&k)!==0}push(e){return this.stream._duplexState&142606350?!1:(this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered0,this.error=null,this.pipeline=null,this.byteLength=o||i||Le,this.map=r||n,this.pipeTo=null,this.afterRead=de.bind(this),this.afterUpdateNextTick=fe.bind(this)}get ending(){return(this.stream._duplexState&u)!==0}get ended(){return(this.stream._duplexState&m)!==0}pipe(e,t){if(this.pipeTo!==null)throw Error(`Can only pipe to one destination`);if(typeof t!=`function`&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new se(this.stream,e,t),t&&this.stream.on(`error`,Re),Oe(e))e._writableState.pipeline=this.pipeline,t&&e.on(`error`,Re),e.on(`finish`,this.pipeline.finished.bind(this.pipeline));else{let t=this.pipeline.done.bind(this.pipeline,e),n=this.pipeline.done.bind(this.pipeline,e,null);e.on(`error`,t),e.on(`close`,n),e.on(`finish`,this.pipeline.finished.bind(this.pipeline))}e.on(`drain`,ce.bind(this)),this.stream.emit(`piping`,e),e.emit(`pipe`,this.stream)}push(e){let t=this.stream;return e===null?(this.highWaterMark=0,t._duplexState=(t._duplexState|u)&536805311,!1):this.map!==null&&(e=this.map(e),e===null)?(t._duplexState&=b,this.buffered0;)t.push(this.shift());for(let e=0;e0;)i.drains.shift().resolve(!1);i.pipeline!==null&&i.pipeline.done(t,e)}}function U(e){let t=this.stream;e&&t.destroy(e),t._duplexState&=469499903,this.drains!==null&&W(this.drains),(t._duplexState&6553615)===O&&(t._duplexState&=532676607,(t._duplexState&A)===A&&t.emit(`drain`)),this.updateCallback()}function de(e){e&&this.stream.destroy(e),this.stream._duplexState&=536870895,this.readAhead===!1&&!(this.stream._duplexState&256)&&(this.stream._duplexState&=C),this.updateCallback()}function fe(){this.stream._duplexState&32||(this.stream._duplexState&=S,this.update())}function pe(){(this.stream._duplexState&T)===0&&(this.stream._duplexState&=I,this.update())}function W(e){for(let t=0;t0)?null:n(r)}}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTickIfOpen(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTickIfOpen(),this._readableState.unshift(e)}resume(){return this._duplexState|=y,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=this._readableState.readAhead===!1?536739583:536870655,this}static _fromAsyncIterator(t,n){let r,i=new e({...n,read(e){t.next().then(a).then(e.bind(null,null)).catch(e)},predestroy(){r=t.return()},destroy(e){if(!r)return e(null);r.then(e.bind(null,null)).catch(e)}});return i;function a(e){e.done?i.push(null):i.push(e.value)}}static from(t,n){if(Pe(t))return t;if(t[re])return this._fromAsyncIterator(t[re](),n);Array.isArray(t)||(t=t===void 0?[]:[t]);let r=0;return new e({...n,read(e){this.push(r===t.length?null:t[r++]),e(null)}})}static isBackpressured(e){return(e._duplexState&17422)!=0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(e._duplexState&256)==0}[re](){let e=this,t=null,n=null,i=null;return this.on(`error`,e=>{t=e}),this.on(`readable`,a),this.on(`close`,o),{[re](){return this},next(){return new Promise(function(t,r){n=t,i=r;let a=e.read();a===null?e._duplexState&8&&s(null):s(a)})},return(){return c(null)},throw(e){return c(e)}};function a(){n!==null&&s(e.read())}function o(){n!==null&&s(null)}function s(a){i!==null&&(t?i(t):a===null&&(e._duplexState&m)===0?i(r):n({value:a,done:a===null}),i=n=null)}function c(t){return e.destroy(t),new Promise((n,r)=>{if(e._duplexState&8)return n({value:void 0,done:!0});e.once(`close`,function(){t?r(t):n({value:void 0,done:!0})})})}}},ye=class extends _e{constructor(e){super(e),this._duplexState|=1|m,this._writableState=new ie(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}cork(){this._duplexState|=P}uncork(){this._duplexState&=L,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(e._duplexState&146800654)!=0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,n=(Be(e)?Math.min(1,t.queue.length):t.queue.length)+(e._duplexState&M?1:0);return n===0?Promise.resolve(!0):(t.drains===null&&(t.drains=[]),new Promise(e=>{t.drains.push({writes:n,resolve:e})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},be=class extends ve{constructor(e){super(e),this._duplexState=1|this._duplexState&v,this._writableState=new ie(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}cork(){this._duplexState|=P}uncork(){this._duplexState&=L,this._writableState.updateNextTick()}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},xe=class extends be{constructor(e){super(e),this._transformState=new oe(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(this._transformState.data!==null){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),this._transformState.data!==null&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(Ce.bind(this))}},Se=class extends xe{};function Ce(e,t){let n=this._transformState.afterFinal;if(e)return n(e);t!=null&&this.push(t),this.push(null),n(null)}function we(...e){return new Promise((t,n)=>Te(...e,e=>{if(e)return n(e);t()}))}function Te(e,...t){let n=Array.isArray(e)?[...e,...t]:[e,...t],r=n.length&&typeof n[n.length-1]==`function`?n.pop():null;if(n.length<2)throw Error(`Pipeline requires at least 2 streams`);let a=n[0],o=null,s=null;for(let e=1;e1,l),a.pipe(o)),a=o;if(r){let e=!1,t=Oe(o)||!!(o._writableState&&o._writableState.autoDestroy);o.on(`error`,e=>{s===null&&(s=e)}),o.on(`finish`,()=>{e=!0,t||r(s)}),t&&o.on(`close`,()=>r(s||(e?null:i)))}return o;function c(e,t,n,r){e.on(`error`,r),e.on(`close`,a);function a(){if(t&&e._readableState&&!e._readableState.ended||n&&e._writableState&&!e._writableState.ended)return r(i)}}function l(e){if(!(!e||s)){s=e;for(let t of n)t.destroy(e)}}}function Ee(e){return e}function De(e){return!!e._readableState||!!e._writableState}function Oe(e){return typeof e._duplexState==`number`&&De(e)}function ke(e){return!!e._readableState&&e._readableState.ending}function Ae(e){return!!e._readableState&&e._readableState.ended}function je(e){return!!e._writableState&&e._writableState.ending}function Me(e){return!!e._writableState&&e._writableState.ended}function Ne(e,t={}){let n=e._readableState&&e._readableState.error||e._writableState&&e._writableState.error;return!t.all&&n===r?null:n}function Pe(e){return Oe(e)&&e.readable}function Fe(e){return(e._duplexState&1)!=1||(e._duplexState&4)==4||(e._duplexState&te)!==0}function Ie(e){return typeof e==`object`&&!!e&&typeof e.byteLength==`number`}function Le(e){return Ie(e)?e.byteLength:1024}function Re(){}function ze(){this.destroy(Error(`Stream aborted.`))}function Be(e){return e._writev!==ye.prototype._writev&&e._writev!==be.prototype._writev}t.exports={pipeline:Te,pipelinePromise:we,isStream:De,isStreamx:Oe,isEnding:ke,isEnded:Ae,isFinishing:je,isFinished:Me,isDisturbed:Fe,getStreamError:Ne,Stream:_e,Writable:ye,Readable:ve,Duplex:be,Transform:xe,PassThrough:Se}})),sN=U((e=>{let t=nN(),n=t.from([117,115,116,97,114,0]),r=t.from([48,48]),i=t.from([117,115,116,97,114,32]),a=t.from([32,0]);e.decodeLongPath=function(e,t){return y(e,0,e.length,t)},e.encodePax=function(e){let n=``;e.name&&(n+=b(` path=`+e.name+` `)),e.linkname&&(n+=b(` linkpath=`+e.linkname+` `));let r=e.pax;if(r)for(let e in r)n+=b(` `+e+`=`+r[e]+` -`);return t.from(n)},e.decodePax=function(e){let n={};for(;e.length;){let r=0;for(;r100;){let e=a.indexOf(`/`);if(e===-1)return null;o+=o?`/`+a.slice(0,e):a.slice(0,e),a=a.slice(e+1)}return t.byteLength(a)>100||t.byteLength(o)>155||e.linkname&&t.byteLength(e.linkname)>100?null:(t.write(i,a),t.write(i,p(e.mode&4095,6),100),t.write(i,p(e.uid,6),108),t.write(i,p(e.gid,6),116),h(e.size,i,124),t.write(i,p(e.mtime.getTime()/1e3|0,11),136),i[156]=48+u(e.type),e.linkname&&t.write(i,e.linkname,157),t.copy(n,i,257),t.copy(r,i,263),e.uname&&t.write(i,e.uname,265),e.gname&&t.write(i,e.gname,297),t.write(i,p(e.devmajor||0,6),329),t.write(i,p(e.devminor||0,6),337),o&&t.write(i,o,345),t.write(i,p(f(i),6),148),i)},e.decode=function(e,t,n){let r=e[156]===0?0:e[156]-48,i=y(e,0,100,t),a=v(e,100,8),c=v(e,108,8),u=v(e,116,8),d=v(e,124,12),p=v(e,136,12),m=l(r),h=e[157]===0?null:y(e,157,100,t),g=y(e,265,32),b=y(e,297,32),x=v(e,329,8),S=v(e,337,8),C=f(e);if(C===256)return null;if(C!==v(e,148,8))throw Error(`Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?`);if(o(e))e[345]&&(i=y(e,345,155,t)+`/`+i);else if(!s(e)&&!n)throw Error(`Invalid tar header: unknown format.`);return r===0&&i&&i[i.length-1]===`/`&&(r=5),{name:i,mode:a,uid:c,gid:u,size:d,mtime:new Date(1e3*p),type:m,linkname:h,uname:g,gname:b,devmajor:x,devminor:S,pax:null}};function o(e){return t.equals(n,e.subarray(257,263))}function s(e){return t.equals(i,e.subarray(257,263))&&t.equals(a,e.subarray(263,265))}function c(e,t,n){return typeof e==`number`?(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0):n}function l(e){switch(e){case 0:return`file`;case 1:return`link`;case 2:return`symlink`;case 3:return`character-device`;case 4:return`block-device`;case 5:return`directory`;case 6:return`fifo`;case 7:return`contiguous-file`;case 72:return`pax-header`;case 55:return`pax-global-header`;case 27:return`gnu-long-link-path`;case 28:case 30:return`gnu-long-path`}return null}function u(e){switch(e){case`file`:return 0;case`link`:return 1;case`symlink`:return 2;case`character-device`:return 3;case`block-device`:return 4;case`directory`:return 5;case`fifo`:return 6;case`contiguous-file`:return 7;case`pax-header`:return 72}return 0}function d(e,t,n,r){for(;nt?`7777777777777777777`.slice(0,t)+` `:`0000000000000000000`.slice(0,t-e.length)+e+` `}function m(e,t,n){t[n]=128;for(let r=11;r>0;r--)t[n+r]=e&255,e=Math.floor(e/256)}function h(e,n,r){e.toString(8).length>11?m(e,n,r):t.write(n,p(e,11),r)}function g(e){let t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;let n=[],r;for(r=e.length-1;r>0;r--){let i=e[r];t?n.push(i):n.push(255-i)}let i=0,a=n.length;for(r=0;r=10**r&&r++,n+r+e}})),uN=U(((e,t)=>{let{Writable:n,Readable:r,getStreamError:i}=cN(),a=rN(),o=iN(),s=lN(),c=o.alloc(0);var l=class{constructor(){this.buffered=0,this.shifted=0,this.queue=new a,this._offset=0}push(e){this.buffered+=e.byteLength,this.queue.push(e)}shiftFirst(e){return this._buffered===0?null:this._next(e)}shift(e){if(e>this.buffered)return null;if(e===0)return c;let t=this._next(e);if(e===t.byteLength)return t;let n=[t];for(;(e-=t.byteLength)>0;)t=this._next(e),n.push(t);return o.concat(n)}_next(e){let t=this.queue.peek(),n=t.byteLength-this._offset;if(e>=n){let e=this._offset?t.subarray(this._offset,t.byteLength):t;return this.queue.shift(),this._offset=0,this.buffered-=n,this.shifted+=n,e}return this.buffered-=e,this.shifted+=e,t.subarray(this._offset,this._offset+=e)}},u=class extends r{constructor(e,t,n){super(),this.header=t,this.offset=n,this._parent=e}_read(e){this.header.size===0&&this.push(null),this._parent._stream===this&&this._parent._update(),e(null)}_predestroy(){this._parent.destroy(i(this))}_detach(){this._parent._stream===this&&(this._parent._stream=null,this._parent._missing=p(this.header.size),this._parent._update())}_destroy(e){this._detach(),e(null)}},d=class extends n{constructor(e){super(e),e||={},this._buffer=new l,this._offset=0,this._header=null,this._stream=null,this._missing=0,this._longHeader=!1,this._callback=f,this._locked=!1,this._finished=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null,this._filenameEncoding=e.filenameEncoding||`utf-8`,this._allowUnknownFormat=!!e.allowUnknownFormat,this._unlockBound=this._unlock.bind(this)}_unlock(e){if(this._locked=!1,e){this.destroy(e),this._continueWrite(e);return}this._update()}_consumeHeader(){if(this._locked)return!1;this._offset=this._buffer.shifted;try{this._header=s.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(e){return this._continueWrite(e),!1}if(!this._header)return!0;switch(this._header.type){case`gnu-long-path`:case`gnu-long-link-path`:case`pax-global-header`:case`pax-header`:return this._longHeader=!0,this._missing=this._header.size,!0}return this._locked=!0,this._applyLongHeaders(),this._header.size===0||this._header.type===`directory`?(this.emit(`entry`,this._header,this._createStream(),this._unlockBound),!0):(this._stream=this._createStream(),this._missing=this._header.size,this.emit(`entry`,this._header,this._stream,this._unlockBound),!0)}_applyLongHeaders(){this._gnuLongPath&&=(this._header.name=this._gnuLongPath,null),this._gnuLongLinkPath&&=(this._header.linkname=this._gnuLongLinkPath,null),this._pax&&=(this._pax.path&&(this._header.name=this._pax.path),this._pax.linkpath&&(this._header.linkname=this._pax.linkpath),this._pax.size&&(this._header.size=parseInt(this._pax.size,10)),this._header.pax=this._pax,null)}_decodeLongHeader(e){switch(this._header.type){case`gnu-long-path`:this._gnuLongPath=s.decodeLongPath(e,this._filenameEncoding);break;case`gnu-long-link-path`:this._gnuLongLinkPath=s.decodeLongPath(e,this._filenameEncoding);break;case`pax-global-header`:this._paxGlobal=s.decodePax(e);break;case`pax-header`:this._pax=this._paxGlobal===null?s.decodePax(e):Object.assign({},this._paxGlobal,s.decodePax(e));break}}_consumeLongHeader(){this._longHeader=!1,this._missing=p(this._header.size);let e=this._buffer.shift(this._header.size);try{this._decodeLongHeader(e)}catch(e){return this._continueWrite(e),!1}return!0}_consumeStream(){let e=this._buffer.shiftFirst(this._missing);if(e===null)return!1;this._missing-=e.byteLength;let t=this._stream.push(e);return this._missing===0?(this._stream.push(null),t&&this._stream._detach(),t&&this._locked===!1):t}_createStream(){return new u(this,this._header,this._offset)}_update(){for(;this._buffer.buffered>0&&!this.destroying;){if(this._missing>0){if(this._stream!==null){if(this._consumeStream()===!1)return;continue}if(this._longHeader===!0){if(this._missing>this._buffer.buffered)break;if(this._consumeLongHeader()===!1)return!1;continue}let e=this._buffer.shiftFirst(this._missing);e!==null&&(this._missing-=e.byteLength);continue}if(this._buffer.buffered<512)break;if(this._stream!==null||this._consumeHeader()===!1)return}this._continueWrite(null)}_continueWrite(e){let t=this._callback;this._callback=f,t(e)}_write(e,t){this._callback=t,this._buffer.push(e),this._update()}_final(e){this._finished=this._missing===0&&this._buffer.buffered===0,e(this._finished?null:Error(`Unexpected end of data`))}_predestroy(){this._continueWrite(null)}_destroy(e){this._stream&&this._stream.destroy(i(this)),e(null)}[Symbol.asyncIterator](){let e=null,t=null,n=null,r=null,i=null,a=this;return this.on(`entry`,c),this.on(`error`,t=>{e=t}),this.on(`close`,l),{[Symbol.asyncIterator](){return this},next(){return new Promise(s)},return(){return u(null)},throw(e){return u(e)}};function o(e){if(!i)return;let t=i;i=null,t(e)}function s(i,s){if(e)return s(e);if(r){i({value:r,done:!1}),r=null;return}t=i,n=s,o(null),a._finished&&t&&(t({value:void 0,done:!0}),t=n=null)}function c(e,a,o){i=o,a.on(`error`,f),t?(t({value:a,done:!1}),t=n=null):r=a}function l(){o(e),t&&=(e?n(e):t({value:void 0,done:!0}),n=null)}function u(e){return a.destroy(e),o(e),new Promise((t,n)=>{if(a.destroyed)return t({value:void 0,done:!0});a.once(`close`,function(){e?n(e):t({value:void 0,done:!0})})})}}};t.exports=function(e){return new d(e)};function f(){}function p(e){return e&=511,e&&512-e}})),dN=U(((e,t)=>{let n={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{t.exports=W(`fs`).constants||n}catch{t.exports=n}})),fN=U(((e,t)=>{let{Readable:n,Writable:r,getStreamError:i}=cN(),a=iN(),o=dN(),s=lN(),c=a.alloc(1024);var l=class extends r{constructor(e,t,n){super({mapWritable:m,eagerOpen:!0}),this.written=0,this.header=t,this._callback=n,this._linkname=null,this._isLinkname=t.type===`symlink`&&!t.linkname,this._isVoid=t.type!==`file`&&t.type!==`contiguous-file`,this._finished=!1,this._pack=e,this._openCallback=null,this._pack._stream===null?this._pack._stream=this:this._pack._pending.push(this)}_open(e){this._openCallback=e,this._pack._stream===this&&this._continueOpen()}_continuePack(e){if(this._callback===null)return;let t=this._callback;this._callback=null,t(e)}_continueOpen(){this._pack._stream===null&&(this._pack._stream=this);let e=this._openCallback;if(this._openCallback=null,e!==null){if(this._pack.destroying)return e(Error(`pack stream destroyed`));if(this._pack._finalized)return e(Error(`pack stream is already finalized`));this._pack._stream=this,this._isLinkname||this._pack._encode(this.header),this._isVoid&&(this._finish(),this._continuePack(null)),e(null)}}_write(e,t){if(this._isLinkname)return this._linkname=this._linkname?a.concat([this._linkname,e]):e,t(null);if(this._isVoid)return e.byteLength>0?t(Error(`No body allowed for this entry`)):t();if(this.written+=e.byteLength,this._pack.push(e))return t();this._pack._drain=t}_finish(){this._finished||(this._finished=!0,this._isLinkname&&(this.header.linkname=this._linkname?a.toString(this._linkname,`utf-8`):``,this._pack._encode(this.header)),p(this._pack,this.header.size),this._pack._done(this))}_final(e){if(this.written!==this.header.size)return e(Error(`Size mismatch`));this._finish(),e(null)}_getError(){return i(this)||Error(`tar entry destroyed`)}_predestroy(){this._pack.destroy(this._getError())}_destroy(e){this._pack._done(this),this._continuePack(this._finished?null:this._getError()),e()}},u=class extends n{constructor(e){super(e),this._drain=f,this._finalized=!1,this._finalizing=!1,this._pending=[],this._stream=null}entry(e,t,n){if(this._finalized||this.destroying)throw Error(`already finalized or destroyed`);typeof t==`function`&&(n=t,t=null),n||=f,(!e.size||e.type===`symlink`)&&(e.size=0),e.type||=d(e.mode),e.mode||=e.type===`directory`?493:420,e.uid||=0,e.gid||=0,e.mtime||=new Date,typeof t==`string`&&(t=a.from(t));let r=new l(this,e,n);return a.isBuffer(t)?(e.size=t.byteLength,r.write(t),r.end(),r):(r._isVoid,r)}finalize(){if(this._stream||this._pending.length>0){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(c),this.push(null))}_done(e){e===this._stream&&(this._stream=null,this._finalizing&&this.finalize(),this._pending.length&&this._pending.shift()._continueOpen())}_encode(e){if(!e.pax){let t=s.encode(e);if(t){this.push(t);return}}this._encodePax(e)}_encodePax(e){let t=s.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),n={name:`PaxHeader`,mode:e.mode,uid:e.uid,gid:e.gid,size:t.byteLength,mtime:e.mtime,type:`pax-header`,linkname:e.linkname&&`PaxHeader`,uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(s.encode(n)),this.push(t),p(this,t.byteLength),n.size=e.size,n.type=e.type,this.push(s.encode(n))}_doDrain(){let e=this._drain;this._drain=f,e()}_predestroy(){let e=i(this);for(this._stream&&this._stream.destroy(e);this._pending.length;){let t=this._pending.shift();t.destroy(e),t._continueOpen()}this._doDrain()}_read(e){this._doDrain(),e()}};t.exports=function(e){return new u(e)};function d(e){switch(e&o.S_IFMT){case o.S_IFBLK:return`block-device`;case o.S_IFCHR:return`character-device`;case o.S_IFDIR:return`directory`;case o.S_IFIFO:return`fifo`;case o.S_IFLNK:return`symlink`}return`file`}function f(){}function p(e,t){t&=511,t&&e.push(c.subarray(0,512-t))}function m(e){return a.isBuffer(e)?e:a.from(e)}})),pN=U((e=>{e.extract=uN(),e.pack=fN()})),mN=U(((e,t)=>{ +`);return t.from(n)},e.decodePax=function(e){let n={};for(;e.length;){let r=0;for(;r100;){let e=a.indexOf(`/`);if(e===-1)return null;o+=o?`/`+a.slice(0,e):a.slice(0,e),a=a.slice(e+1)}return t.byteLength(a)>100||t.byteLength(o)>155||e.linkname&&t.byteLength(e.linkname)>100?null:(t.write(i,a),t.write(i,p(e.mode&4095,6),100),t.write(i,p(e.uid,6),108),t.write(i,p(e.gid,6),116),h(e.size,i,124),t.write(i,p(e.mtime.getTime()/1e3|0,11),136),i[156]=48+u(e.type),e.linkname&&t.write(i,e.linkname,157),t.copy(n,i,257),t.copy(r,i,263),e.uname&&t.write(i,e.uname,265),e.gname&&t.write(i,e.gname,297),t.write(i,p(e.devmajor||0,6),329),t.write(i,p(e.devminor||0,6),337),o&&t.write(i,o,345),t.write(i,p(f(i),6),148),i)},e.decode=function(e,t,n){let r=e[156]===0?0:e[156]-48,i=y(e,0,100,t),a=v(e,100,8),c=v(e,108,8),u=v(e,116,8),d=v(e,124,12),p=v(e,136,12),m=l(r),h=e[157]===0?null:y(e,157,100,t),g=y(e,265,32),b=y(e,297,32),x=v(e,329,8),S=v(e,337,8),C=f(e);if(C===256)return null;if(C!==v(e,148,8))throw Error(`Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?`);if(o(e))e[345]&&(i=y(e,345,155,t)+`/`+i);else if(!s(e)&&!n)throw Error(`Invalid tar header: unknown format.`);return r===0&&i&&i[i.length-1]===`/`&&(r=5),{name:i,mode:a,uid:c,gid:u,size:d,mtime:new Date(1e3*p),type:m,linkname:h,uname:g,gname:b,devmajor:x,devminor:S,pax:null}};function o(e){return t.equals(n,e.subarray(257,263))}function s(e){return t.equals(i,e.subarray(257,263))&&t.equals(a,e.subarray(263,265))}function c(e,t,n){return typeof e==`number`?(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0):n}function l(e){switch(e){case 0:return`file`;case 1:return`link`;case 2:return`symlink`;case 3:return`character-device`;case 4:return`block-device`;case 5:return`directory`;case 6:return`fifo`;case 7:return`contiguous-file`;case 72:return`pax-header`;case 55:return`pax-global-header`;case 27:return`gnu-long-link-path`;case 28:case 30:return`gnu-long-path`}return null}function u(e){switch(e){case`file`:return 0;case`link`:return 1;case`symlink`:return 2;case`character-device`:return 3;case`block-device`:return 4;case`directory`:return 5;case`fifo`:return 6;case`contiguous-file`:return 7;case`pax-header`:return 72}return 0}function d(e,t,n,r){for(;nt?`7777777777777777777`.slice(0,t)+` `:`0000000000000000000`.slice(0,t-e.length)+e+` `}function m(e,t,n){t[n]=128;for(let r=11;r>0;r--)t[n+r]=e&255,e=Math.floor(e/256)}function h(e,n,r){e.toString(8).length>11?m(e,n,r):t.write(n,p(e,11),r)}function g(e){let t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;let n=[],r;for(r=e.length-1;r>0;r--){let i=e[r];t?n.push(i):n.push(255-i)}let i=0,a=n.length;for(r=0;r=10**r&&r++,n+r+e}})),cN=U(((e,t)=>{let{Writable:n,Readable:r,getStreamError:i}=oN(),a=tN(),o=nN(),s=sN(),c=o.alloc(0);var l=class{constructor(){this.buffered=0,this.shifted=0,this.queue=new a,this._offset=0}push(e){this.buffered+=e.byteLength,this.queue.push(e)}shiftFirst(e){return this._buffered===0?null:this._next(e)}shift(e){if(e>this.buffered)return null;if(e===0)return c;let t=this._next(e);if(e===t.byteLength)return t;let n=[t];for(;(e-=t.byteLength)>0;)t=this._next(e),n.push(t);return o.concat(n)}_next(e){let t=this.queue.peek(),n=t.byteLength-this._offset;if(e>=n){let e=this._offset?t.subarray(this._offset,t.byteLength):t;return this.queue.shift(),this._offset=0,this.buffered-=n,this.shifted+=n,e}return this.buffered-=e,this.shifted+=e,t.subarray(this._offset,this._offset+=e)}},u=class extends r{constructor(e,t,n){super(),this.header=t,this.offset=n,this._parent=e}_read(e){this.header.size===0&&this.push(null),this._parent._stream===this&&this._parent._update(),e(null)}_predestroy(){this._parent.destroy(i(this))}_detach(){this._parent._stream===this&&(this._parent._stream=null,this._parent._missing=p(this.header.size),this._parent._update())}_destroy(e){this._detach(),e(null)}},d=class extends n{constructor(e){super(e),e||={},this._buffer=new l,this._offset=0,this._header=null,this._stream=null,this._missing=0,this._longHeader=!1,this._callback=f,this._locked=!1,this._finished=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null,this._filenameEncoding=e.filenameEncoding||`utf-8`,this._allowUnknownFormat=!!e.allowUnknownFormat,this._unlockBound=this._unlock.bind(this)}_unlock(e){if(this._locked=!1,e){this.destroy(e),this._continueWrite(e);return}this._update()}_consumeHeader(){if(this._locked)return!1;this._offset=this._buffer.shifted;try{this._header=s.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(e){return this._continueWrite(e),!1}if(!this._header)return!0;switch(this._header.type){case`gnu-long-path`:case`gnu-long-link-path`:case`pax-global-header`:case`pax-header`:return this._longHeader=!0,this._missing=this._header.size,!0}return this._locked=!0,this._applyLongHeaders(),this._header.size===0||this._header.type===`directory`?(this.emit(`entry`,this._header,this._createStream(),this._unlockBound),!0):(this._stream=this._createStream(),this._missing=this._header.size,this.emit(`entry`,this._header,this._stream,this._unlockBound),!0)}_applyLongHeaders(){this._gnuLongPath&&=(this._header.name=this._gnuLongPath,null),this._gnuLongLinkPath&&=(this._header.linkname=this._gnuLongLinkPath,null),this._pax&&=(this._pax.path&&(this._header.name=this._pax.path),this._pax.linkpath&&(this._header.linkname=this._pax.linkpath),this._pax.size&&(this._header.size=parseInt(this._pax.size,10)),this._header.pax=this._pax,null)}_decodeLongHeader(e){switch(this._header.type){case`gnu-long-path`:this._gnuLongPath=s.decodeLongPath(e,this._filenameEncoding);break;case`gnu-long-link-path`:this._gnuLongLinkPath=s.decodeLongPath(e,this._filenameEncoding);break;case`pax-global-header`:this._paxGlobal=s.decodePax(e);break;case`pax-header`:this._pax=this._paxGlobal===null?s.decodePax(e):Object.assign({},this._paxGlobal,s.decodePax(e));break}}_consumeLongHeader(){this._longHeader=!1,this._missing=p(this._header.size);let e=this._buffer.shift(this._header.size);try{this._decodeLongHeader(e)}catch(e){return this._continueWrite(e),!1}return!0}_consumeStream(){let e=this._buffer.shiftFirst(this._missing);if(e===null)return!1;this._missing-=e.byteLength;let t=this._stream.push(e);return this._missing===0?(this._stream.push(null),t&&this._stream._detach(),t&&this._locked===!1):t}_createStream(){return new u(this,this._header,this._offset)}_update(){for(;this._buffer.buffered>0&&!this.destroying;){if(this._missing>0){if(this._stream!==null){if(this._consumeStream()===!1)return;continue}if(this._longHeader===!0){if(this._missing>this._buffer.buffered)break;if(this._consumeLongHeader()===!1)return!1;continue}let e=this._buffer.shiftFirst(this._missing);e!==null&&(this._missing-=e.byteLength);continue}if(this._buffer.buffered<512)break;if(this._stream!==null||this._consumeHeader()===!1)return}this._continueWrite(null)}_continueWrite(e){let t=this._callback;this._callback=f,t(e)}_write(e,t){this._callback=t,this._buffer.push(e),this._update()}_final(e){this._finished=this._missing===0&&this._buffer.buffered===0,e(this._finished?null:Error(`Unexpected end of data`))}_predestroy(){this._continueWrite(null)}_destroy(e){this._stream&&this._stream.destroy(i(this)),e(null)}[Symbol.asyncIterator](){let e=null,t=null,n=null,r=null,i=null,a=this;return this.on(`entry`,c),this.on(`error`,t=>{e=t}),this.on(`close`,l),{[Symbol.asyncIterator](){return this},next(){return new Promise(s)},return(){return u(null)},throw(e){return u(e)}};function o(e){if(!i)return;let t=i;i=null,t(e)}function s(i,s){if(e)return s(e);if(r){i({value:r,done:!1}),r=null;return}t=i,n=s,o(null),a._finished&&t&&(t({value:void 0,done:!0}),t=n=null)}function c(e,a,o){i=o,a.on(`error`,f),t?(t({value:a,done:!1}),t=n=null):r=a}function l(){o(e),t&&=(e?n(e):t({value:void 0,done:!0}),n=null)}function u(e){return a.destroy(e),o(e),new Promise((t,n)=>{if(a.destroyed)return t({value:void 0,done:!0});a.once(`close`,function(){e?n(e):t({value:void 0,done:!0})})})}}};t.exports=function(e){return new d(e)};function f(){}function p(e){return e&=511,e&&512-e}})),lN=U(((e,t)=>{let n={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{t.exports=W(`fs`).constants||n}catch{t.exports=n}})),uN=U(((e,t)=>{let{Readable:n,Writable:r,getStreamError:i}=oN(),a=nN(),o=lN(),s=sN(),c=a.alloc(1024);var l=class extends r{constructor(e,t,n){super({mapWritable:m,eagerOpen:!0}),this.written=0,this.header=t,this._callback=n,this._linkname=null,this._isLinkname=t.type===`symlink`&&!t.linkname,this._isVoid=t.type!==`file`&&t.type!==`contiguous-file`,this._finished=!1,this._pack=e,this._openCallback=null,this._pack._stream===null?this._pack._stream=this:this._pack._pending.push(this)}_open(e){this._openCallback=e,this._pack._stream===this&&this._continueOpen()}_continuePack(e){if(this._callback===null)return;let t=this._callback;this._callback=null,t(e)}_continueOpen(){this._pack._stream===null&&(this._pack._stream=this);let e=this._openCallback;if(this._openCallback=null,e!==null){if(this._pack.destroying)return e(Error(`pack stream destroyed`));if(this._pack._finalized)return e(Error(`pack stream is already finalized`));this._pack._stream=this,this._isLinkname||this._pack._encode(this.header),this._isVoid&&(this._finish(),this._continuePack(null)),e(null)}}_write(e,t){if(this._isLinkname)return this._linkname=this._linkname?a.concat([this._linkname,e]):e,t(null);if(this._isVoid)return e.byteLength>0?t(Error(`No body allowed for this entry`)):t();if(this.written+=e.byteLength,this._pack.push(e))return t();this._pack._drain=t}_finish(){this._finished||(this._finished=!0,this._isLinkname&&(this.header.linkname=this._linkname?a.toString(this._linkname,`utf-8`):``,this._pack._encode(this.header)),p(this._pack,this.header.size),this._pack._done(this))}_final(e){if(this.written!==this.header.size)return e(Error(`Size mismatch`));this._finish(),e(null)}_getError(){return i(this)||Error(`tar entry destroyed`)}_predestroy(){this._pack.destroy(this._getError())}_destroy(e){this._pack._done(this),this._continuePack(this._finished?null:this._getError()),e()}},u=class extends n{constructor(e){super(e),this._drain=f,this._finalized=!1,this._finalizing=!1,this._pending=[],this._stream=null}entry(e,t,n){if(this._finalized||this.destroying)throw Error(`already finalized or destroyed`);typeof t==`function`&&(n=t,t=null),n||=f,(!e.size||e.type===`symlink`)&&(e.size=0),e.type||=d(e.mode),e.mode||=e.type===`directory`?493:420,e.uid||=0,e.gid||=0,e.mtime||=new Date,typeof t==`string`&&(t=a.from(t));let r=new l(this,e,n);return a.isBuffer(t)?(e.size=t.byteLength,r.write(t),r.end(),r):(r._isVoid,r)}finalize(){if(this._stream||this._pending.length>0){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(c),this.push(null))}_done(e){e===this._stream&&(this._stream=null,this._finalizing&&this.finalize(),this._pending.length&&this._pending.shift()._continueOpen())}_encode(e){if(!e.pax){let t=s.encode(e);if(t){this.push(t);return}}this._encodePax(e)}_encodePax(e){let t=s.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),n={name:`PaxHeader`,mode:e.mode,uid:e.uid,gid:e.gid,size:t.byteLength,mtime:e.mtime,type:`pax-header`,linkname:e.linkname&&`PaxHeader`,uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(s.encode(n)),this.push(t),p(this,t.byteLength),n.size=e.size,n.type=e.type,this.push(s.encode(n))}_doDrain(){let e=this._drain;this._drain=f,e()}_predestroy(){let e=i(this);for(this._stream&&this._stream.destroy(e);this._pending.length;){let t=this._pending.shift();t.destroy(e),t._continueOpen()}this._doDrain()}_read(e){this._doDrain(),e()}};t.exports=function(e){return new u(e)};function d(e){switch(e&o.S_IFMT){case o.S_IFBLK:return`block-device`;case o.S_IFCHR:return`character-device`;case o.S_IFDIR:return`directory`;case o.S_IFIFO:return`fifo`;case o.S_IFLNK:return`symlink`}return`file`}function f(){}function p(e,t){t&=511,t&&e.push(c.subarray(0,512-t))}function m(e){return a.isBuffer(e)?e:a.from(e)}})),dN=U((e=>{e.extract=cN(),e.pack=uN()})),fN=U(((e,t)=>{ /** * TAR Format Plugin * @@ -124,7 +124,7 @@ var n=$M(),r=IM(),i=function(e){if(!(this instanceof i))return new i(e);e=this.o * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=W(`zlib`),r=pN(),i=IM(),a=function(e){if(!(this instanceof a))return new a(e);e=this.options=i.defaults(e,{gzip:!1}),typeof e.gzipOptions!=`object`&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=r.pack(e),this.compressor=!1,e.gzip&&(this.compressor=n.createGzip(e.gzipOptions),this.compressor.on(`error`,this._onCompressorError.bind(this)))};a.prototype._onCompressorError=function(e){this.engine.emit(`error`,e)},a.prototype.append=function(e,t,n){var r=this;t.mtime=t.date;function a(e,i){if(e){n(e);return}r.engine.entry(t,i,function(e){n(e,t)})}if(t.sourceType===`buffer`)a(null,e);else if(t.sourceType===`stream`&&t.stats){t.size=t.stats.size;var o=r.engine.entry(t,function(e){n(e,t)});e.pipe(o)}else t.sourceType===`stream`&&i.collectStream(e,a)},a.prototype.finalize=function(){this.engine.finalize()},a.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},a.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)},a.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)},t.exports=a})),hN=U(((e,t)=>{function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}let r=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function i(e){if(Buffer.isBuffer(e))return e;if(typeof e==`number`)return Buffer.alloc(e);if(typeof e==`string`)return Buffer.from(e);throw Error(`input must be buffer, number, or string, received `+typeof e)}function a(e){let t=i(4);return t.writeInt32BE(e,0),t}function o(e,t){e=i(e),Buffer.isBuffer(t)&&(t=t.readUInt32BE(0));let n=~~t^-1;for(var a=0;a>>8;return n^-1}function s(){return a(o.apply(null,arguments))}s.signed=function(){return o.apply(null,arguments)},s.unsigned=function(){return o.apply(null,arguments)>>>0},t.exports=n(s)})),gN=U(((e,t)=>{ +var n=W(`zlib`),r=dN(),i=PM(),a=function(e){if(!(this instanceof a))return new a(e);e=this.options=i.defaults(e,{gzip:!1}),typeof e.gzipOptions!=`object`&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=r.pack(e),this.compressor=!1,e.gzip&&(this.compressor=n.createGzip(e.gzipOptions),this.compressor.on(`error`,this._onCompressorError.bind(this)))};a.prototype._onCompressorError=function(e){this.engine.emit(`error`,e)},a.prototype.append=function(e,t,n){var r=this;t.mtime=t.date;function a(e,i){if(e){n(e);return}r.engine.entry(t,i,function(e){n(e,t)})}if(t.sourceType===`buffer`)a(null,e);else if(t.sourceType===`stream`&&t.stats){t.size=t.stats.size;var o=r.engine.entry(t,function(e){n(e,t)});e.pipe(o)}else t.sourceType===`stream`&&i.collectStream(e,a)},a.prototype.finalize=function(){this.engine.finalize()},a.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},a.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)},a.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)},t.exports=a})),pN=U(((e,t)=>{function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}let r=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function i(e){if(Buffer.isBuffer(e))return e;if(typeof e==`number`)return Buffer.alloc(e);if(typeof e==`string`)return Buffer.from(e);throw Error(`input must be buffer, number, or string, received `+typeof e)}function a(e){let t=i(4);return t.writeInt32BE(e,0),t}function o(e,t){e=i(e),Buffer.isBuffer(t)&&(t=t.readUInt32BE(0));let n=~~t^-1;for(var a=0;a>>8;return n^-1}function s(){return a(o.apply(null,arguments))}s.signed=function(){return o.apply(null,arguments)},s.unsigned=function(){return o.apply(null,arguments)>>>0},t.exports=n(s)})),mN=U(((e,t)=>{ /** * JSON Format Plugin * @@ -132,7 +132,7 @@ var n=W(`zlib`),r=pN(),i=IM(),a=function(e){if(!(this instanceof a))return new a * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=W(`util`).inherits,r=Sj().Transform,i=hN(),a=IM(),o=function(e){if(!(this instanceof o))return new o(e);e=this.options=a.defaults(e,{}),r.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};n(o,r),o.prototype._transform=function(e,t,n){n(null,e)},o.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)},o.prototype.append=function(e,t,n){var r=this;t.crc32=0;function o(e,a){if(e){n(e);return}t.size=a.length||0,t.crc32=i.unsigned(a),r.files.push(t),n(null,t)}t.sourceType===`buffer`?o(null,e):t.sourceType===`stream`&&a.collectStream(e,o)},o.prototype.finalize=function(){this._writeStringified(),this.end()},t.exports=o})),_N=U(((e,t)=>{ +var n=W(`util`).inherits,r=bj().Transform,i=pN(),a=PM(),o=function(e){if(!(this instanceof o))return new o(e);e=this.options=a.defaults(e,{}),r.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};n(o,r),o.prototype._transform=function(e,t,n){n(null,e)},o.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)},o.prototype.append=function(e,t,n){var r=this;t.crc32=0;function o(e,a){if(e){n(e);return}t.size=a.length||0,t.crc32=i.unsigned(a),r.files.push(t),n(null,t)}t.sourceType===`buffer`?o(null,e):t.sourceType===`stream`&&a.collectStream(e,o)},o.prototype.finalize=function(){this._writeStringified(),this.end()},t.exports=o})),hN=U(((e,t)=>{ /** * Archiver Vending * @@ -140,28 +140,28 @@ var n=W(`util`).inherits,r=Sj().Transform,i=hN(),a=IM(),o=function(e){if(!(this * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var n=RM(),r={},i=function(e,t){return i.create(e,t)};i.create=function(e,t){if(r[e]){var i=new n(e,t);return i.setFormat(e),i.setModule(new r[e](t)),i}else throw Error(`create(`+e+`): format not registered`)},i.registerFormat=function(e,t){if(r[e])throw Error(`register(`+e+`): format already registered`);if(typeof t!=`function`)throw Error(`register(`+e+`): format module invalid`);if(typeof t.prototype.append!=`function`||typeof t.prototype.finalize!=`function`)throw Error(`register(`+e+`): format module missing methods`);r[e]=t},i.isRegisteredFormat=function(e){return!!r[e]},i.registerFormat(`zip`,eN()),i.registerFormat(`tar`,mN()),i.registerFormat(`json`,gN()),t.exports=i})),vN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},yN=class extends z.Transform{constructor(e){super({highWaterMark:e})}_transform(e,t,n){n(null,e)}};function bN(e){return vN(this,void 0,void 0,function*(){G(`Creating raw file upload stream for: ${e}`);let t=DO(),n=new yN(t),r=e;(yield o.promises.lstat(e)).isSymbolicLink()&&(r=yield ie(e));let i=o.createReadStream(r,{highWaterMark:t});return i.on(`error`,e=>{kr(`An error has occurred while reading the file for upload`),kr(String(e)),n.destroy(Error(`An error has occurred during file read for the artifact`))}),i.pipe(n),n})}var xN=pe(_N(),1),SN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function CN(e){return SN(this,arguments,void 0,function*(e,t=6){G(`Creating Artifact archive with compressionLevel: ${t}`);let n=xN.default.create(`zip`,{highWaterMark:DO(),zlib:{level:t}});n.on(`error`,wN),n.on(`warning`,TN),n.on(`finish`,EN),n.on(`end`,DN);for(let t of e)if(t.sourcePath!==null){let e=t.sourcePath;t.stats.isSymbolicLink()&&(e=yield ie(t.sourcePath)),n.file(e,{name:t.destinationPath})}else n.append(``,{name:t.destinationPath});let r=new yN(DO());return G(`Zip write high watermark value ${r.writableHighWaterMark}`),G(`Zip read high watermark value ${r.readableHighWaterMark}`),n.pipe(r),n.finalize(),r})}const wN=e=>{throw kr(`An error has occurred while creating the zip file for upload`),jr(e),Error(`An error has occurred during zip creation for the artifact`)},TN=e=>{e.code===`ENOENT`?(Ar(`ENOENT warning during artifact zip creation. No such file or directory`),jr(e)):(Ar(`A non-blocking warning has occurred during artifact zip creation: ${e.code}`),jr(e))},EN=()=>{G(`Zip stream for upload has finished.`)},DN=()=>{G(`Zip stream for upload has ended.`)},ON={".txt":`text/plain`,".html":`text/html`,".htm":`text/html`,".css":`text/css`,".csv":`text/csv`,".xml":`text/xml`,".md":`text/markdown`,".js":`application/javascript`,".mjs":`application/javascript`,".json":`application/json`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".svg":`image/svg+xml`,".webp":`image/webp`,".ico":`image/x-icon`,".bmp":`image/bmp`,".tiff":`image/tiff`,".tif":`image/tiff`,".mp3":`audio/mpeg`,".wav":`audio/wav`,".ogg":`audio/ogg`,".flac":`audio/flac`,".mp4":`video/mp4`,".webm":`video/webm`,".avi":`video/x-msvideo`,".mov":`video/quicktime`,".pdf":`application/pdf`,".doc":`application/msword`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xls":`application/vnd.ms-excel`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".ppt":`application/vnd.ms-powerpoint`,".pptx":`application/vnd.openxmlformats-officedocument.presentationml.presentation`,".zip":`application/zip`,".tar":`application/x-tar`,".gz":`application/gzip`,".rar":`application/vnd.rar`,".7z":`application/x-7z-compressed`,".wasm":`application/wasm`,".yaml":`application/x-yaml`,".yml":`application/x-yaml`,".woff":`font/woff`,".woff2":`font/woff2`,".ttf":`font/ttf`,".otf":`font/otf`,".eot":`application/vnd.ms-fontobject`};function kN(e){return ON[f.extname(e).toLowerCase()]||`application/octet-stream`}var AN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function jN(e,t,n,r){return AN(this,void 0,void 0,function*(){let i=`${e}.zip`;if(r?.skipArchive){if(t.length===0)throw new ak([]);if(t.length>1)throw Error(`skipArchive option is only supported when uploading a single file`);if(!o.existsSync(t[0]))throw new ak(t);i=f.basename(t[0]),e=i}ek(e),Sk(n);let a=[];if(!r?.skipArchive&&(a=Ck(t,n),a.length===0))throw new ak(a.flatMap(e=>e.sourcePath?[e.sourcePath]:[]));let s=kN(i),c=gk(),l=xk(),u={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:e,mimeType:LO.create({value:s}),version:7},d=XO(r?.retentionDays);d&&(u.expiresAt=d);let p=yield l.CreateArtifact(u);if(!p.ok)throw new ok(`CreateArtifact: response from backend was not ok`);let m;m=r?.skipArchive?yield bN(t[0]):yield CN(a,r?.compressionLevel),jr(`Uploading artifact: ${i}`);let h=yield Tk(p.signedUploadUrl,m,s),g={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:e,size:h.uploadSize?h.uploadSize.toString():`0`};h.sha256Hash&&(g.hash=LO.create({value:`sha256:${h.sha256Hash}`})),jr(`Finalizing artifact upload`);let v=yield l.FinalizeArtifact(g);if(!v.ok)throw new ok(`FinalizeArtifact: response from backend was not ok`);let y=BigInt(v.artifactId);return jr(`Artifact ${e} successfully finalized. Artifact ID ${y}`),{size:h.uploadSize,digest:h.sha256Hash,id:Number(y)}})}var MN=U(((e,t)=>{t.exports=n;function n(e){if(!(this instanceof n))return new n(e);this.value=e}n.prototype.get=function(e){for(var t=this.value,n=0;n{var n=MN(),r=W(`events`).EventEmitter;t.exports=i;function i(e){var t=i.saw(e,{}),n=e.call(t.handlers,t);return n!==void 0&&(t.handlers=n),t.record(),t.chain()}i.light=function(e){var t=i.saw(e,{}),n=e.call(t.handlers,t);return n!==void 0&&(t.handlers=n),t.chain()},i.saw=function(e,t){var o=new r;return o.handlers=t,o.actions=[],o.chain=function(){var e=n(o.handlers).map(function(t){if(this.isRoot)return t;var n=this.path;typeof t==`function`&&this.update(function(){return o.actions.push({path:n,args:[].slice.call(arguments)}),e})});return process.nextTick(function(){o.emit(`begin`),o.next()}),e},o.pop=function(){return o.actions.shift()},o.next=function(){var e=o.pop();if(!e)o.emit(`end`);else if(!e.trap){var t=o.handlers;e.path.forEach(function(e){t=t[e]}),t.apply(o.handlers,e.args)}},o.nest=function(t){var n=[].slice.call(arguments,1),r=!0;if(typeof t==`boolean`){var r=t;t=n.shift()}var a=i.saw(e,{}),s=e.call(a.handlers,a);s!==void 0&&(a.handlers=s),o.step!==void 0&&a.record(),t.apply(a.chain(),n),r!==!1&&a.on(`end`,o.next)},o.record=function(){a(o)},[`trap`,`down`,`jump`].forEach(function(e){o[e]=function(){throw Error(`To use the trap, down and jump features, please call record() first to start recording actions.`)}}),o};function a(e){e.step=0,e.pop=function(){return e.actions[e.step++]},e.trap=function(t,n){var r=Array.isArray(t)?t:[t];e.actions.push({path:r,step:e.step,cb:n,trap:!0})},e.down=function(t){var n=(Array.isArray(t)?t:[t]).join(`/`),r=e.actions.slice(e.step).map(function(t){return t.trap&&t.step<=e.step?!1:t.path.join(`/`)==n}).indexOf(!0);r>=0?e.step+=r:e.step=e.actions.length;var i=e.actions[e.step-1];i&&i.trap?(e.step=i.step,i.cb()):e.next()},e.jump=function(t){e.step=t,e.next()}}})),PN=U(((e,t)=>{t.exports=n;function n(e){if(!(this instanceof n))return new n(e);this.buffers=e||[],this.length=this.buffers.reduce(function(e,t){return e+t.length},0)}n.prototype.push=function(){for(var e=0;e=0?e:this.length-e,a=[].slice.call(arguments,2);(t===void 0||t>this.length-i)&&(t=this.length-i);for(var e=0;e0){var l=i-s;if(l+t0){var p=a.slice();p.unshift(d),p.push(f),r.splice.apply(r,[c,1].concat(p)),c+=p.length,a=[]}else r.splice(c,1,d,f),c+=2}else o.push(r[c].slice(l)),r[c]=r[c].slice(0,l),c++}for(a.length>0&&(r.splice.apply(r,[c,0].concat(a)),c+=a.length);o.lengththis.length&&(t=this.length);for(var r=0,i=0;i=t-e?Math.min(l+(t-e)-o,c):c;n[s].copy(a,o,l,u),o+=u-l}return a},n.prototype.pos=function(e){if(e<0||e>=this.length)throw Error(`oob`);for(var t=e,n=0,r=null;;){if(r=this.buffers[n],t=this.buffers[n].length;)if(r=0,n++,n>=this.buffers.length)return-1;if(this.buffers[n][r]==e[i]){if(i==0&&(a={i:n,j:r,pos:o}),i++,i==e.length)return a.pos}else i!=0&&(n=a.i,r=a.j,o=a.pos,i=0);r++,o++}},n.prototype.toBuffer=function(){return this.slice()},n.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)}})),FN=U(((e,t)=>{t.exports=function(e){function t(e,t){var r=n.store,i=e.split(`.`);i.slice(0,-1).forEach(function(e){r[e]===void 0&&(r[e]={}),r=r[e]});var a=i[i.length-1];return arguments.length==1?r[a]:r[a]=t}var n={get:function(e){return t(e)},set:function(e,n){return t(e,n)},store:e||{}};return n}})),IN=U(((e,t)=>{var n=NN(),r=W(`events`).EventEmitter,i=PN(),a=FN(),o=W(`stream`).Stream;e=t.exports=function(t,n){if(Buffer.isBuffer(t))return e.parse(t);var r=e.stream();return t&&t.pipe?t.pipe(r):t&&(t.on(n||`data`,function(e){r.write(e)}),t.on(`end`,function(){r.end()})),r},e.stream=function(t){if(t)return e.apply(null,arguments);var s=null;function c(e,t,n){s={bytes:e,skip:n,cb:function(e){s=null,t(e)}},u()}var l=null;function u(){if(!s){v&&(g=!0);return}if(typeof s==`function`)s();else{var e=l+s.bytes;if(m.length>=e){var t;l==null?(t=m.splice(0,e),s.skip||(t=t.slice())):(s.skip||(t=m.slice(l,e)),l=e),s.skip?s.cb():s.cb(t)}}}function f(e){function t(){g||e.next()}var n=d(function(e,n){return function(r){c(e,function(e){h.set(r,n(e)),t()})}});return n.tap=function(t){e.nest(t,h.store)},n.into=function(t,n){h.get(t)||h.set(t,{});var r=h;h=a(r.get(t)),e.nest(function(){n.apply(this,arguments),this.tap(function(){h=r})},h.store)},n.flush=function(){h.store={},t()},n.loop=function(n){var r=!1;e.nest(!1,function i(){this.vars=h.store,n.call(this,function(){r=!0,t()},h.store),this.tap(function(){r?e.next():i.call(this)}.bind(this))},h.store)},n.buffer=function(e,n){typeof n==`string`&&(n=h.get(n)),c(n,function(n){h.set(e,n),t()})},n.skip=function(e){typeof e==`string`&&(e=h.get(e)),c(e,function(){t()})},n.scan=function(e,n){if(typeof n==`string`)n=new Buffer(n);else if(!Buffer.isBuffer(n))throw Error(`search must be a Buffer or a string`);var r=0;s=function(){var i=m.indexOf(n,l+r),a=i-l-r;i===-1?a=Math.max(m.length-n.length-l-r,0):(s=null,l==null?(h.set(e,m.slice(0,r+a)),m.splice(0,r+a+n.length)):(h.set(e,m.slice(l,l+r+a)),l+=r+a+n.length),t(),u()),r+=a},u()},n.peek=function(t){l=0,e.nest(function(){t.call(this,h.store),this.tap(function(){l=null})})},n}var p=n.light(f);p.writable=!0;var m=i();p.write=function(e){m.push(e),u()};var h=a(),g=!1,v=!1;return p.end=function(){v=!0},p.pipe=o.prototype.pipe,Object.getOwnPropertyNames(r.prototype).forEach(function(e){p[e]=r.prototype[e]}),p},e.parse=function(e){var t=d(function(i,a){return function(o){if(n+i<=e.length){var s=e.slice(n,n+i);n+=i,r.set(o,a(s))}else r.set(o,null);return t}}),n=0,r=a();return t.vars=r.store,t.tap=function(e){return e.call(t,r.store),t},t.into=function(e,n){r.get(e)||r.set(e,{});var i=r;return r=a(i.get(e)),n.call(t,r.store),r=i,t},t.loop=function(e){for(var n=!1,i=function(){n=!0};n===!1;)e.call(t,i,r.store);return t},t.buffer=function(i,a){typeof a==`string`&&(a=r.get(a));var o=e.slice(n,Math.min(e.length,n+a));return n+=a,r.set(i,o),t},t.skip=function(e){return typeof e==`string`&&(e=r.get(e)),n+=e,t},t.scan=function(i,a){if(typeof a==`string`)a=new Buffer(a);else if(!Buffer.isBuffer(a))throw Error(`search must be a Buffer or a string`);r.set(i,null);for(var o=0;o+n<=e.length-a.length+1;o++){for(var s=0;s=e.length},t};function s(e){for(var t=0,n=0;n{var n=W(`stream`).Transform,r=W(`util`);function i(e,t){if(!(this instanceof i))return new i;n.call(this);var r=typeof e==`object`?e.pattern:e;this.pattern=Buffer.isBuffer(r)?r:Buffer.from(r),this.requiredLength=this.pattern.length,e.requiredExtraSize&&(this.requiredLength+=e.requiredExtraSize),this.data=new Buffer(``),this.bytesSoFar=0,this.matchFn=t}r.inherits(i,n),i.prototype.checkDataChunk=function(e){if(this.data.length>=this.requiredLength){var t=this.data.indexOf(this.pattern,e?1:0);if(t>=0&&t+this.requiredLength>this.data.length){if(t>0){var n=this.data.slice(0,t);this.push(n),this.bytesSoFar+=t,this.data=this.data.slice(t)}return}if(t===-1){var r=this.data.length-this.requiredLength+1,n=this.data.slice(0,r);this.push(n),this.bytesSoFar+=r,this.data=this.data.slice(r);return}if(t>0){var n=this.data.slice(0,t);this.data=this.data.slice(t),this.push(n),this.bytesSoFar+=t}if(!this.matchFn||this.matchFn(this.data,this.bytesSoFar)){this.data=new Buffer(``);return}return!0}},i.prototype._transform=function(e,t,n){this.data=Buffer.concat([this.data,e]);for(var r=!0;this.checkDataChunk(!r);)r=!1;n()},i.prototype._flush=function(e){if(this.data.length>0)for(var t=!0;this.checkDataChunk(!t);)t=!1;this.data.length>0&&(this.push(this.data),this.data=null),e()},t.exports=i})),RN=U(((e,t)=>{var n=W(`stream`),r=W(`util`).inherits;function i(){if(!(this instanceof i))return new i;n.PassThrough.call(this),this.path=null,this.type=null,this.isDirectory=!1}r(i,n.PassThrough),i.prototype.autodrain=function(){return this.pipe(new n.Transform({transform:function(e,t,n){n()}}))},t.exports=i})),zN=U(((e,t)=>{var n=IN(),r=W(`stream`),i=W(`util`),a=W(`zlib`),o=LN(),s=RN();let c={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99},l=4294967296;function u(e){if(!(this instanceof u))return new u(e);r.Transform.call(this),this.options=e||{},this.data=new Buffer(``),this.state=c.STREAM_START,this.skippedBytes=0,this.parsedEntity=null,this.outStreamInfo={}}i.inherits(u,r.Transform),u.prototype.processDataChunk=function(e){var t;switch(this.state){case c.STREAM_START:case c.START:t=4;break;case c.LOCAL_FILE_HEADER:t=26;break;case c.LOCAL_FILE_HEADER_SUFFIX:t=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case c.DATA_DESCRIPTOR:t=12;break;case c.CENTRAL_DIRECTORY_FILE_HEADER:t=42;break;case c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:t=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case c.CDIR64_END:t=52;break;case c.CDIR64_END_DATA_SECTOR:t=this.parsedEntity.centralDirectoryRecordSize-44;break;case c.CDIR64_LOCATOR:t=16;break;case c.CENTRAL_DIRECTORY_END:t=18;break;case c.CENTRAL_DIRECTORY_END_COMMENT:t=this.parsedEntity.commentLength;break;case c.FILE_DATA:return 0;case c.FILE_DATA_END:return 0;case c.TRAILING_JUNK:return this.options.debug&&console.log(`found`,e.length,`bytes of TRAILING_JUNK`),e.length;default:return e.length}if(e.length>>=8,(i&255)==80){a=o;break}return this.skippedBytes+=a,this.options.debug&&console.log(`Skipped`,this.skippedBytes,`bytes`),a}this.state=c.ERROR;var u=r?`Not a valid zip file`:`Invalid signature in zip file`;if(this.options.debug){var d=e.readUInt32LE(0),f;try{f=e.slice(0,4).toString()}catch{}console.log(`Unexpected signature in zip file: 0x`+d.toString(16),`"`+f+`", skipped`,this.skippedBytes,`bytes`)}return this.emit(`error`,Error(u)),e.length}return this.skippedBytes=0,t;case c.LOCAL_FILE_HEADER:return this.parsedEntity=this._readFile(e),this.state=c.LOCAL_FILE_HEADER_SUFFIX,t;case c.LOCAL_FILE_HEADER_SUFFIX:var p=new s,m=(this.parsedEntity.flags&2048)!=0;p.path=this._decodeString(e.slice(0,this.parsedEntity.fileNameLength),m);var h=e.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),g=this._readExtraFields(h);if(g&&g.parsed&&(g.parsed.path&&!m&&(p.path=g.parsed.path),Number.isFinite(g.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===l-1&&(this.parsedEntity.uncompressedSize=g.parsed.uncompressedSize),Number.isFinite(g.parsed.compressedSize)&&this.parsedEntity.compressedSize===l-1&&(this.parsedEntity.compressedSize=g.parsed.compressedSize)),this.parsedEntity.extra=g.parsed||{},this.options.debug){let e=Object.assign({},this.parsedEntity,{path:p.path,flags:`0x`+this.parsedEntity.flags.toString(16),extraFields:g&&g.debug});console.log(`decoded LOCAL_FILE_HEADER:`,JSON.stringify(e,null,2))}return this._prepareOutStream(this.parsedEntity,p),this.emit(`entry`,p),this.state=c.FILE_DATA,t;case c.CENTRAL_DIRECTORY_FILE_HEADER:return this.parsedEntity=this._readCentralDirectoryEntry(e),this.state=c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX,t;case c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var m=(this.parsedEntity.flags&2048)!=0,v=this._decodeString(e.slice(0,this.parsedEntity.fileNameLength),m),h=e.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),g=this._readExtraFields(h);g&&g.parsed&&g.parsed.path&&!m&&(v=g.parsed.path),this.parsedEntity.extra=g.parsed;var y=(this.parsedEntity.versionMadeBy&65280)>>8==3,b,x;if(y&&(b=this.parsedEntity.externalFileAttributes>>>16,x=(b>>>12&10)==10),this.options.debug){let e=Object.assign({},this.parsedEntity,{path:v,flags:`0x`+this.parsedEntity.flags.toString(16),unixAttrs:b&&`0`+b.toString(8),isSymlink:x,extraFields:g.debug});console.log(`decoded CENTRAL_DIRECTORY_FILE_HEADER:`,JSON.stringify(e,null,2))}return this.state=c.START,t;case c.CDIR64_END:return this.parsedEntity=this._readEndOfCentralDirectory64(e),this.options.debug&&console.log(`decoded CDIR64_END_RECORD:`,this.parsedEntity),this.state=c.CDIR64_END_DATA_SECTOR,t;case c.CDIR64_END_DATA_SECTOR:return this.state=c.START,t;case c.CDIR64_LOCATOR:return this.state=c.START,t;case c.CENTRAL_DIRECTORY_END:return this.parsedEntity=this._readEndOfCentralDirectory(e),this.options.debug&&console.log(`decoded CENTRAL_DIRECTORY_END:`,this.parsedEntity),this.state=c.CENTRAL_DIRECTORY_END_COMMENT,t;case c.CENTRAL_DIRECTORY_END_COMMENT:return this.options.debug&&console.log(`decoded CENTRAL_DIRECTORY_END_COMMENT:`,e.slice(0,t).toString()),this.state=c.TRAILING_JUNK,t;case c.ERROR:return e.length;default:return console.log(`didn't handle state #`,this.state,`discarding`),e.length}},u.prototype._prepareOutStream=function(e,t){var n=this,i=e.uncompressedSize===0&&/[\/\\]$/.test(t.path);t.path=t.path.replace(/(?<=^|[/\\]+)[.][.]+(?=[/\\]+|$)/g,`.`),t.type=i?`Directory`:`File`,t.isDirectory=i;var u=!(e.flags&8);u&&(t.size=e.uncompressedSize);var d=e.versionsNeededToExtract<=45;if(this.outStreamInfo={stream:null,limit:u?e.compressedSize:-1,written:0},u)this.outStreamInfo.stream=new r.PassThrough;else{var f=new Buffer(4);f.writeUInt32LE(134695760,0);var p=e.extra.zip64Mode,m=new o({pattern:f,requiredExtraSize:p?20:12},function(e,t){var r=n._readDataDescriptor(e,p),i=r.compressedSize===t;if(!p&&!i&&t>=l)for(var a=t-l;a>=0&&(i=r.compressedSize===a,!i);)a-=l;if(i){n.state=c.FILE_DATA_END;var o=p?24:16;return n.data.length>0?n.data=Buffer.concat([e.slice(o),n.data]):n.data=e.slice(o),!0}});this.outStreamInfo.stream=m}var h=e.flags&1||e.flags&64;if(h||!d){var g=h?`Encrypted files are not supported!`:`Zip version `+Math.floor(e.versionsNeededToExtract/10)+`.`+e.versionsNeededToExtract%10+` is not supported`;t.skip=!0,setImmediate(()=>{n.emit(`error`,Error(g))}),this.outStreamInfo.stream.pipe(new s().autodrain());return}if(e.compressionMethod>0){var v=a.createInflateRaw();v.on(`error`,function(e){n.state=c.ERROR,n.emit(`error`,e)}),this.outStreamInfo.stream.pipe(v).pipe(t)}else this.outStreamInfo.stream.pipe(t);this._drainAllEntries&&t.autodrain()},u.prototype._readFile=function(e){return n.parse(e).word16lu(`versionsNeededToExtract`).word16lu(`flags`).word16lu(`compressionMethod`).word16lu(`lastModifiedTime`).word16lu(`lastModifiedDate`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).word16lu(`fileNameLength`).word16lu(`extraFieldLength`).vars},u.prototype._readExtraFields=function(e){var t={},r={parsed:t};this.options.debug&&(r.debug=[]);for(var i=0;i=l+4&&c&1&&(t.mtime=new Date(e.readUInt32LE(i+l)*1e3),l+=4),a.extraSize>=l+4&&c&2&&(t.atime=new Date(e.readUInt32LE(i+l)*1e3),l+=4),a.extraSize>=l+4&&c&4&&(t.ctime=new Date(e.readUInt32LE(i+l)*1e3));break;case 28789:if(o=`Info-ZIP Unicode Path Extra Field`,e.readUInt8(i)===1){var l=1;e.readUInt32LE(i+l),l+=4,t.path=e.slice(i+l).toString()}break;case 13:case 22613:o=a.extraId===13?`PKWARE Unix`:`Info-ZIP UNIX (type 1)`;var l=0;if(a.extraSize>=8){var u=new Date(e.readUInt32LE(i+l)*1e3);l+=4;var d=new Date(e.readUInt32LE(i+l)*1e3);if(l+=4,t.atime=u,t.mtime=d,a.extraSize>=12){var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);l+=2,t.uid=f,t.gid=p}}break;case 30805:o=`Info-ZIP UNIX (type 2)`;var l=0;if(a.extraSize>=4){var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);l+=2,t.uid=f,t.gid=p}break;case 30837:o=`Info-ZIP New Unix`;var l=0,m=e.readUInt8(i);if(l+=1,m===1){var h=e.readUInt8(i+l);l+=1,h<=6&&(t.uid=e.readUIntLE(i+l,h)),l+=h;var g=e.readUInt8(i+l);l+=1,g<=6&&(t.gid=e.readUIntLE(i+l,g))}break;case 30062:o=`ASi Unix`;var l=0;if(a.extraSize>=14){e.readUInt32LE(i+l),l+=4;var v=e.readUInt16LE(i+l);l+=2,e.readUInt32LE(i+l),l+=4;var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);if(l+=2,t.mode=v,t.uid=f,t.gid=p,a.extraSize>14){var y=i+l,b=i+a.extraSize-14;t.symlink=this._decodeString(e.slice(y,b))}}break}this.options.debug&&r.debug.push({extraId:`0x`+a.extraId.toString(16),description:o,data:e.slice(i,i+a.extraSize).inspect()}),i+=a.extraSize}return r},u.prototype._readDataDescriptor=function(e,t){if(t){var r=n.parse(e).word32lu(`dataDescriptorSignature`).word32lu(`crc32`).word64lu(`compressedSize`).word64lu(`uncompressedSize`).vars;return r}var r=n.parse(e).word32lu(`dataDescriptorSignature`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).vars;return r},u.prototype._readCentralDirectoryEntry=function(e){return n.parse(e).word16lu(`versionMadeBy`).word16lu(`versionsNeededToExtract`).word16lu(`flags`).word16lu(`compressionMethod`).word16lu(`lastModifiedTime`).word16lu(`lastModifiedDate`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).word16lu(`fileNameLength`).word16lu(`extraFieldLength`).word16lu(`fileCommentLength`).word16lu(`diskNumber`).word16lu(`internalFileAttributes`).word32lu(`externalFileAttributes`).word32lu(`offsetToLocalFileHeader`).vars},u.prototype._readEndOfCentralDirectory64=function(e){return n.parse(e).word64lu(`centralDirectoryRecordSize`).word16lu(`versionMadeBy`).word16lu(`versionsNeededToExtract`).word32lu(`diskNumber`).word32lu(`diskNumberWithCentralDirectoryStart`).word64lu(`centralDirectoryEntries`).word64lu(`totalCentralDirectoryEntries`).word64lu(`sizeOfCentralDirectory`).word64lu(`offsetToStartOfCentralDirectory`).vars},u.prototype._readEndOfCentralDirectory=function(e){return n.parse(e).word16lu(`diskNumber`).word16lu(`diskStart`).word16lu(`centralDirectoryEntries`).word16lu(`totalCentralDirectoryEntries`).word32lu(`sizeOfCentralDirectory`).word32lu(`offsetToStartOfCentralDirectory`).word16lu(`commentLength`).vars},u.prototype._decodeString=function(e,t){if(t)return e.toString(`utf8`);if(this.options.decodeString)return this.options.decodeString(e);let n=``;for(var r=0;r?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `[e[r]];return n},u.prototype._parseOrOutput=function(e,t){for(var n;(n=this.processDataChunk(this.data))>0&&(this.data=this.data.slice(n),this.data.length!==0););if(this.state===c.FILE_DATA){if(this.outStreamInfo.limit>=0){var r=this.outStreamInfo.limit-this.outStreamInfo.written,i;r{if(this.state===c.FILE_DATA_END)return this.state=c.START,a.end(t);t()})}return}t()},u.prototype.drainAll=function(){this._drainAllEntries=!0},u.prototype._transform=function(e,t,n){var r=this;r.data.length>0?r.data=Buffer.concat([r.data,e]):r.data=e;var i=r.data.length,a=function(){if(r.data.length>0&&r.data.length0){t._parseOrOutput(`buffer`,function(){if(t.data.length>0)return setImmediate(function(){t._flush(e)});e()});return}if(t.state===c.FILE_DATA)return e(Error(`Stream finished in an invalid state, uncompression failed`));setImmediate(e)},t.exports=u})),BN=U(((e,t)=>{var n=W(`stream`).Transform,r=W(`util`),i=zN();function a(e){if(!(this instanceof a))return new a(e);n.call(this,{readableObjectMode:!0}),this.opts=e||{},this.unzipStream=new i(this.opts);var t=this;this.unzipStream.on(`entry`,function(e){t.push(e)}),this.unzipStream.on(`error`,function(e){t.emit(`error`,e)})}r.inherits(a,n),a.prototype._transform=function(e,t,n){this.unzipStream.write(e,t,n)},a.prototype._flush=function(e){var t=this;this.unzipStream.end(function(){process.nextTick(function(){t.emit(`close`)}),e()})},a.prototype.on=function(e,t){return e===`entry`?n.prototype.on.call(this,`data`,t):n.prototype.on.call(this,e,t)},a.prototype.drainAll=function(){return this.unzipStream.drainAll(),this.pipe(new n({objectMode:!0,transform:function(e,t,n){n()}}))},t.exports=a})),VN=U(((e,t)=>{var n=W(`path`),r=W(`fs`),i=511;t.exports=a.mkdirp=a.mkdirP=a;function a(e,t,o,s){typeof t==`function`?(o=t,t={}):(!t||typeof t!=`object`)&&(t={mode:t});var c=t.mode,l=t.fs||r;c===void 0&&(c=i),s||=null;var u=o||function(){};e=n.resolve(e),l.mkdir(e,c,function(r){if(!r)return s||=e,u(null,s);switch(r.code){case`ENOENT`:if(n.dirname(e)===e)return u(r);a(n.dirname(e),t,function(n,r){n?u(n,r):a(e,t,u,r)});break;default:l.stat(e,function(e,t){e||!t.isDirectory()?u(r,s):u(null,s)});break}})}a.sync=function e(t,a,o){(!a||typeof a!=`object`)&&(a={mode:a});var s=a.mode,c=a.fs||r;s===void 0&&(s=i),o||=null,t=n.resolve(t);try{c.mkdirSync(t,s),o||=t}catch(r){switch(r.code){case`ENOENT`:o=e(n.dirname(t),a,o),e(t,a,o);break;default:var l;try{l=c.statSync(t)}catch{throw r}if(!l.isDirectory())throw r;break}}return o}})),HN=U(((e,t)=>{var n=W(`fs`),r=W(`path`),i=W(`util`),a=VN(),o=W(`stream`).Transform,s=zN();function c(e){if(!(this instanceof c))return new c(e);o.call(this),this.opts=e||{},this.unzipStream=new s(this.opts),this.unfinishedEntries=0,this.afterFlushWait=!1,this.createdDirectories={};var t=this;this.unzipStream.on(`entry`,this._processEntry.bind(this)),this.unzipStream.on(`error`,function(e){t.emit(`error`,e)})}i.inherits(c,o),c.prototype._transform=function(e,t,n){this.unzipStream.write(e,t,n)},c.prototype._flush=function(e){var t=this,n=function(){process.nextTick(function(){t.emit(`close`)}),e()};this.unzipStream.end(function(){if(t.unfinishedEntries>0)return t.afterFlushWait=!0,t.on(`await-finished`,n);n()})},c.prototype._processEntry=function(e){var t=this,i=r.join(this.opts.path,e.path),o=e.isDirectory?i:r.dirname(i);this.unfinishedEntries++;var s=function(){var r=n.createWriteStream(i);r.on(`close`,function(){t.unfinishedEntries--,t._notifyAwaiter()}),r.on(`error`,function(e){t.emit(`error`,e)}),e.pipe(r)};if(this.createdDirectories[o]||o===`.`)return s();a(o,function(n){if(n)return t.emit(`error`,n);if(t.createdDirectories[o]=!0,e.isDirectory){t.unfinishedEntries--,t._notifyAwaiter();return}s()})},c.prototype._notifyAwaiter=function(){this.afterFlushWait&&this.unfinishedEntries===0&&(this.emit(`await-finished`),this.afterFlushWait=!1)},t.exports=c})),UN=pe(U((e=>{e.Parse=BN(),e.Extract=HN()}))(),1),WN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const GN=e=>{let t=new URL(e);return t.search=``,t.toString()};function KN(e){return WN(this,void 0,void 0,function*(){try{return yield re.access(e),!0}catch(e){if(e.code===`ENOENT`)return!1;throw e}})}function qN(e,t,n){return WN(this,void 0,void 0,function*(){let r=0;for(;r<5;)try{return yield JN(e,t,{skipDecompress:n})}catch(e){r++,G(`Failed to download artifact after ${r} retries due to ${e.message}. Retrying in 5 seconds...`),yield new Promise(e=>setTimeout(e,5e3))}throw Error(`Artifact download failed after ${r} retries.`)})}function JN(e,t){return WN(this,arguments,void 0,function*(e,t,n={}){let{timeout:r=30*1e3,skipDecompress:i=!1}=n,s=yield new On(ik()).get(e);if(s.message.statusCode!==200)throw Error(`Unexpected HTTP response from blob storage: ${s.message.statusCode} ${s.message.statusMessage}`);let c=s.message.headers[`content-type`]||``,l=c.split(`;`,1)[0].trim().toLowerCase(),u=new URL(e).pathname.toLowerCase().endsWith(`.zip`),d=l===`application/zip`||l===`application/x-zip-compressed`||l===`application/zip-compressed`||u,p=s.message.headers[`content-disposition`]||``,m=`artifact`,h=p.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i),g=p.match(/(?{let c=setTimeout(()=>{let e=Error(`Blob storage chunk did not respond in ${r}ms`);s.message.destroy(e),n(e)},r),l=e=>{G(`response.message: Artifact download failed: ${e.message}`),clearTimeout(c),n(e)},u=a.createHash(`sha256`).setEncoding(`hex`),p=new z.PassThrough().on(`data`,()=>{c.refresh()}).on(`error`,l);s.message.pipe(p),p.pipe(u);let h=()=>{clearTimeout(c),u&&(u.end(),y=u.read(),jr(`SHA256 digest of downloaded artifact is ${y}`)),e({sha256Digest:`sha256:${y}`})};if(d&&!i)p.pipe(UN.Extract({path:t})).on(`close`,h).on(`error`,l);else{let e=f.join(t,m),n=o.createWriteStream(e);jr(`Downloading raw file (non-zip) to: ${e}`),p.pipe(n).on(`close`,h).on(`error`,l)}})})}function YN(e,t,n,r,i){return WN(this,void 0,void 0,function*(){let a=yield ZN(i?.path),o=_o(r),s=!1;jr(`Downloading artifact '${e}' from '${t}/${n}'`);let{headers:c,status:l}=yield o.rest.actions.downloadArtifact({owner:t,repo:n,artifact_id:e,archive_format:`zip`,request:{redirect:`manual`}});if(l!==302)throw Error(`Unable to download artifact. Unexpected status: ${l}`);let{location:u}=c;if(!u)throw Error(`Unable to redirect to artifact download url`);jr(`Redirecting to blob download url: ${GN(u)}`);try{jr(`Starting download of artifact to: ${a}`);let e=yield qN(u,a,i?.skipDecompress);jr(`Artifact download completed successfully.`),i?.expectedHash&&i?.expectedHash!==e.sha256Digest&&(s=!0,G(`Computed digest: ${e.sha256Digest}`),G(`Expected digest: ${i.expectedHash}`))}catch(e){throw Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:a,digestMismatch:s}})}function XN(e,t){return WN(this,void 0,void 0,function*(){let n=yield ZN(t?.path),r=xk(),i=!1,{workflowRunBackendId:a,workflowJobRunBackendId:o}=gk(),s={workflowRunBackendId:a,workflowJobRunBackendId:o,idFilter:IO.create({value:e.toString()})},{artifacts:c}=yield r.ListArtifacts(s);if(c.length===0)throw new sk(`No artifacts found for ID: ${e}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`);c.length>1&&Ar(`Multiple artifacts found, defaulting to first.`);let l={workflowRunBackendId:c[0].workflowRunBackendId,workflowJobRunBackendId:c[0].workflowJobRunBackendId,name:c[0].name},{signedUrl:u}=yield r.GetSignedArtifactURL(l);jr(`Redirecting to blob download url: ${GN(u)}`);try{jr(`Starting download of artifact to: ${n}`);let e=yield qN(u,n,t?.skipDecompress);jr(`Artifact download completed successfully.`),t?.expectedHash&&t?.expectedHash!==e.sha256Digest&&(i=!0,G(`Computed digest: ${e.sha256Digest}`),G(`Expected digest: ${t.expectedHash}`))}catch(e){throw Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:n,digestMismatch:i}})}function ZN(){return WN(this,arguments,void 0,function*(e=jO()){return(yield KN(e))?G(`Artifact destination folder already exists: ${e}`):(G(`Artifact destination folder does not exist, creating: ${e}`),yield re.mkdir(e,{recursive:!0})),e})}const QN=[400,401,403,404,422];function $N(e,t=5,n=QN){if(t<=0)return[{enabled:!1},e.request];let r={enabled:!0};n.length>0&&(r.doNotRetry=n);let i=Object.assign(Object.assign({},e.request),{retries:t});return G(`GitHub client configured with: (retries: ${i.retries}, retry-exempt-status-code: ${r.doNotRetry??`octokit default: [400, 401, 403, 404, 422]`})`),[r,i]}function eP(e){e.hook.wrap(`request`,(t,n)=>{e.log.debug(`request`,n);let r=Date.now(),i=e.request.endpoint.parse(n),a=i.url.replace(n.baseUrl,``);return t(n).then(t=>{let n=t.headers[`x-github-request-id`];return e.log.info(`${i.method} ${a} - ${t.status} with id ${n} in ${Date.now()-r}ms`),t}).catch(t=>{let n=t.response?.headers[`x-github-request-id`]||`UNKNOWN`;throw e.log.error(`${i.method} ${a} - ${t.status} with id ${n} in ${Date.now()-r}ms`),t})})}eP.VERSION=`6.0.0`;var tP=pe(U(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Bottleneck=r()})(e,(function(){var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function t(e){return e&&e.default||e}var n={load:function(e,t,n={}){var r,i;for(r in t)i=t[r],n[r]=e[r]??i;return n},overwrite:function(e,t,n={}){var r,i;for(r in e)i=e[r],t[r]!==void 0&&(n[r]=i);return n}},r=class{constructor(e,t){this.incr=e,this.decr=t,this._first=null,this._last=null,this.length=0}push(e){var t;this.length++,typeof this.incr==`function`&&this.incr(),t={value:e,prev:this._last,next:null},this._last==null?this._first=this._last=t:(this._last.next=t,this._last=t)}shift(){var e;if(this._first!=null)return this.length--,typeof this.decr==`function`&&this.decr(),e=this._first.value,(this._first=this._first.next)==null?this._last=null:this._first.prev=null,e}first(){if(this._first!=null)return this._first.value}getArray(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,t.value));return n}forEachShift(e){for(var t=this.shift();t!=null;)e(t),t=this.shift()}debug(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,{value:t.value,prev:t.prev?.value,next:t.next?.value}));return n}},i=class{constructor(e){if(this.instance=e,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw Error(`An Emitter already exists for this object`);this.instance.on=(e,t)=>this._addListener(e,`many`,t),this.instance.once=(e,t)=>this._addListener(e,`once`,t),this.instance.removeAllListeners=(e=null)=>e==null?this._events={}:delete this._events[e]}_addListener(e,t,n){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push({cb:n,status:t}),this.instance}listenerCount(e){return this._events[e]==null?0:this._events[e].length}async trigger(e,...t){var n,r;try{return e!==`debug`&&this.trigger(`debug`,`Event triggered: ${e}`,t),this._events[e]==null?void 0:(this._events[e]=this._events[e].filter(function(e){return e.status!==`none`}),r=this._events[e].map(async e=>{var n,r;if(e.status!==`none`){e.status===`once`&&(e.status=`none`);try{return r=typeof e.cb==`function`?e.cb(...t):void 0,typeof r?.then==`function`?await r:r}catch(e){return n=e,this.trigger(`error`,n),null}}}),(await Promise.all(r)).find(function(e){return e!=null}))}catch(e){return n=e,this.trigger(`error`,n),null}}},a=r,o=i,s=class{constructor(e){this.Events=new o(this),this._length=0,this._lists=(function(){var t,n,r=[];for(t=1,n=e;1<=n?t<=n:t>=n;1<=n?++t:--t)r.push(new a((()=>this.incr()),(()=>this.decr())));return r}).call(this)}incr(){if(this._length++===0)return this.Events.trigger(`leftzero`)}decr(){if(--this._length===0)return this.Events.trigger(`zero`)}push(e){return this._lists[e.options.priority].push(e)}queued(e){return e==null?this._length:this._lists[e].length}shiftAll(e){return this._lists.forEach(function(t){return t.forEachShift(e)})}getFirst(e=this._lists){var t,n,r;for(t=0,n=e.length;t0)return r;return[]}shiftLastFrom(e){return this.getFirst(this._lists.slice(e).reverse()).shift()}},c=class extends Error{},l,u,d,f=10,p;u=5,p=n,l=c,d=class{constructor(e,t,n,r,i,a,o,s){this.task=e,this.args=t,this.rejectOnDrop=i,this.Events=a,this._states=o,this.Promise=s,this.options=p.load(n,r),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===r.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise((e,t)=>{this._resolve=e,this._reject=t}),this.retryCount=0}_sanitizePriority(e){var t=~~e===e?e:u;return t<0?0:t>f-1?f-1:t}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:e,message:t=`This job has been dropped by Bottleneck`}={}){return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(e??new l(t)),this.Events.trigger(`dropped`,{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}_assertStatus(e){var t=this._states.jobStatus(this.options.id);if(!(t===e||e===`DONE`&&t===null))throw new l(`Invalid job status ${t}, expected ${e}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger(`received`,{args:this.args,options:this.options})}doQueue(e,t){return this._assertStatus(`RECEIVED`),this._states.next(this.options.id),this.Events.trigger(`queued`,{args:this.args,options:this.options,reachedHWM:e,blocked:t})}doRun(){return this.retryCount===0?(this._assertStatus(`QUEUED`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),this.Events.trigger(`scheduled`,{args:this.args,options:this.options})}async doExecute(e,t,n,r){var i,a,o;this.retryCount===0?(this._assertStatus(`RUNNING`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),a={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger(`executing`,a);try{if(o=await(e==null?this.task(...this.args):e.schedule(this.options,this.task,...this.args)),t())return this.doDone(a),await r(this.options,a),this._assertStatus(`DONE`),this._resolve(o)}catch(e){return i=e,this._onFailure(i,a,t,n,r)}}doExpire(e,t,n){var r,i;return this._states.jobStatus(this.options.id===`RUNNING`)&&this._states.next(this.options.id),this._assertStatus(`EXECUTING`),i={args:this.args,options:this.options,retryCount:this.retryCount},r=new l(`This job timed out after ${this.options.expiration} ms.`),this._onFailure(r,i,e,t,n)}async _onFailure(e,t,n,r,i){var a,o;if(n())return a=await this.Events.trigger(`failed`,e,t),a==null?(this.doDone(t),await i(this.options,t),this._assertStatus(`DONE`),this._reject(e)):(o=~~a,this.Events.trigger(`retry`,`Retrying ${this.options.id} after ${o} ms`,t),this.retryCount++,r(o))}doDone(e){return this._assertStatus(`EXECUTING`),this._states.next(this.options.id),this.Events.trigger(`done`,e)}};var m=d,h,g,v=n;h=c,g=class{constructor(e,t,n){this.instance=e,this.storeOptions=t,this.clientId=this.instance._randomIndex(),v.load(n,n,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var e;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(e=this.heartbeat=setInterval(()=>{var e,t,n,r=Date.now(),i;if(this.storeOptions.reservoirRefreshInterval!=null&&r>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=r,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),this.storeOptions.reservoirIncreaseInterval!=null&&r>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&({reservoirIncreaseAmount:e,reservoirIncreaseMaximum:n,reservoir:i}=this.storeOptions,this._lastReservoirIncrease=r,t=n==null?e:Math.min(e,n-i),t>0))return this.storeOptions.reservoir+=t,this.instance._drainAll(this.computeCapacity())},this.heartbeatInterval)).unref==`function`?e.unref():void 0:clearInterval(this.heartbeat)}async __publish__(e){return await this.yieldLoop(),this.instance.Events.trigger(`message`,e.toString())}async __disconnect__(e){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(e=0){return new this.Promise(function(t,n){return setTimeout(t,e)})}computePenalty(){return this.storeOptions.penalty??(15*this.storeOptions.minTime||5e3)}async __updateSettings__(e){return await this.yieldLoop(),v.overwrite(e,e,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(e){return await this.yieldLoop(),this._nextRequest+this.timeout=e}check(e,t){return this.conditionsCheck(e)&&this._nextRequest-t<=0}async __check__(e){var t;return await this.yieldLoop(),t=Date.now(),this.check(e,t)}async __register__(e,t,n){var r,i;return await this.yieldLoop(),r=Date.now(),this.conditionsCheck(t)?(this._running+=t,this.storeOptions.reservoir!=null&&(this.storeOptions.reservoir-=t),i=Math.max(this._nextRequest-r,0),this._nextRequest=r+i+this.storeOptions.minTime,{success:!0,wait:i,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(e,t){var n,r,i;if(await this.yieldLoop(),this.storeOptions.maxConcurrent!=null&&t>this.storeOptions.maxConcurrent)throw new h(`Impossible to add a job having a weight of ${t} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return r=Date.now(),i=this.storeOptions.highWater!=null&&e===this.storeOptions.highWater&&!this.check(t,r),n=this.strategyIsBlock()&&(i||this.isBlocked(r)),n&&(this._unblockTime=r+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:i,blocked:n,strategy:this.storeOptions.strategy}}async __free__(e,t){return await this.yieldLoop(),this._running-=t,this._done+=t,this.instance._drainAll(this.computeCapacity()),{running:this._running}}};var y=g,b=c,x=class{constructor(e){this.status=e,this._jobs={},this.counts=this.status.map(function(){return 0})}next(e){var t=this._jobs[e],n=t+1;if(t!=null&&n(e[this.status[n]]=t,e)),{})}},S=r,C=class{constructor(e,t){this.schedule=this.schedule.bind(this),this.name=e,this.Promise=t,this._running=0,this._queue=new S}isEmpty(){return this._queue.length===0}async _tryToRun(){var e,t,n,r,i,a,o;if(this._running<1&&this._queue.length>0)return this._running++,{task:o,args:e,resolve:i,reject:r}=this._queue.shift(),t=await(async function(){try{return a=await o(...e),function(){return i(a)}}catch(e){return n=e,function(){return r(n)}}})(),this._running--,this._tryToRun(),t()}schedule(e,...t){var n,r,i=r=null;return n=new this.Promise(function(e,t){return i=e,r=t}),this._queue.push({task:e,args:t,resolve:i,reject:r}),this._tryToRun(),n}},w=`2.19.5`,T=Object.freeze({version:w,default:{version:w}}),E=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),D=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),O=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),k,A,j,M,N,P=n;k=i,M=E,j=D,N=O,A=(function(){class e{constructor(e={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=e,P.load(this.limiterOptions,this.defaults,this),this.Events=new k(this),this.instances={},this.Bottleneck=U,this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection??(this.limiterOptions.datastore===`redis`?this.connection=new M(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore===`ioredis`&&(this.connection=new j(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(e=``){return this.instances[e]??(()=>{var t=this.instances[e]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${e}`,timeout:this.timeout,connection:this.connection}));return this.Events.trigger(`created`,t,e),t})()}async deleteKey(e=``){var t,n=this.instances[e];return this.connection&&(t=await this.connection.__runCommand__([`del`,...N.allKeys(`${this.id}-${e}`)])),n!=null&&(delete this.instances[e],await n.disconnect()),n!=null||t>0}limiters(){var e,t=this.instances,n=[],r;for(e in t)r=t[e],n.push({key:e,limiter:r});return n}keys(){return Object.keys(this.instances)}async clusterKeys(){var e,t,n,r,i,a,o,s,c;if(this.connection==null)return this.Promise.resolve(this.keys());for(a=[],e=null,c=`b_${this.id}-`.length,t=9;e!==0;)for([s,n]=await this.connection.__runCommand__([`scan`,e??0,`match`,`b_${this.id}-*_settings`,`count`,1e4]),e=~~s,r=0,o=n.length;r{var e,t,n,r,i=Date.now(),a;for(t in n=this.instances,r=[],n){a=n[t];try{await a._store.__groupCheck__(i)?r.push(this.deleteKey(t)):r.push(void 0)}catch(t){e=t,r.push(a.Events.trigger(`error`,e))}}return r},this.timeout/2)).unref==`function`?e.unref():void 0}updateSettings(e={}){if(P.overwrite(e,this.defaults,this),P.overwrite(e,e,this.limiterOptions),e.timeout!=null)return this._startAutoCleanup()}disconnect(e=!0){if(!this.sharedConnection)return this.connection?.disconnect(e)}}return e.prototype.defaults={timeout:1e3*60*5,connection:null,Promise,id:`group-key`},e}).call(e);var F=A,I,L,R=n;L=i,I=(function(){class e{constructor(e={}){this.options=e,R.load(this.options,this.defaults,this),this.Events=new L(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise((e,t)=>this._resolve=e)}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger(`batch`,this._arr),this._arr=[],this._resetPromise()}add(e){var t;return this._arr.push(e),t=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(()=>this._flush(),this.maxTime)),t}}return e.prototype.defaults={maxTime:null,maxSize:null,Promise},e}).call(e);var z=I,ee=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),B=t(T),te,V,ne,H,re,ie,ae,oe,se,ce,le,ue=[].splice;ie=10,V=5,le=n,ae=s,H=m,re=y,oe=ee,ne=i,se=x,ce=C,te=(function(){class e{constructor(t={},...n){var r,i;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(t,n),le.load(t,this.instanceDefaults,this),this._queues=new ae(ie),this._scheduled={},this._states=new se([`RECEIVED`,`QUEUED`,`RUNNING`,`EXECUTING`].concat(this.trackDoneStatus?[`DONE`]:[])),this._limiter=null,this.Events=new ne(this),this._submitLock=new ce(`submit`,this.Promise),this._registerLock=new ce(`register`,this.Promise),i=le.load(t,this.storeDefaults,{}),this._store=(function(){if(this.datastore===`redis`||this.datastore===`ioredis`||this.connection!=null)return r=le.load(t,this.redisStoreDefaults,{}),new oe(this,i,r);if(this.datastore===`local`)return r=le.load(t,this.localStoreDefaults,{}),new re(this,i,r);throw new e.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}).call(this),this._queues.on(`leftzero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.ref==`function`?e.ref():void 0}),this._queues.on(`zero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.unref==`function`?e.unref():void 0})}_validateOptions(t,n){if(!(typeof t==`object`&&t&&n.length===0))throw new e.prototype.BottleneckError(`Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.`)}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(e){return this._store.__publish__(e)}disconnect(e=!0){return this._store.__disconnect__(e)}chain(e){return this._limiter=e,this}queued(e){return this._queues.queued(e)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(e){return this._states.jobStatus(e)}jobs(e){return this._states.statusJobs(e)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(e=1){return this._store.__check__(e)}_clearGlobalState(e){return this._scheduled[e]==null?!1:(clearTimeout(this._scheduled[e].expiration),delete this._scheduled[e],!0)}async _free(e,t,n,r){var i,a;try{if({running:a}=await this._store.__free__(e,n.weight),this.Events.trigger(`debug`,`Freed ${n.id}`,r),a===0&&this.empty())return this.Events.trigger(`idle`)}catch(e){return i=e,this.Events.trigger(`error`,i)}}_run(e,t,n){var r,i,a;return t.doRun(),r=this._clearGlobalState.bind(this,e),a=this._run.bind(this,e,t),i=this._free.bind(this,e,t),this._scheduled[e]={timeout:setTimeout(()=>t.doExecute(this._limiter,r,a,i),n),expiration:t.options.expiration==null?void 0:setTimeout(function(){return t.doExpire(r,a,i)},n+t.options.expiration),job:t}}_drainOne(e){return this._registerLock.schedule(()=>{var t,n,r,i,a;return this.queued()===0||(a=this._queues.getFirst(),{options:i,args:t}=r=a.first(),e!=null&&i.weight>e)?this.Promise.resolve(null):(this.Events.trigger(`debug`,`Draining ${i.id}`,{args:t,options:i}),n=this._randomIndex(),this._store.__register__(n,i.weight,i.expiration).then(({success:e,wait:o,reservoir:s})=>{var c;return this.Events.trigger(`debug`,`Drained ${i.id}`,{success:e,args:t,options:i}),e?(a.shift(),c=this.empty(),c&&this.Events.trigger(`empty`),s===0&&this.Events.trigger(`depleted`,c),this._run(n,r,o),this.Promise.resolve(i.weight)):this.Promise.resolve(null)}))})}_drainAll(e,t=0){return this._drainOne(e).then(n=>{var r;return n==null?this.Promise.resolve(t):(r=e==null?e:e-n,this._drainAll(r,t+n))}).catch(e=>this.Events.trigger(`error`,e))}_dropAllQueued(e){return this._queues.shiftAll(function(t){return t.doDrop({message:e})})}stop(t={}){var n,r;return t=le.load(t,this.stopDefaults),r=e=>{var t=()=>{var t=this._states.counts;return t[0]+t[1]+t[2]+t[3]===e};return new this.Promise((e,n)=>t()?e():this.on(`done`,()=>{if(t())return this.removeAllListeners(`done`),e()}))},n=t.dropWaitingJobs?(this._run=function(e,n){return n.doDrop({message:t.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule(()=>this._submitLock.schedule(()=>{var e,n=this._scheduled,i;for(e in n)i=n[e],this.jobStatus(i.job.options.id)===`RUNNING`&&(clearTimeout(i.timeout),clearTimeout(i.expiration),i.job.doDrop({message:t.dropErrorMessage}));return this._dropAllQueued(t.dropErrorMessage),r(0)}))):this.schedule({priority:ie-1,weight:0},()=>r(1)),this._receive=function(n){return n._reject(new e.prototype.BottleneckError(t.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new e.prototype.BottleneckError(`stop() has already been called`)),n}async _addToQueue(t){var n,r,i,a,o,s,c;({args:n,options:a}=t);try{({reachedHWM:o,blocked:r,strategy:c}=await this._store.__submit__(this.queued(),a.weight))}catch(e){return i=e,this.Events.trigger(`debug`,`Could not queue ${a.id}`,{args:n,options:a,error:i}),t.doDrop({error:i}),!1}return r?(t.doDrop(),!0):o&&(s=c===e.prototype.strategy.LEAK?this._queues.shiftLastFrom(a.priority):c===e.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(a.priority+1):c===e.prototype.strategy.OVERFLOW?t:void 0,s?.doDrop(),s==null||c===e.prototype.strategy.OVERFLOW)?(s??t.doDrop(),o):(t.doQueue(o,r),this._queues.push(t),await this._drainAll(),o)}_receive(t){return this._states.jobStatus(t.options.id)==null?(t.doReceive(),this._submitLock.schedule(this._addToQueue,t)):(t._reject(new e.prototype.BottleneckError(`A job with the same id already exists (id=${t.options.id})`)),!1)}submit(...e){var t,n,r,i,a,o,s;return typeof e[0]==`function`?(a=e,[n,...e]=a,[t]=ue.call(e,-1),i=le.load({},this.jobDefaults)):(o=e,[i,n,...e]=o,[t]=ue.call(e,-1),i=le.load(i,this.jobDefaults)),s=(...e)=>new this.Promise(function(t,r){return n(...e,function(...e){return(e[0]==null?t:r)(e)})}),r=new H(s,e,i,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),r.promise.then(function(e){return typeof t==`function`?t(...e):void 0}).catch(function(e){return Array.isArray(e)?typeof t==`function`?t(...e):void 0:typeof t==`function`?t(e):void 0}),this._receive(r)}schedule(...e){var t,n,r;return typeof e[0]==`function`?([r,...e]=e,n={}):[n,r,...e]=e,t=new H(r,e,n,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(t),t.promise}wrap(e){var t=this.schedule.bind(this),n=function(...n){return t(e.bind(this),...n)};return n.withOptions=function(n,...r){return t(n,e,...r)},n}async updateSettings(e={}){return await this._store.__updateSettings__(le.overwrite(e,this.storeDefaults)),le.overwrite(e,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(e=0){return this._store.__incrementReservoir__(e)}}return e.default=e,e.Events=ne,e.version=e.prototype.version=B.version,e.strategy=e.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},e.BottleneckError=e.prototype.BottleneckError=c,e.Group=e.prototype.Group=F,e.RedisConnection=e.prototype.RedisConnection=E,e.IORedisConnection=e.prototype.IORedisConnection=D,e.Batcher=e.prototype.Batcher=z,e.prototype.jobDefaults={priority:V,weight:1,expiration:null,id:``},e.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:e.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},e.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},e.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},e.prototype.instanceDefaults={datastore:`local`,connection:null,id:``,rejectOnDrop:!0,trackDoneStatus:!1,Promise},e.prototype.stopDefaults={enqueueErrorMessage:`This limiter has been stopped and cannot accept new jobs.`,dropWaitingJobs:!0,dropErrorMessage:`This limiter has been stopped.`},e}).call(e);var U=te;return U}))}))(),1),nP=`0.0.0-development`;function rP(e){return e.request!==void 0}async function iP(e,t,n,r){if(!rP(n)||!n?.request.request)throw n;if(n.status>=400&&!e.doNotRetry.includes(n.status)){let i=r.request.retries==null?e.retries:r.request.retries,a=((r.request.retryCount||0)+1)**2;throw t.retry.retryRequest(n,i,a)}throw n}async function aP(e,t,n,r){let i=new tP.default;return i.on(`failed`,function(t,n){let i=~~t.request.request?.retries,a=~~t.request.request?.retryAfter;if(r.request.retryCount=n.retryCount+1,i>n.retryCount)return a*e.retryAfterBaseValue}),i.schedule(oP.bind(null,e,t,n),r)}async function oP(e,t,n,r){let i=await n(r);return i.data&&i.data.errors&&i.data.errors.length>0&&/Something went wrong while executing your query/.test(i.data.errors[0].message)?iP(e,t,new ha(i.data.errors[0].message,500,{request:r,response:i}),r):i}function sP(e,t){let n=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,410,422,451],retries:3},t.retry),r={retry:{retryRequest:(e,t,n)=>(e.request.request=Object.assign({},e.request.request,{retries:t,retryAfter:n}),e)}};return n.enabled&&(e.hook.error(`request`,iP.bind(null,n,r)),e.hook.wrap(`request`,aP.bind(null,n,r))),r}sP.VERSION=nP;var cP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function lP(e,t,n,r,i){return cP(this,void 0,void 0,function*(){let[a,o]=$N(po),s=yield _o(i,{log:void 0,userAgent:ik(),previews:void 0,retry:a,request:o},sP,eP).request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}`,{owner:n,repo:r,run_id:t,name:e});if(s.status!==200)throw new ok(`Invalid response from GitHub API: ${s.status} (${s?.headers?.[`x-github-request-id`]})`);if(s.data.artifacts.length===0)throw new sk(`Artifact not found for name: ${e} +var n=IM(),r={},i=function(e,t){return i.create(e,t)};i.create=function(e,t){if(r[e]){var i=new n(e,t);return i.setFormat(e),i.setModule(new r[e](t)),i}else throw Error(`create(`+e+`): format not registered`)},i.registerFormat=function(e,t){if(r[e])throw Error(`register(`+e+`): format already registered`);if(typeof t!=`function`)throw Error(`register(`+e+`): format module invalid`);if(typeof t.prototype.append!=`function`||typeof t.prototype.finalize!=`function`)throw Error(`register(`+e+`): format module missing methods`);r[e]=t},i.isRegisteredFormat=function(e){return!!r[e]},i.registerFormat(`zip`,QM()),i.registerFormat(`tar`,fN()),i.registerFormat(`json`,mN()),t.exports=i})),gN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},_N=class extends z.Transform{constructor(e){super({highWaterMark:e})}_transform(e,t,n){n(null,e)}};function vN(e){return gN(this,void 0,void 0,function*(){G(`Creating raw file upload stream for: ${e}`);let t=EO(),n=new _N(t),r=e;(yield o.promises.lstat(e)).isSymbolicLink()&&(r=yield ie(e));let i=o.createReadStream(r,{highWaterMark:t});return i.on(`error`,e=>{kr(`An error has occurred while reading the file for upload`),kr(String(e)),n.destroy(Error(`An error has occurred during file read for the artifact`))}),i.pipe(n),n})}var yN=pe(hN(),1),bN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function xN(e){return bN(this,arguments,void 0,function*(e,t=6){G(`Creating Artifact archive with compressionLevel: ${t}`);let n=yN.default.create(`zip`,{highWaterMark:EO(),zlib:{level:t}});n.on(`error`,SN),n.on(`warning`,CN),n.on(`finish`,wN),n.on(`end`,TN);for(let t of e)if(t.sourcePath!==null){let e=t.sourcePath;t.stats.isSymbolicLink()&&(e=yield ie(t.sourcePath)),n.file(e,{name:t.destinationPath})}else n.append(``,{name:t.destinationPath});let r=new _N(EO());return G(`Zip write high watermark value ${r.writableHighWaterMark}`),G(`Zip read high watermark value ${r.readableHighWaterMark}`),n.pipe(r),n.finalize(),r})}const SN=e=>{throw kr(`An error has occurred while creating the zip file for upload`),jr(e),Error(`An error has occurred during zip creation for the artifact`)},CN=e=>{e.code===`ENOENT`?(Ar(`ENOENT warning during artifact zip creation. No such file or directory`),jr(e)):(Ar(`A non-blocking warning has occurred during artifact zip creation: ${e.code}`),jr(e))},wN=()=>{G(`Zip stream for upload has finished.`)},TN=()=>{G(`Zip stream for upload has ended.`)},EN={".txt":`text/plain`,".html":`text/html`,".htm":`text/html`,".css":`text/css`,".csv":`text/csv`,".xml":`text/xml`,".md":`text/markdown`,".js":`application/javascript`,".mjs":`application/javascript`,".json":`application/json`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".svg":`image/svg+xml`,".webp":`image/webp`,".ico":`image/x-icon`,".bmp":`image/bmp`,".tiff":`image/tiff`,".tif":`image/tiff`,".mp3":`audio/mpeg`,".wav":`audio/wav`,".ogg":`audio/ogg`,".flac":`audio/flac`,".mp4":`video/mp4`,".webm":`video/webm`,".avi":`video/x-msvideo`,".mov":`video/quicktime`,".pdf":`application/pdf`,".doc":`application/msword`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xls":`application/vnd.ms-excel`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".ppt":`application/vnd.ms-powerpoint`,".pptx":`application/vnd.openxmlformats-officedocument.presentationml.presentation`,".zip":`application/zip`,".tar":`application/x-tar`,".gz":`application/gzip`,".rar":`application/vnd.rar`,".7z":`application/x-7z-compressed`,".wasm":`application/wasm`,".yaml":`application/x-yaml`,".yml":`application/x-yaml`,".woff":`font/woff`,".woff2":`font/woff2`,".ttf":`font/ttf`,".otf":`font/otf`,".eot":`application/vnd.ms-fontobject`};function DN(e){return EN[f.extname(e).toLowerCase()]||`application/octet-stream`}var ON=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function kN(e,t,n,r){return ON(this,void 0,void 0,function*(){let i=`${e}.zip`;if(r?.skipArchive){if(t.length===0)throw new ik([]);if(t.length>1)throw Error(`skipArchive option is only supported when uploading a single file`);if(!o.existsSync(t[0]))throw new ik(t);i=f.basename(t[0]),e=i}$O(e),xk(n);let a=[];if(!r?.skipArchive&&(a=Sk(t,n),a.length===0))throw new ik(a.flatMap(e=>e.sourcePath?[e.sourcePath]:[]));let s=DN(i),c=hk(),l=bk(),u={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:e,mimeType:IO.create({value:s}),version:7},d=YO(r?.retentionDays);d&&(u.expiresAt=d);let p=yield l.CreateArtifact(u);if(!p.ok)throw new ak(`CreateArtifact: response from backend was not ok`);let m;m=r?.skipArchive?yield vN(t[0]):yield xN(a,r?.compressionLevel),jr(`Uploading artifact: ${i}`);let h=yield wk(p.signedUploadUrl,m,s),g={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:e,size:h.uploadSize?h.uploadSize.toString():`0`};h.sha256Hash&&(g.hash=IO.create({value:`sha256:${h.sha256Hash}`})),jr(`Finalizing artifact upload`);let v=yield l.FinalizeArtifact(g);if(!v.ok)throw new ak(`FinalizeArtifact: response from backend was not ok`);let y=BigInt(v.artifactId);return jr(`Artifact ${e} successfully finalized. Artifact ID ${y}`),{size:h.uploadSize,digest:h.sha256Hash,id:Number(y)}})}var AN=U(((e,t)=>{t.exports=n;function n(e){if(!(this instanceof n))return new n(e);this.value=e}n.prototype.get=function(e){for(var t=this.value,n=0;n{var n=AN(),r=W(`events`).EventEmitter;t.exports=i;function i(e){var t=i.saw(e,{}),n=e.call(t.handlers,t);return n!==void 0&&(t.handlers=n),t.record(),t.chain()}i.light=function(e){var t=i.saw(e,{}),n=e.call(t.handlers,t);return n!==void 0&&(t.handlers=n),t.chain()},i.saw=function(e,t){var o=new r;return o.handlers=t,o.actions=[],o.chain=function(){var e=n(o.handlers).map(function(t){if(this.isRoot)return t;var n=this.path;typeof t==`function`&&this.update(function(){return o.actions.push({path:n,args:[].slice.call(arguments)}),e})});return process.nextTick(function(){o.emit(`begin`),o.next()}),e},o.pop=function(){return o.actions.shift()},o.next=function(){var e=o.pop();if(!e)o.emit(`end`);else if(!e.trap){var t=o.handlers;e.path.forEach(function(e){t=t[e]}),t.apply(o.handlers,e.args)}},o.nest=function(t){var n=[].slice.call(arguments,1),r=!0;if(typeof t==`boolean`){var r=t;t=n.shift()}var a=i.saw(e,{}),s=e.call(a.handlers,a);s!==void 0&&(a.handlers=s),o.step!==void 0&&a.record(),t.apply(a.chain(),n),r!==!1&&a.on(`end`,o.next)},o.record=function(){a(o)},[`trap`,`down`,`jump`].forEach(function(e){o[e]=function(){throw Error(`To use the trap, down and jump features, please call record() first to start recording actions.`)}}),o};function a(e){e.step=0,e.pop=function(){return e.actions[e.step++]},e.trap=function(t,n){var r=Array.isArray(t)?t:[t];e.actions.push({path:r,step:e.step,cb:n,trap:!0})},e.down=function(t){var n=(Array.isArray(t)?t:[t]).join(`/`),r=e.actions.slice(e.step).map(function(t){return t.trap&&t.step<=e.step?!1:t.path.join(`/`)==n}).indexOf(!0);r>=0?e.step+=r:e.step=e.actions.length;var i=e.actions[e.step-1];i&&i.trap?(e.step=i.step,i.cb()):e.next()},e.jump=function(t){e.step=t,e.next()}}})),MN=U(((e,t)=>{t.exports=n;function n(e){if(!(this instanceof n))return new n(e);this.buffers=e||[],this.length=this.buffers.reduce(function(e,t){return e+t.length},0)}n.prototype.push=function(){for(var e=0;e=0?e:this.length-e,a=[].slice.call(arguments,2);(t===void 0||t>this.length-i)&&(t=this.length-i);for(var e=0;e0){var l=i-s;if(l+t0){var p=a.slice();p.unshift(d),p.push(f),r.splice.apply(r,[c,1].concat(p)),c+=p.length,a=[]}else r.splice(c,1,d,f),c+=2}else o.push(r[c].slice(l)),r[c]=r[c].slice(0,l),c++}for(a.length>0&&(r.splice.apply(r,[c,0].concat(a)),c+=a.length);o.lengththis.length&&(t=this.length);for(var r=0,i=0;i=t-e?Math.min(l+(t-e)-o,c):c;n[s].copy(a,o,l,u),o+=u-l}return a},n.prototype.pos=function(e){if(e<0||e>=this.length)throw Error(`oob`);for(var t=e,n=0,r=null;;){if(r=this.buffers[n],t=this.buffers[n].length;)if(r=0,n++,n>=this.buffers.length)return-1;if(this.buffers[n][r]==e[i]){if(i==0&&(a={i:n,j:r,pos:o}),i++,i==e.length)return a.pos}else i!=0&&(n=a.i,r=a.j,o=a.pos,i=0);r++,o++}},n.prototype.toBuffer=function(){return this.slice()},n.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)}})),NN=U(((e,t)=>{t.exports=function(e){function t(e,t){var r=n.store,i=e.split(`.`);i.slice(0,-1).forEach(function(e){r[e]===void 0&&(r[e]={}),r=r[e]});var a=i[i.length-1];return arguments.length==1?r[a]:r[a]=t}var n={get:function(e){return t(e)},set:function(e,n){return t(e,n)},store:e||{}};return n}})),PN=U(((e,t)=>{var n=jN(),r=W(`events`).EventEmitter,i=MN(),a=NN(),o=W(`stream`).Stream;e=t.exports=function(t,n){if(Buffer.isBuffer(t))return e.parse(t);var r=e.stream();return t&&t.pipe?t.pipe(r):t&&(t.on(n||`data`,function(e){r.write(e)}),t.on(`end`,function(){r.end()})),r},e.stream=function(t){if(t)return e.apply(null,arguments);var s=null;function c(e,t,n){s={bytes:e,skip:n,cb:function(e){s=null,t(e)}},u()}var l=null;function u(){if(!s){v&&(g=!0);return}if(typeof s==`function`)s();else{var e=l+s.bytes;if(m.length>=e){var t;l==null?(t=m.splice(0,e),s.skip||(t=t.slice())):(s.skip||(t=m.slice(l,e)),l=e),s.skip?s.cb():s.cb(t)}}}function f(e){function t(){g||e.next()}var n=d(function(e,n){return function(r){c(e,function(e){h.set(r,n(e)),t()})}});return n.tap=function(t){e.nest(t,h.store)},n.into=function(t,n){h.get(t)||h.set(t,{});var r=h;h=a(r.get(t)),e.nest(function(){n.apply(this,arguments),this.tap(function(){h=r})},h.store)},n.flush=function(){h.store={},t()},n.loop=function(n){var r=!1;e.nest(!1,function i(){this.vars=h.store,n.call(this,function(){r=!0,t()},h.store),this.tap(function(){r?e.next():i.call(this)}.bind(this))},h.store)},n.buffer=function(e,n){typeof n==`string`&&(n=h.get(n)),c(n,function(n){h.set(e,n),t()})},n.skip=function(e){typeof e==`string`&&(e=h.get(e)),c(e,function(){t()})},n.scan=function(e,n){if(typeof n==`string`)n=new Buffer(n);else if(!Buffer.isBuffer(n))throw Error(`search must be a Buffer or a string`);var r=0;s=function(){var i=m.indexOf(n,l+r),a=i-l-r;i===-1?a=Math.max(m.length-n.length-l-r,0):(s=null,l==null?(h.set(e,m.slice(0,r+a)),m.splice(0,r+a+n.length)):(h.set(e,m.slice(l,l+r+a)),l+=r+a+n.length),t(),u()),r+=a},u()},n.peek=function(t){l=0,e.nest(function(){t.call(this,h.store),this.tap(function(){l=null})})},n}var p=n.light(f);p.writable=!0;var m=i();p.write=function(e){m.push(e),u()};var h=a(),g=!1,v=!1;return p.end=function(){v=!0},p.pipe=o.prototype.pipe,Object.getOwnPropertyNames(r.prototype).forEach(function(e){p[e]=r.prototype[e]}),p},e.parse=function(e){var t=d(function(i,a){return function(o){if(n+i<=e.length){var s=e.slice(n,n+i);n+=i,r.set(o,a(s))}else r.set(o,null);return t}}),n=0,r=a();return t.vars=r.store,t.tap=function(e){return e.call(t,r.store),t},t.into=function(e,n){r.get(e)||r.set(e,{});var i=r;return r=a(i.get(e)),n.call(t,r.store),r=i,t},t.loop=function(e){for(var n=!1,i=function(){n=!0};n===!1;)e.call(t,i,r.store);return t},t.buffer=function(i,a){typeof a==`string`&&(a=r.get(a));var o=e.slice(n,Math.min(e.length,n+a));return n+=a,r.set(i,o),t},t.skip=function(e){return typeof e==`string`&&(e=r.get(e)),n+=e,t},t.scan=function(i,a){if(typeof a==`string`)a=new Buffer(a);else if(!Buffer.isBuffer(a))throw Error(`search must be a Buffer or a string`);r.set(i,null);for(var o=0;o+n<=e.length-a.length+1;o++){for(var s=0;s=e.length},t};function s(e){for(var t=0,n=0;n{var n=W(`stream`).Transform,r=W(`util`);function i(e,t){if(!(this instanceof i))return new i;n.call(this);var r=typeof e==`object`?e.pattern:e;this.pattern=Buffer.isBuffer(r)?r:Buffer.from(r),this.requiredLength=this.pattern.length,e.requiredExtraSize&&(this.requiredLength+=e.requiredExtraSize),this.data=new Buffer(``),this.bytesSoFar=0,this.matchFn=t}r.inherits(i,n),i.prototype.checkDataChunk=function(e){if(this.data.length>=this.requiredLength){var t=this.data.indexOf(this.pattern,e?1:0);if(t>=0&&t+this.requiredLength>this.data.length){if(t>0){var n=this.data.slice(0,t);this.push(n),this.bytesSoFar+=t,this.data=this.data.slice(t)}return}if(t===-1){var r=this.data.length-this.requiredLength+1,n=this.data.slice(0,r);this.push(n),this.bytesSoFar+=r,this.data=this.data.slice(r);return}if(t>0){var n=this.data.slice(0,t);this.data=this.data.slice(t),this.push(n),this.bytesSoFar+=t}if(!this.matchFn||this.matchFn(this.data,this.bytesSoFar)){this.data=new Buffer(``);return}return!0}},i.prototype._transform=function(e,t,n){this.data=Buffer.concat([this.data,e]);for(var r=!0;this.checkDataChunk(!r);)r=!1;n()},i.prototype._flush=function(e){if(this.data.length>0)for(var t=!0;this.checkDataChunk(!t);)t=!1;this.data.length>0&&(this.push(this.data),this.data=null),e()},t.exports=i})),IN=U(((e,t)=>{var n=W(`stream`),r=W(`util`).inherits;function i(){if(!(this instanceof i))return new i;n.PassThrough.call(this),this.path=null,this.type=null,this.isDirectory=!1}r(i,n.PassThrough),i.prototype.autodrain=function(){return this.pipe(new n.Transform({transform:function(e,t,n){n()}}))},t.exports=i})),LN=U(((e,t)=>{var n=PN(),r=W(`stream`),i=W(`util`),a=W(`zlib`),o=FN(),s=IN();let c={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99},l=4294967296;function u(e){if(!(this instanceof u))return new u(e);r.Transform.call(this),this.options=e||{},this.data=new Buffer(``),this.state=c.STREAM_START,this.skippedBytes=0,this.parsedEntity=null,this.outStreamInfo={}}i.inherits(u,r.Transform),u.prototype.processDataChunk=function(e){var t;switch(this.state){case c.STREAM_START:case c.START:t=4;break;case c.LOCAL_FILE_HEADER:t=26;break;case c.LOCAL_FILE_HEADER_SUFFIX:t=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case c.DATA_DESCRIPTOR:t=12;break;case c.CENTRAL_DIRECTORY_FILE_HEADER:t=42;break;case c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:t=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case c.CDIR64_END:t=52;break;case c.CDIR64_END_DATA_SECTOR:t=this.parsedEntity.centralDirectoryRecordSize-44;break;case c.CDIR64_LOCATOR:t=16;break;case c.CENTRAL_DIRECTORY_END:t=18;break;case c.CENTRAL_DIRECTORY_END_COMMENT:t=this.parsedEntity.commentLength;break;case c.FILE_DATA:return 0;case c.FILE_DATA_END:return 0;case c.TRAILING_JUNK:return this.options.debug&&console.log(`found`,e.length,`bytes of TRAILING_JUNK`),e.length;default:return e.length}if(e.length>>=8,(i&255)==80){a=o;break}return this.skippedBytes+=a,this.options.debug&&console.log(`Skipped`,this.skippedBytes,`bytes`),a}this.state=c.ERROR;var u=r?`Not a valid zip file`:`Invalid signature in zip file`;if(this.options.debug){var d=e.readUInt32LE(0),f;try{f=e.slice(0,4).toString()}catch{}console.log(`Unexpected signature in zip file: 0x`+d.toString(16),`"`+f+`", skipped`,this.skippedBytes,`bytes`)}return this.emit(`error`,Error(u)),e.length}return this.skippedBytes=0,t;case c.LOCAL_FILE_HEADER:return this.parsedEntity=this._readFile(e),this.state=c.LOCAL_FILE_HEADER_SUFFIX,t;case c.LOCAL_FILE_HEADER_SUFFIX:var p=new s,m=(this.parsedEntity.flags&2048)!=0;p.path=this._decodeString(e.slice(0,this.parsedEntity.fileNameLength),m);var h=e.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),g=this._readExtraFields(h);if(g&&g.parsed&&(g.parsed.path&&!m&&(p.path=g.parsed.path),Number.isFinite(g.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===l-1&&(this.parsedEntity.uncompressedSize=g.parsed.uncompressedSize),Number.isFinite(g.parsed.compressedSize)&&this.parsedEntity.compressedSize===l-1&&(this.parsedEntity.compressedSize=g.parsed.compressedSize)),this.parsedEntity.extra=g.parsed||{},this.options.debug){let e=Object.assign({},this.parsedEntity,{path:p.path,flags:`0x`+this.parsedEntity.flags.toString(16),extraFields:g&&g.debug});console.log(`decoded LOCAL_FILE_HEADER:`,JSON.stringify(e,null,2))}return this._prepareOutStream(this.parsedEntity,p),this.emit(`entry`,p),this.state=c.FILE_DATA,t;case c.CENTRAL_DIRECTORY_FILE_HEADER:return this.parsedEntity=this._readCentralDirectoryEntry(e),this.state=c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX,t;case c.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var m=(this.parsedEntity.flags&2048)!=0,v=this._decodeString(e.slice(0,this.parsedEntity.fileNameLength),m),h=e.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),g=this._readExtraFields(h);g&&g.parsed&&g.parsed.path&&!m&&(v=g.parsed.path),this.parsedEntity.extra=g.parsed;var y=(this.parsedEntity.versionMadeBy&65280)>>8==3,b,x;if(y&&(b=this.parsedEntity.externalFileAttributes>>>16,x=(b>>>12&10)==10),this.options.debug){let e=Object.assign({},this.parsedEntity,{path:v,flags:`0x`+this.parsedEntity.flags.toString(16),unixAttrs:b&&`0`+b.toString(8),isSymlink:x,extraFields:g.debug});console.log(`decoded CENTRAL_DIRECTORY_FILE_HEADER:`,JSON.stringify(e,null,2))}return this.state=c.START,t;case c.CDIR64_END:return this.parsedEntity=this._readEndOfCentralDirectory64(e),this.options.debug&&console.log(`decoded CDIR64_END_RECORD:`,this.parsedEntity),this.state=c.CDIR64_END_DATA_SECTOR,t;case c.CDIR64_END_DATA_SECTOR:return this.state=c.START,t;case c.CDIR64_LOCATOR:return this.state=c.START,t;case c.CENTRAL_DIRECTORY_END:return this.parsedEntity=this._readEndOfCentralDirectory(e),this.options.debug&&console.log(`decoded CENTRAL_DIRECTORY_END:`,this.parsedEntity),this.state=c.CENTRAL_DIRECTORY_END_COMMENT,t;case c.CENTRAL_DIRECTORY_END_COMMENT:return this.options.debug&&console.log(`decoded CENTRAL_DIRECTORY_END_COMMENT:`,e.slice(0,t).toString()),this.state=c.TRAILING_JUNK,t;case c.ERROR:return e.length;default:return console.log(`didn't handle state #`,this.state,`discarding`),e.length}},u.prototype._prepareOutStream=function(e,t){var n=this,i=e.uncompressedSize===0&&/[\/\\]$/.test(t.path);t.path=t.path.replace(/(?<=^|[/\\]+)[.][.]+(?=[/\\]+|$)/g,`.`),t.type=i?`Directory`:`File`,t.isDirectory=i;var u=!(e.flags&8);u&&(t.size=e.uncompressedSize);var d=e.versionsNeededToExtract<=45;if(this.outStreamInfo={stream:null,limit:u?e.compressedSize:-1,written:0},u)this.outStreamInfo.stream=new r.PassThrough;else{var f=new Buffer(4);f.writeUInt32LE(134695760,0);var p=e.extra.zip64Mode,m=new o({pattern:f,requiredExtraSize:p?20:12},function(e,t){var r=n._readDataDescriptor(e,p),i=r.compressedSize===t;if(!p&&!i&&t>=l)for(var a=t-l;a>=0&&(i=r.compressedSize===a,!i);)a-=l;if(i){n.state=c.FILE_DATA_END;var o=p?24:16;return n.data.length>0?n.data=Buffer.concat([e.slice(o),n.data]):n.data=e.slice(o),!0}});this.outStreamInfo.stream=m}var h=e.flags&1||e.flags&64;if(h||!d){var g=h?`Encrypted files are not supported!`:`Zip version `+Math.floor(e.versionsNeededToExtract/10)+`.`+e.versionsNeededToExtract%10+` is not supported`;t.skip=!0,setImmediate(()=>{n.emit(`error`,Error(g))}),this.outStreamInfo.stream.pipe(new s().autodrain());return}if(e.compressionMethod>0){var v=a.createInflateRaw();v.on(`error`,function(e){n.state=c.ERROR,n.emit(`error`,e)}),this.outStreamInfo.stream.pipe(v).pipe(t)}else this.outStreamInfo.stream.pipe(t);this._drainAllEntries&&t.autodrain()},u.prototype._readFile=function(e){return n.parse(e).word16lu(`versionsNeededToExtract`).word16lu(`flags`).word16lu(`compressionMethod`).word16lu(`lastModifiedTime`).word16lu(`lastModifiedDate`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).word16lu(`fileNameLength`).word16lu(`extraFieldLength`).vars},u.prototype._readExtraFields=function(e){var t={},r={parsed:t};this.options.debug&&(r.debug=[]);for(var i=0;i=l+4&&c&1&&(t.mtime=new Date(e.readUInt32LE(i+l)*1e3),l+=4),a.extraSize>=l+4&&c&2&&(t.atime=new Date(e.readUInt32LE(i+l)*1e3),l+=4),a.extraSize>=l+4&&c&4&&(t.ctime=new Date(e.readUInt32LE(i+l)*1e3));break;case 28789:if(o=`Info-ZIP Unicode Path Extra Field`,e.readUInt8(i)===1){var l=1;e.readUInt32LE(i+l),l+=4,t.path=e.slice(i+l).toString()}break;case 13:case 22613:o=a.extraId===13?`PKWARE Unix`:`Info-ZIP UNIX (type 1)`;var l=0;if(a.extraSize>=8){var u=new Date(e.readUInt32LE(i+l)*1e3);l+=4;var d=new Date(e.readUInt32LE(i+l)*1e3);if(l+=4,t.atime=u,t.mtime=d,a.extraSize>=12){var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);l+=2,t.uid=f,t.gid=p}}break;case 30805:o=`Info-ZIP UNIX (type 2)`;var l=0;if(a.extraSize>=4){var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);l+=2,t.uid=f,t.gid=p}break;case 30837:o=`Info-ZIP New Unix`;var l=0,m=e.readUInt8(i);if(l+=1,m===1){var h=e.readUInt8(i+l);l+=1,h<=6&&(t.uid=e.readUIntLE(i+l,h)),l+=h;var g=e.readUInt8(i+l);l+=1,g<=6&&(t.gid=e.readUIntLE(i+l,g))}break;case 30062:o=`ASi Unix`;var l=0;if(a.extraSize>=14){e.readUInt32LE(i+l),l+=4;var v=e.readUInt16LE(i+l);l+=2,e.readUInt32LE(i+l),l+=4;var f=e.readUInt16LE(i+l);l+=2;var p=e.readUInt16LE(i+l);if(l+=2,t.mode=v,t.uid=f,t.gid=p,a.extraSize>14){var y=i+l,b=i+a.extraSize-14;t.symlink=this._decodeString(e.slice(y,b))}}break}this.options.debug&&r.debug.push({extraId:`0x`+a.extraId.toString(16),description:o,data:e.slice(i,i+a.extraSize).inspect()}),i+=a.extraSize}return r},u.prototype._readDataDescriptor=function(e,t){if(t){var r=n.parse(e).word32lu(`dataDescriptorSignature`).word32lu(`crc32`).word64lu(`compressedSize`).word64lu(`uncompressedSize`).vars;return r}var r=n.parse(e).word32lu(`dataDescriptorSignature`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).vars;return r},u.prototype._readCentralDirectoryEntry=function(e){return n.parse(e).word16lu(`versionMadeBy`).word16lu(`versionsNeededToExtract`).word16lu(`flags`).word16lu(`compressionMethod`).word16lu(`lastModifiedTime`).word16lu(`lastModifiedDate`).word32lu(`crc32`).word32lu(`compressedSize`).word32lu(`uncompressedSize`).word16lu(`fileNameLength`).word16lu(`extraFieldLength`).word16lu(`fileCommentLength`).word16lu(`diskNumber`).word16lu(`internalFileAttributes`).word32lu(`externalFileAttributes`).word32lu(`offsetToLocalFileHeader`).vars},u.prototype._readEndOfCentralDirectory64=function(e){return n.parse(e).word64lu(`centralDirectoryRecordSize`).word16lu(`versionMadeBy`).word16lu(`versionsNeededToExtract`).word32lu(`diskNumber`).word32lu(`diskNumberWithCentralDirectoryStart`).word64lu(`centralDirectoryEntries`).word64lu(`totalCentralDirectoryEntries`).word64lu(`sizeOfCentralDirectory`).word64lu(`offsetToStartOfCentralDirectory`).vars},u.prototype._readEndOfCentralDirectory=function(e){return n.parse(e).word16lu(`diskNumber`).word16lu(`diskStart`).word16lu(`centralDirectoryEntries`).word16lu(`totalCentralDirectoryEntries`).word32lu(`sizeOfCentralDirectory`).word32lu(`offsetToStartOfCentralDirectory`).word16lu(`commentLength`).vars},u.prototype._decodeString=function(e,t){if(t)return e.toString(`utf8`);if(this.options.decodeString)return this.options.decodeString(e);let n=``;for(var r=0;r?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `[e[r]];return n},u.prototype._parseOrOutput=function(e,t){for(var n;(n=this.processDataChunk(this.data))>0&&(this.data=this.data.slice(n),this.data.length!==0););if(this.state===c.FILE_DATA){if(this.outStreamInfo.limit>=0){var r=this.outStreamInfo.limit-this.outStreamInfo.written,i;r{if(this.state===c.FILE_DATA_END)return this.state=c.START,a.end(t);t()})}return}t()},u.prototype.drainAll=function(){this._drainAllEntries=!0},u.prototype._transform=function(e,t,n){var r=this;r.data.length>0?r.data=Buffer.concat([r.data,e]):r.data=e;var i=r.data.length,a=function(){if(r.data.length>0&&r.data.length0){t._parseOrOutput(`buffer`,function(){if(t.data.length>0)return setImmediate(function(){t._flush(e)});e()});return}if(t.state===c.FILE_DATA)return e(Error(`Stream finished in an invalid state, uncompression failed`));setImmediate(e)},t.exports=u})),RN=U(((e,t)=>{var n=W(`stream`).Transform,r=W(`util`),i=LN();function a(e){if(!(this instanceof a))return new a(e);n.call(this,{readableObjectMode:!0}),this.opts=e||{},this.unzipStream=new i(this.opts);var t=this;this.unzipStream.on(`entry`,function(e){t.push(e)}),this.unzipStream.on(`error`,function(e){t.emit(`error`,e)})}r.inherits(a,n),a.prototype._transform=function(e,t,n){this.unzipStream.write(e,t,n)},a.prototype._flush=function(e){var t=this;this.unzipStream.end(function(){process.nextTick(function(){t.emit(`close`)}),e()})},a.prototype.on=function(e,t){return e===`entry`?n.prototype.on.call(this,`data`,t):n.prototype.on.call(this,e,t)},a.prototype.drainAll=function(){return this.unzipStream.drainAll(),this.pipe(new n({objectMode:!0,transform:function(e,t,n){n()}}))},t.exports=a})),zN=U(((e,t)=>{var n=W(`path`),r=W(`fs`),i=511;t.exports=a.mkdirp=a.mkdirP=a;function a(e,t,o,s){typeof t==`function`?(o=t,t={}):(!t||typeof t!=`object`)&&(t={mode:t});var c=t.mode,l=t.fs||r;c===void 0&&(c=i),s||=null;var u=o||function(){};e=n.resolve(e),l.mkdir(e,c,function(r){if(!r)return s||=e,u(null,s);switch(r.code){case`ENOENT`:if(n.dirname(e)===e)return u(r);a(n.dirname(e),t,function(n,r){n?u(n,r):a(e,t,u,r)});break;default:l.stat(e,function(e,t){e||!t.isDirectory()?u(r,s):u(null,s)});break}})}a.sync=function e(t,a,o){(!a||typeof a!=`object`)&&(a={mode:a});var s=a.mode,c=a.fs||r;s===void 0&&(s=i),o||=null,t=n.resolve(t);try{c.mkdirSync(t,s),o||=t}catch(r){switch(r.code){case`ENOENT`:o=e(n.dirname(t),a,o),e(t,a,o);break;default:var l;try{l=c.statSync(t)}catch{throw r}if(!l.isDirectory())throw r;break}}return o}})),BN=U(((e,t)=>{var n=W(`fs`),r=W(`path`),i=W(`util`),a=zN(),o=W(`stream`).Transform,s=LN();function c(e){if(!(this instanceof c))return new c(e);o.call(this),this.opts=e||{},this.unzipStream=new s(this.opts),this.unfinishedEntries=0,this.afterFlushWait=!1,this.createdDirectories={};var t=this;this.unzipStream.on(`entry`,this._processEntry.bind(this)),this.unzipStream.on(`error`,function(e){t.emit(`error`,e)})}i.inherits(c,o),c.prototype._transform=function(e,t,n){this.unzipStream.write(e,t,n)},c.prototype._flush=function(e){var t=this,n=function(){process.nextTick(function(){t.emit(`close`)}),e()};this.unzipStream.end(function(){if(t.unfinishedEntries>0)return t.afterFlushWait=!0,t.on(`await-finished`,n);n()})},c.prototype._processEntry=function(e){var t=this,i=r.join(this.opts.path,e.path),o=e.isDirectory?i:r.dirname(i);this.unfinishedEntries++;var s=function(){var r=n.createWriteStream(i);r.on(`close`,function(){t.unfinishedEntries--,t._notifyAwaiter()}),r.on(`error`,function(e){t.emit(`error`,e)}),e.pipe(r)};if(this.createdDirectories[o]||o===`.`)return s();a(o,function(n){if(n)return t.emit(`error`,n);if(t.createdDirectories[o]=!0,e.isDirectory){t.unfinishedEntries--,t._notifyAwaiter();return}s()})},c.prototype._notifyAwaiter=function(){this.afterFlushWait&&this.unfinishedEntries===0&&(this.emit(`await-finished`),this.afterFlushWait=!1)},t.exports=c})),VN=pe(U((e=>{e.Parse=RN(),e.Extract=BN()}))(),1),HN=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const UN=e=>{let t=new URL(e);return t.search=``,t.toString()};function WN(e){return HN(this,void 0,void 0,function*(){try{return yield re.access(e),!0}catch(e){if(e.code===`ENOENT`)return!1;throw e}})}function GN(e,t,n){return HN(this,void 0,void 0,function*(){let r=0;for(;r<5;)try{return yield KN(e,t,{skipDecompress:n})}catch(e){r++,G(`Failed to download artifact after ${r} retries due to ${e.message}. Retrying in 5 seconds...`),yield new Promise(e=>setTimeout(e,5e3))}throw Error(`Artifact download failed after ${r} retries.`)})}function KN(e,t){return HN(this,arguments,void 0,function*(e,t,n={}){let{timeout:r=30*1e3,skipDecompress:i=!1}=n,s=yield new On(rk()).get(e);if(s.message.statusCode!==200)throw Error(`Unexpected HTTP response from blob storage: ${s.message.statusCode} ${s.message.statusMessage}`);let c=s.message.headers[`content-type`]||``,l=c.split(`;`,1)[0].trim().toLowerCase(),u=new URL(e).pathname.toLowerCase().endsWith(`.zip`),d=l===`application/zip`||l===`application/x-zip-compressed`||l===`application/zip-compressed`||u,p=s.message.headers[`content-disposition`]||``,m=`artifact`,h=p.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i),g=p.match(/(?{let c=setTimeout(()=>{let e=Error(`Blob storage chunk did not respond in ${r}ms`);s.message.destroy(e),n(e)},r),l=e=>{G(`response.message: Artifact download failed: ${e.message}`),clearTimeout(c),n(e)},u=a.createHash(`sha256`).setEncoding(`hex`),p=new z.PassThrough().on(`data`,()=>{c.refresh()}).on(`error`,l);s.message.pipe(p),p.pipe(u);let h=()=>{clearTimeout(c),u&&(u.end(),y=u.read(),jr(`SHA256 digest of downloaded artifact is ${y}`)),e({sha256Digest:`sha256:${y}`})};if(d&&!i)p.pipe(VN.Extract({path:t})).on(`close`,h).on(`error`,l);else{let e=f.join(t,m),n=o.createWriteStream(e);jr(`Downloading raw file (non-zip) to: ${e}`),p.pipe(n).on(`close`,h).on(`error`,l)}})})}function qN(e,t,n,r,i){return HN(this,void 0,void 0,function*(){let a=yield YN(i?.path),o=_o(r),s=!1;jr(`Downloading artifact '${e}' from '${t}/${n}'`);let{headers:c,status:l}=yield o.rest.actions.downloadArtifact({owner:t,repo:n,artifact_id:e,archive_format:`zip`,request:{redirect:`manual`}});if(l!==302)throw Error(`Unable to download artifact. Unexpected status: ${l}`);let{location:u}=c;if(!u)throw Error(`Unable to redirect to artifact download url`);jr(`Redirecting to blob download url: ${UN(u)}`);try{jr(`Starting download of artifact to: ${a}`);let e=yield GN(u,a,i?.skipDecompress);jr(`Artifact download completed successfully.`),i?.expectedHash&&i?.expectedHash!==e.sha256Digest&&(s=!0,G(`Computed digest: ${e.sha256Digest}`),G(`Expected digest: ${i.expectedHash}`))}catch(e){throw Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:a,digestMismatch:s}})}function JN(e,t){return HN(this,void 0,void 0,function*(){let n=yield YN(t?.path),r=bk(),i=!1,{workflowRunBackendId:a,workflowJobRunBackendId:o}=hk(),s={workflowRunBackendId:a,workflowJobRunBackendId:o,idFilter:FO.create({value:e.toString()})},{artifacts:c}=yield r.ListArtifacts(s);if(c.length===0)throw new ok(`No artifacts found for ID: ${e}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`);c.length>1&&Ar(`Multiple artifacts found, defaulting to first.`);let l={workflowRunBackendId:c[0].workflowRunBackendId,workflowJobRunBackendId:c[0].workflowJobRunBackendId,name:c[0].name},{signedUrl:u}=yield r.GetSignedArtifactURL(l);jr(`Redirecting to blob download url: ${UN(u)}`);try{jr(`Starting download of artifact to: ${n}`);let e=yield GN(u,n,t?.skipDecompress);jr(`Artifact download completed successfully.`),t?.expectedHash&&t?.expectedHash!==e.sha256Digest&&(i=!0,G(`Computed digest: ${e.sha256Digest}`),G(`Expected digest: ${t.expectedHash}`))}catch(e){throw Error(`Unable to download and extract artifact: ${e.message}`)}return{downloadPath:n,digestMismatch:i}})}function YN(){return HN(this,arguments,void 0,function*(e=AO()){return(yield WN(e))?G(`Artifact destination folder already exists: ${e}`):(G(`Artifact destination folder does not exist, creating: ${e}`),yield re.mkdir(e,{recursive:!0})),e})}const XN=[400,401,403,404,422];function ZN(e,t=5,n=XN){if(t<=0)return[{enabled:!1},e.request];let r={enabled:!0};n.length>0&&(r.doNotRetry=n);let i=Object.assign(Object.assign({},e.request),{retries:t});return G(`GitHub client configured with: (retries: ${i.retries}, retry-exempt-status-code: ${r.doNotRetry??`octokit default: [400, 401, 403, 404, 422]`})`),[r,i]}function QN(e){e.hook.wrap(`request`,(t,n)=>{e.log.debug(`request`,n);let r=Date.now(),i=e.request.endpoint.parse(n),a=i.url.replace(n.baseUrl,``);return t(n).then(t=>{let n=t.headers[`x-github-request-id`];return e.log.info(`${i.method} ${a} - ${t.status} with id ${n} in ${Date.now()-r}ms`),t}).catch(t=>{let n=t.response?.headers[`x-github-request-id`]||`UNKNOWN`;throw e.log.error(`${i.method} ${a} - ${t.status} with id ${n} in ${Date.now()-r}ms`),t})})}QN.VERSION=`6.0.0`;var $N=pe(U(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Bottleneck=r()})(e,(function(){var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function t(e){return e&&e.default||e}var n={load:function(e,t,n={}){var r,i;for(r in t)i=t[r],n[r]=e[r]??i;return n},overwrite:function(e,t,n={}){var r,i;for(r in e)i=e[r],t[r]!==void 0&&(n[r]=i);return n}},r=class{constructor(e,t){this.incr=e,this.decr=t,this._first=null,this._last=null,this.length=0}push(e){var t;this.length++,typeof this.incr==`function`&&this.incr(),t={value:e,prev:this._last,next:null},this._last==null?this._first=this._last=t:(this._last.next=t,this._last=t)}shift(){var e;if(this._first!=null)return this.length--,typeof this.decr==`function`&&this.decr(),e=this._first.value,(this._first=this._first.next)==null?this._last=null:this._first.prev=null,e}first(){if(this._first!=null)return this._first.value}getArray(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,t.value));return n}forEachShift(e){for(var t=this.shift();t!=null;)e(t),t=this.shift()}debug(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,{value:t.value,prev:t.prev?.value,next:t.next?.value}));return n}},i=class{constructor(e){if(this.instance=e,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw Error(`An Emitter already exists for this object`);this.instance.on=(e,t)=>this._addListener(e,`many`,t),this.instance.once=(e,t)=>this._addListener(e,`once`,t),this.instance.removeAllListeners=(e=null)=>e==null?this._events={}:delete this._events[e]}_addListener(e,t,n){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push({cb:n,status:t}),this.instance}listenerCount(e){return this._events[e]==null?0:this._events[e].length}async trigger(e,...t){var n,r;try{return e!==`debug`&&this.trigger(`debug`,`Event triggered: ${e}`,t),this._events[e]==null?void 0:(this._events[e]=this._events[e].filter(function(e){return e.status!==`none`}),r=this._events[e].map(async e=>{var n,r;if(e.status!==`none`){e.status===`once`&&(e.status=`none`);try{return r=typeof e.cb==`function`?e.cb(...t):void 0,typeof r?.then==`function`?await r:r}catch(e){return n=e,this.trigger(`error`,n),null}}}),(await Promise.all(r)).find(function(e){return e!=null}))}catch(e){return n=e,this.trigger(`error`,n),null}}},a=r,o=i,s=class{constructor(e){this.Events=new o(this),this._length=0,this._lists=(function(){var t,n,r=[];for(t=1,n=e;1<=n?t<=n:t>=n;1<=n?++t:--t)r.push(new a((()=>this.incr()),(()=>this.decr())));return r}).call(this)}incr(){if(this._length++===0)return this.Events.trigger(`leftzero`)}decr(){if(--this._length===0)return this.Events.trigger(`zero`)}push(e){return this._lists[e.options.priority].push(e)}queued(e){return e==null?this._length:this._lists[e].length}shiftAll(e){return this._lists.forEach(function(t){return t.forEachShift(e)})}getFirst(e=this._lists){var t,n,r;for(t=0,n=e.length;t0)return r;return[]}shiftLastFrom(e){return this.getFirst(this._lists.slice(e).reverse()).shift()}},c=class extends Error{},l,u,d,f=10,p;u=5,p=n,l=c,d=class{constructor(e,t,n,r,i,a,o,s){this.task=e,this.args=t,this.rejectOnDrop=i,this.Events=a,this._states=o,this.Promise=s,this.options=p.load(n,r),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===r.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise((e,t)=>{this._resolve=e,this._reject=t}),this.retryCount=0}_sanitizePriority(e){var t=~~e===e?e:u;return t<0?0:t>f-1?f-1:t}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:e,message:t=`This job has been dropped by Bottleneck`}={}){return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(e??new l(t)),this.Events.trigger(`dropped`,{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}_assertStatus(e){var t=this._states.jobStatus(this.options.id);if(!(t===e||e===`DONE`&&t===null))throw new l(`Invalid job status ${t}, expected ${e}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger(`received`,{args:this.args,options:this.options})}doQueue(e,t){return this._assertStatus(`RECEIVED`),this._states.next(this.options.id),this.Events.trigger(`queued`,{args:this.args,options:this.options,reachedHWM:e,blocked:t})}doRun(){return this.retryCount===0?(this._assertStatus(`QUEUED`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),this.Events.trigger(`scheduled`,{args:this.args,options:this.options})}async doExecute(e,t,n,r){var i,a,o;this.retryCount===0?(this._assertStatus(`RUNNING`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),a={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger(`executing`,a);try{if(o=await(e==null?this.task(...this.args):e.schedule(this.options,this.task,...this.args)),t())return this.doDone(a),await r(this.options,a),this._assertStatus(`DONE`),this._resolve(o)}catch(e){return i=e,this._onFailure(i,a,t,n,r)}}doExpire(e,t,n){var r,i;return this._states.jobStatus(this.options.id===`RUNNING`)&&this._states.next(this.options.id),this._assertStatus(`EXECUTING`),i={args:this.args,options:this.options,retryCount:this.retryCount},r=new l(`This job timed out after ${this.options.expiration} ms.`),this._onFailure(r,i,e,t,n)}async _onFailure(e,t,n,r,i){var a,o;if(n())return a=await this.Events.trigger(`failed`,e,t),a==null?(this.doDone(t),await i(this.options,t),this._assertStatus(`DONE`),this._reject(e)):(o=~~a,this.Events.trigger(`retry`,`Retrying ${this.options.id} after ${o} ms`,t),this.retryCount++,r(o))}doDone(e){return this._assertStatus(`EXECUTING`),this._states.next(this.options.id),this.Events.trigger(`done`,e)}};var m=d,h,g,v=n;h=c,g=class{constructor(e,t,n){this.instance=e,this.storeOptions=t,this.clientId=this.instance._randomIndex(),v.load(n,n,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var e;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(e=this.heartbeat=setInterval(()=>{var e,t,n,r=Date.now(),i;if(this.storeOptions.reservoirRefreshInterval!=null&&r>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=r,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),this.storeOptions.reservoirIncreaseInterval!=null&&r>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&({reservoirIncreaseAmount:e,reservoirIncreaseMaximum:n,reservoir:i}=this.storeOptions,this._lastReservoirIncrease=r,t=n==null?e:Math.min(e,n-i),t>0))return this.storeOptions.reservoir+=t,this.instance._drainAll(this.computeCapacity())},this.heartbeatInterval)).unref==`function`?e.unref():void 0:clearInterval(this.heartbeat)}async __publish__(e){return await this.yieldLoop(),this.instance.Events.trigger(`message`,e.toString())}async __disconnect__(e){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(e=0){return new this.Promise(function(t,n){return setTimeout(t,e)})}computePenalty(){return this.storeOptions.penalty??(15*this.storeOptions.minTime||5e3)}async __updateSettings__(e){return await this.yieldLoop(),v.overwrite(e,e,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(e){return await this.yieldLoop(),this._nextRequest+this.timeout=e}check(e,t){return this.conditionsCheck(e)&&this._nextRequest-t<=0}async __check__(e){var t;return await this.yieldLoop(),t=Date.now(),this.check(e,t)}async __register__(e,t,n){var r,i;return await this.yieldLoop(),r=Date.now(),this.conditionsCheck(t)?(this._running+=t,this.storeOptions.reservoir!=null&&(this.storeOptions.reservoir-=t),i=Math.max(this._nextRequest-r,0),this._nextRequest=r+i+this.storeOptions.minTime,{success:!0,wait:i,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(e,t){var n,r,i;if(await this.yieldLoop(),this.storeOptions.maxConcurrent!=null&&t>this.storeOptions.maxConcurrent)throw new h(`Impossible to add a job having a weight of ${t} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return r=Date.now(),i=this.storeOptions.highWater!=null&&e===this.storeOptions.highWater&&!this.check(t,r),n=this.strategyIsBlock()&&(i||this.isBlocked(r)),n&&(this._unblockTime=r+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:i,blocked:n,strategy:this.storeOptions.strategy}}async __free__(e,t){return await this.yieldLoop(),this._running-=t,this._done+=t,this.instance._drainAll(this.computeCapacity()),{running:this._running}}};var y=g,b=c,x=class{constructor(e){this.status=e,this._jobs={},this.counts=this.status.map(function(){return 0})}next(e){var t=this._jobs[e],n=t+1;if(t!=null&&n(e[this.status[n]]=t,e)),{})}},S=r,C=class{constructor(e,t){this.schedule=this.schedule.bind(this),this.name=e,this.Promise=t,this._running=0,this._queue=new S}isEmpty(){return this._queue.length===0}async _tryToRun(){var e,t,n,r,i,a,o;if(this._running<1&&this._queue.length>0)return this._running++,{task:o,args:e,resolve:i,reject:r}=this._queue.shift(),t=await(async function(){try{return a=await o(...e),function(){return i(a)}}catch(e){return n=e,function(){return r(n)}}})(),this._running--,this._tryToRun(),t()}schedule(e,...t){var n,r,i=r=null;return n=new this.Promise(function(e,t){return i=e,r=t}),this._queue.push({task:e,args:t,resolve:i,reject:r}),this._tryToRun(),n}},w=`2.19.5`,T=Object.freeze({version:w,default:{version:w}}),E=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),D=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),O=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),k,A,j,M,N,P=n;k=i,M=E,j=D,N=O,A=(function(){class e{constructor(e={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=e,P.load(this.limiterOptions,this.defaults,this),this.Events=new k(this),this.instances={},this.Bottleneck=U,this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection??(this.limiterOptions.datastore===`redis`?this.connection=new M(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore===`ioredis`&&(this.connection=new j(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(e=``){return this.instances[e]??(()=>{var t=this.instances[e]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${e}`,timeout:this.timeout,connection:this.connection}));return this.Events.trigger(`created`,t,e),t})()}async deleteKey(e=``){var t,n=this.instances[e];return this.connection&&(t=await this.connection.__runCommand__([`del`,...N.allKeys(`${this.id}-${e}`)])),n!=null&&(delete this.instances[e],await n.disconnect()),n!=null||t>0}limiters(){var e,t=this.instances,n=[],r;for(e in t)r=t[e],n.push({key:e,limiter:r});return n}keys(){return Object.keys(this.instances)}async clusterKeys(){var e,t,n,r,i,a,o,s,c;if(this.connection==null)return this.Promise.resolve(this.keys());for(a=[],e=null,c=`b_${this.id}-`.length,t=9;e!==0;)for([s,n]=await this.connection.__runCommand__([`scan`,e??0,`match`,`b_${this.id}-*_settings`,`count`,1e4]),e=~~s,r=0,o=n.length;r{var e,t,n,r,i=Date.now(),a;for(t in n=this.instances,r=[],n){a=n[t];try{await a._store.__groupCheck__(i)?r.push(this.deleteKey(t)):r.push(void 0)}catch(t){e=t,r.push(a.Events.trigger(`error`,e))}}return r},this.timeout/2)).unref==`function`?e.unref():void 0}updateSettings(e={}){if(P.overwrite(e,this.defaults,this),P.overwrite(e,e,this.limiterOptions),e.timeout!=null)return this._startAutoCleanup()}disconnect(e=!0){if(!this.sharedConnection)return this.connection?.disconnect(e)}}return e.prototype.defaults={timeout:1e3*60*5,connection:null,Promise,id:`group-key`},e}).call(e);var F=A,I,L,R=n;L=i,I=(function(){class e{constructor(e={}){this.options=e,R.load(this.options,this.defaults,this),this.Events=new L(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise((e,t)=>this._resolve=e)}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger(`batch`,this._arr),this._arr=[],this._resetPromise()}add(e){var t;return this._arr.push(e),t=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(()=>this._flush(),this.maxTime)),t}}return e.prototype.defaults={maxTime:null,maxSize:null,Promise},e}).call(e);var z=I,ee=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),B=t(T),te,V,ne,H,re,ie,ae,oe,se,ce,le,ue=[].splice;ie=10,V=5,le=n,ae=s,H=m,re=y,oe=ee,ne=i,se=x,ce=C,te=(function(){class e{constructor(t={},...n){var r,i;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(t,n),le.load(t,this.instanceDefaults,this),this._queues=new ae(ie),this._scheduled={},this._states=new se([`RECEIVED`,`QUEUED`,`RUNNING`,`EXECUTING`].concat(this.trackDoneStatus?[`DONE`]:[])),this._limiter=null,this.Events=new ne(this),this._submitLock=new ce(`submit`,this.Promise),this._registerLock=new ce(`register`,this.Promise),i=le.load(t,this.storeDefaults,{}),this._store=(function(){if(this.datastore===`redis`||this.datastore===`ioredis`||this.connection!=null)return r=le.load(t,this.redisStoreDefaults,{}),new oe(this,i,r);if(this.datastore===`local`)return r=le.load(t,this.localStoreDefaults,{}),new re(this,i,r);throw new e.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}).call(this),this._queues.on(`leftzero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.ref==`function`?e.ref():void 0}),this._queues.on(`zero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.unref==`function`?e.unref():void 0})}_validateOptions(t,n){if(!(typeof t==`object`&&t&&n.length===0))throw new e.prototype.BottleneckError(`Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.`)}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(e){return this._store.__publish__(e)}disconnect(e=!0){return this._store.__disconnect__(e)}chain(e){return this._limiter=e,this}queued(e){return this._queues.queued(e)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(e){return this._states.jobStatus(e)}jobs(e){return this._states.statusJobs(e)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(e=1){return this._store.__check__(e)}_clearGlobalState(e){return this._scheduled[e]==null?!1:(clearTimeout(this._scheduled[e].expiration),delete this._scheduled[e],!0)}async _free(e,t,n,r){var i,a;try{if({running:a}=await this._store.__free__(e,n.weight),this.Events.trigger(`debug`,`Freed ${n.id}`,r),a===0&&this.empty())return this.Events.trigger(`idle`)}catch(e){return i=e,this.Events.trigger(`error`,i)}}_run(e,t,n){var r,i,a;return t.doRun(),r=this._clearGlobalState.bind(this,e),a=this._run.bind(this,e,t),i=this._free.bind(this,e,t),this._scheduled[e]={timeout:setTimeout(()=>t.doExecute(this._limiter,r,a,i),n),expiration:t.options.expiration==null?void 0:setTimeout(function(){return t.doExpire(r,a,i)},n+t.options.expiration),job:t}}_drainOne(e){return this._registerLock.schedule(()=>{var t,n,r,i,a;return this.queued()===0||(a=this._queues.getFirst(),{options:i,args:t}=r=a.first(),e!=null&&i.weight>e)?this.Promise.resolve(null):(this.Events.trigger(`debug`,`Draining ${i.id}`,{args:t,options:i}),n=this._randomIndex(),this._store.__register__(n,i.weight,i.expiration).then(({success:e,wait:o,reservoir:s})=>{var c;return this.Events.trigger(`debug`,`Drained ${i.id}`,{success:e,args:t,options:i}),e?(a.shift(),c=this.empty(),c&&this.Events.trigger(`empty`),s===0&&this.Events.trigger(`depleted`,c),this._run(n,r,o),this.Promise.resolve(i.weight)):this.Promise.resolve(null)}))})}_drainAll(e,t=0){return this._drainOne(e).then(n=>{var r;return n==null?this.Promise.resolve(t):(r=e==null?e:e-n,this._drainAll(r,t+n))}).catch(e=>this.Events.trigger(`error`,e))}_dropAllQueued(e){return this._queues.shiftAll(function(t){return t.doDrop({message:e})})}stop(t={}){var n,r;return t=le.load(t,this.stopDefaults),r=e=>{var t=()=>{var t=this._states.counts;return t[0]+t[1]+t[2]+t[3]===e};return new this.Promise((e,n)=>t()?e():this.on(`done`,()=>{if(t())return this.removeAllListeners(`done`),e()}))},n=t.dropWaitingJobs?(this._run=function(e,n){return n.doDrop({message:t.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule(()=>this._submitLock.schedule(()=>{var e,n=this._scheduled,i;for(e in n)i=n[e],this.jobStatus(i.job.options.id)===`RUNNING`&&(clearTimeout(i.timeout),clearTimeout(i.expiration),i.job.doDrop({message:t.dropErrorMessage}));return this._dropAllQueued(t.dropErrorMessage),r(0)}))):this.schedule({priority:ie-1,weight:0},()=>r(1)),this._receive=function(n){return n._reject(new e.prototype.BottleneckError(t.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new e.prototype.BottleneckError(`stop() has already been called`)),n}async _addToQueue(t){var n,r,i,a,o,s,c;({args:n,options:a}=t);try{({reachedHWM:o,blocked:r,strategy:c}=await this._store.__submit__(this.queued(),a.weight))}catch(e){return i=e,this.Events.trigger(`debug`,`Could not queue ${a.id}`,{args:n,options:a,error:i}),t.doDrop({error:i}),!1}return r?(t.doDrop(),!0):o&&(s=c===e.prototype.strategy.LEAK?this._queues.shiftLastFrom(a.priority):c===e.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(a.priority+1):c===e.prototype.strategy.OVERFLOW?t:void 0,s?.doDrop(),s==null||c===e.prototype.strategy.OVERFLOW)?(s??t.doDrop(),o):(t.doQueue(o,r),this._queues.push(t),await this._drainAll(),o)}_receive(t){return this._states.jobStatus(t.options.id)==null?(t.doReceive(),this._submitLock.schedule(this._addToQueue,t)):(t._reject(new e.prototype.BottleneckError(`A job with the same id already exists (id=${t.options.id})`)),!1)}submit(...e){var t,n,r,i,a,o,s;return typeof e[0]==`function`?(a=e,[n,...e]=a,[t]=ue.call(e,-1),i=le.load({},this.jobDefaults)):(o=e,[i,n,...e]=o,[t]=ue.call(e,-1),i=le.load(i,this.jobDefaults)),s=(...e)=>new this.Promise(function(t,r){return n(...e,function(...e){return(e[0]==null?t:r)(e)})}),r=new H(s,e,i,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),r.promise.then(function(e){return typeof t==`function`?t(...e):void 0}).catch(function(e){return Array.isArray(e)?typeof t==`function`?t(...e):void 0:typeof t==`function`?t(e):void 0}),this._receive(r)}schedule(...e){var t,n,r;return typeof e[0]==`function`?([r,...e]=e,n={}):[n,r,...e]=e,t=new H(r,e,n,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(t),t.promise}wrap(e){var t=this.schedule.bind(this),n=function(...n){return t(e.bind(this),...n)};return n.withOptions=function(n,...r){return t(n,e,...r)},n}async updateSettings(e={}){return await this._store.__updateSettings__(le.overwrite(e,this.storeDefaults)),le.overwrite(e,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(e=0){return this._store.__incrementReservoir__(e)}}return e.default=e,e.Events=ne,e.version=e.prototype.version=B.version,e.strategy=e.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},e.BottleneckError=e.prototype.BottleneckError=c,e.Group=e.prototype.Group=F,e.RedisConnection=e.prototype.RedisConnection=E,e.IORedisConnection=e.prototype.IORedisConnection=D,e.Batcher=e.prototype.Batcher=z,e.prototype.jobDefaults={priority:V,weight:1,expiration:null,id:``},e.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:e.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},e.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},e.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},e.prototype.instanceDefaults={datastore:`local`,connection:null,id:``,rejectOnDrop:!0,trackDoneStatus:!1,Promise},e.prototype.stopDefaults={enqueueErrorMessage:`This limiter has been stopped and cannot accept new jobs.`,dropWaitingJobs:!0,dropErrorMessage:`This limiter has been stopped.`},e}).call(e);var U=te;return U}))}))(),1),eP=`0.0.0-development`;function tP(e){return e.request!==void 0}async function nP(e,t,n,r){if(!tP(n)||!n?.request.request)throw n;if(n.status>=400&&!e.doNotRetry.includes(n.status)){let i=r.request.retries==null?e.retries:r.request.retries,a=((r.request.retryCount||0)+1)**2;throw t.retry.retryRequest(n,i,a)}throw n}async function rP(e,t,n,r){let i=new $N.default;return i.on(`failed`,function(t,n){let i=~~t.request.request?.retries,a=~~t.request.request?.retryAfter;if(r.request.retryCount=n.retryCount+1,i>n.retryCount)return a*e.retryAfterBaseValue}),i.schedule(iP.bind(null,e,t,n),r)}async function iP(e,t,n,r){let i=await n(r);return i.data&&i.data.errors&&i.data.errors.length>0&&/Something went wrong while executing your query/.test(i.data.errors[0].message)?nP(e,t,new ha(i.data.errors[0].message,500,{request:r,response:i}),r):i}function aP(e,t){let n=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,410,422,451],retries:3},t.retry),r={retry:{retryRequest:(e,t,n)=>(e.request.request=Object.assign({},e.request.request,{retries:t,retryAfter:n}),e)}};return n.enabled&&(e.hook.error(`request`,nP.bind(null,n,r)),e.hook.wrap(`request`,rP.bind(null,n,r))),r}aP.VERSION=eP;var oP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function sP(e,t,n,r,i){return oP(this,void 0,void 0,function*(){let[a,o]=ZN(po),s=yield _o(i,{log:void 0,userAgent:rk(),previews:void 0,retry:a,request:o},aP,QN).request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}`,{owner:n,repo:r,run_id:t,name:e});if(s.status!==200)throw new ak(`Invalid response from GitHub API: ${s.status} (${s?.headers?.[`x-github-request-id`]})`);if(s.data.artifacts.length===0)throw new ok(`Artifact not found for name: ${e} Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. - For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);let c=s.data.artifacts[0];return s.data.artifacts.length>1&&(c=s.data.artifacts.sort((e,t)=>t.id-e.id)[0],G(`More than one artifact found for a single name, returning newest (id: ${c.id})`)),{artifact:{name:c.name,id:c.id,size:c.size_in_bytes,createdAt:c.created_at?new Date(c.created_at):void 0,digest:c.digest}}})}function uP(e){return cP(this,void 0,void 0,function*(){let t=xk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=gk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r,nameFilter:LO.create({value:e})},a=yield t.ListArtifacts(i);if(a.artifacts.length===0)throw new sk(`Artifact not found for name: ${e} + For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);let c=s.data.artifacts[0];return s.data.artifacts.length>1&&(c=s.data.artifacts.sort((e,t)=>t.id-e.id)[0],G(`More than one artifact found for a single name, returning newest (id: ${c.id})`)),{artifact:{name:c.name,id:c.id,size:c.size_in_bytes,createdAt:c.created_at?new Date(c.created_at):void 0,digest:c.digest}}})}function cP(e){return oP(this,void 0,void 0,function*(){let t=bk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=hk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r,nameFilter:IO.create({value:e})},a=yield t.ListArtifacts(i);if(a.artifacts.length===0)throw new ok(`Artifact not found for name: ${e} Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. - For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);let o=a.artifacts[0];return a.artifacts.length>1&&(o=a.artifacts.sort((e,t)=>Number(t.databaseId)-Number(e.databaseId))[0],G(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`)),{artifact:{name:o.name,id:Number(o.databaseId),size:Number(o.size),createdAt:o.createdAt?FO.toDate(o.createdAt):void 0,digest:o.digest?.value}}})}var dP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function fP(e,t,n,r,i){return dP(this,void 0,void 0,function*(){let[a,o]=$N(po),s=_o(i,{log:void 0,userAgent:ik(),previews:void 0,retry:a,request:o},sP,eP),c=yield lP(e,t,n,r,i),l=yield s.rest.actions.deleteArtifact({owner:n,repo:r,artifact_id:c.artifact.id});if(l.status!==204)throw new ok(`Invalid response from GitHub API: ${l.status} (${l?.headers?.[`x-github-request-id`]})`);return{id:c.artifact.id}})}function pP(e){return dP(this,void 0,void 0,function*(){let t=xk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=gk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r,nameFilter:LO.create({value:e})},a=yield t.ListArtifacts(i);if(a.artifacts.length===0)throw new sk(`Artifact not found for name: ${e}`);let o=a.artifacts[0];a.artifacts.length>1&&(o=a.artifacts.sort((e,t)=>Number(t.databaseId)-Number(e.databaseId))[0],G(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`));let s={workflowRunBackendId:o.workflowRunBackendId,workflowJobRunBackendId:o.workflowJobRunBackendId,name:o.name},c=yield t.DeleteArtifact(s);return jr(`Artifact '${e}' (ID: ${c.artifactId}) deleted`),{id:Number(c.artifactId)}})}var mP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const hP=PO(),gP=Math.ceil(hP/100);function _P(e,t,n,r){return mP(this,arguments,void 0,function*(e,t,n,r,i=!1){jr(`Fetching artifact list for workflow run ${e} in repository ${t}/${n}`);let a=[],[o,s]=$N(po),c=_o(r,{log:void 0,userAgent:ik(),previews:void 0,retry:o,request:s},sP,eP),l=1,{data:u}=yield c.request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts`,{owner:t,repo:n,run_id:e,per_page:100,page:l}),d=Math.ceil(u.total_count/100),f=u.total_count;f>hP&&(Ar(`Workflow run ${e} has ${f} artifacts, exceeding the limit of ${hP}. Results will be incomplete as only the first ${hP} artifacts will be returned`),d=gP);for(let e of u.artifacts)a.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):void 0,digest:e.digest});for(l++;l<=d;l++){G(`Fetching page ${l} of artifact list`);let{data:r}=yield c.request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts`,{owner:t,repo:n,run_id:e,per_page:100,page:l});for(let e of r.artifacts)a.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):void 0,digest:e.digest})}return i&&(a=yP(a)),jr(`Found ${a.length} artifact(s)`),{artifacts:a}})}function vP(){return mP(this,arguments,void 0,function*(e=!1){let t=xk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=gk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r},a=(yield t.ListArtifacts(i)).artifacts.map(e=>({name:e.name,id:Number(e.databaseId),size:Number(e.size),createdAt:e.createdAt?FO.toDate(e.createdAt):void 0,digest:e.digest?.value}));return e&&(a=yP(a)),jr(`Found ${a.length} artifact(s)`),{artifacts:a}})}function yP(e){e.sort((e,t)=>t.id-e.id);let t=[],n=new Set;for(let r of e)n.has(r.name)||(t.push(r),n.add(r.name));return t}var bP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},xP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&(o=a.artifacts.sort((e,t)=>Number(t.databaseId)-Number(e.databaseId))[0],G(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`)),{artifact:{name:o.name,id:Number(o.databaseId),size:Number(o.size),createdAt:o.createdAt?PO.toDate(o.createdAt):void 0,digest:o.digest?.value}}})}var lP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function uP(e,t,n,r,i){return lP(this,void 0,void 0,function*(){let[a,o]=ZN(po),s=_o(i,{log:void 0,userAgent:rk(),previews:void 0,retry:a,request:o},aP,QN),c=yield sP(e,t,n,r,i),l=yield s.rest.actions.deleteArtifact({owner:n,repo:r,artifact_id:c.artifact.id});if(l.status!==204)throw new ak(`Invalid response from GitHub API: ${l.status} (${l?.headers?.[`x-github-request-id`]})`);return{id:c.artifact.id}})}function dP(e){return lP(this,void 0,void 0,function*(){let t=bk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=hk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r,nameFilter:IO.create({value:e})},a=yield t.ListArtifacts(i);if(a.artifacts.length===0)throw new ok(`Artifact not found for name: ${e}`);let o=a.artifacts[0];a.artifacts.length>1&&(o=a.artifacts.sort((e,t)=>Number(t.databaseId)-Number(e.databaseId))[0],G(`More than one artifact found for a single name, returning newest (id: ${o.databaseId})`));let s={workflowRunBackendId:o.workflowRunBackendId,workflowJobRunBackendId:o.workflowJobRunBackendId,name:o.name},c=yield t.DeleteArtifact(s);return jr(`Artifact '${e}' (ID: ${c.artifactId}) deleted`),{id:Number(c.artifactId)}})}var fP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const pP=NO(),mP=Math.ceil(pP/100);function hP(e,t,n,r){return fP(this,arguments,void 0,function*(e,t,n,r,i=!1){jr(`Fetching artifact list for workflow run ${e} in repository ${t}/${n}`);let a=[],[o,s]=ZN(po),c=_o(r,{log:void 0,userAgent:rk(),previews:void 0,retry:o,request:s},aP,QN),l=1,{data:u}=yield c.request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts`,{owner:t,repo:n,run_id:e,per_page:100,page:l}),d=Math.ceil(u.total_count/100),f=u.total_count;f>pP&&(Ar(`Workflow run ${e} has ${f} artifacts, exceeding the limit of ${pP}. Results will be incomplete as only the first ${pP} artifacts will be returned`),d=mP);for(let e of u.artifacts)a.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):void 0,digest:e.digest});for(l++;l<=d;l++){G(`Fetching page ${l} of artifact list`);let{data:r}=yield c.request(`GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts`,{owner:t,repo:n,run_id:e,per_page:100,page:l});for(let e of r.artifacts)a.push({name:e.name,id:e.id,size:e.size_in_bytes,createdAt:e.created_at?new Date(e.created_at):void 0,digest:e.digest})}return i&&(a=_P(a)),jr(`Found ${a.length} artifact(s)`),{artifacts:a}})}function gP(){return fP(this,arguments,void 0,function*(e=!1){let t=bk(),{workflowRunBackendId:n,workflowJobRunBackendId:r}=hk(),i={workflowRunBackendId:n,workflowJobRunBackendId:r},a=(yield t.ListArtifacts(i)).artifacts.map(e=>({name:e.name,id:Number(e.databaseId),size:Number(e.size),createdAt:e.createdAt?PO.toDate(e.createdAt):void 0,digest:e.digest?.value}));return e&&(a=_P(a)),jr(`Found ${a.length} artifact(s)`),{artifacts:a}})}function _P(e){e.sort((e,t)=>t.id-e.id);let t=[],n=new Set;for(let r of e)n.has(r.name)||(t.push(r),n.add(r.name));return t}var vP=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},yP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i + +Port to TypeScript Copyright Isaac Z. Schlueter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in @@ -3477,11 +3479,13 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -brace-expansion@2.0.3 +brace-expansion@5.0.5 MIT MIT License -Copyright (c) 2013 Julian Gruber +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -3615,28 +3619,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -concat-map@0.0.1 -MIT -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - core-util-is@1.0.3 MIT Copyright Node.js contributors. All rights reserved. diff --git a/dist/main.js b/dist/main.js index 1b02d5a1..4919e7af 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,7 +1,7 @@ -import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,T as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as T,a as E,b as D,c as O,d as k,f as A,g as j,h as M,i as N,j as P,k as F,l as ee,m as te,n as ne,o as re,p as I,q as ie,r as ae,s as oe,t as se,u as ce,v as le,w as ue,x as de,y as fe,z as pe}from"./artifact-DnDoCHSt.js";import L from"node:process";import*as me from"os";import*as he from"crypto";import*as R from"fs";import*as z from"path";import{ok as ge}from"assert";import*as _e from"util";import{Buffer as ve}from"node:buffer";import*as ye from"node:crypto";import{createHash as be}from"node:crypto";import{pathToFileURL as xe}from"node:url";import*as B from"node:fs/promises";import Se from"node:fs/promises";import*as V from"node:path";import H,{join as Ce}from"node:path";import{spawn as we}from"node:child_process";import*as Te from"node:os";import Ee,{homedir as De}from"node:os";import*as Oe from"stream";function ke(e){switch(e){case`hit`:return`✅ hit`;case`miss`:return`🆕 miss`;case`corrupted`:return`⚠️ corrupted (clean start)`}}function Ae(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}async function je(e,t){let{eventType:n,repo:r,ref:i,runId:a,runUrl:o,metrics:s,agent:c}=e;try{if(S.addHeading(`Fro Bot Agent Run`,2).addTable([[{data:`Field`,header:!0},{data:`Value`,header:!0}],[`Event`,n],[`Repository`,r],[`Ref`,i],[`Run ID`,`[${a}](${o})`],[`Agent`,c],[`Cache Status`,ke(s.cacheStatus)],[`Duration`,s.duration==null?`N/A`:Ae(s.duration)]]),(s.sessionsUsed.length>0||s.sessionsCreated.length>0)&&(S.addHeading(`Sessions`,3),s.sessionsUsed.length>0&&S.addRaw(`**Used:** ${s.sessionsUsed.join(`, `)}\n`),s.sessionsCreated.length>0&&S.addRaw(`**Created:** ${s.sessionsCreated.join(`, `)}\n`)),s.tokenUsage!=null&&(S.addHeading(`Token Usage`,3),S.addTable([[{data:`Metric`,header:!0},{data:`Count`,header:!0}],[`Input`,s.tokenUsage.input.toLocaleString()],[`Output`,s.tokenUsage.output.toLocaleString()],[`Reasoning`,s.tokenUsage.reasoning.toLocaleString()],[`Cache Read`,s.tokenUsage.cache.read.toLocaleString()],[`Cache Write`,s.tokenUsage.cache.write.toLocaleString()]]),s.model!=null&&S.addRaw(`**Model:** ${s.model}\n`),s.cost!=null&&S.addRaw(`**Cost:** $${s.cost.toFixed(4)}\n`)),(s.prsCreated.length>0||s.commitsCreated.length>0||s.commentsPosted>0)&&(S.addHeading(`Created Artifacts`,3),s.prsCreated.length>0&&S.addList([...s.prsCreated]),s.commitsCreated.length>0&&S.addList(s.commitsCreated.map(e=>`Commit \`${e.slice(0,7)}\``)),s.commentsPosted>0&&S.addRaw(`**Comments Posted:** ${s.commentsPosted}\n`)),s.errors.length>0){S.addHeading(`Errors`,3);for(let e of s.errors){let t=e.recoverable?`🔄 Recovered`:`❌ Failed`;S.addRaw(`- **${e.type}** (${t}): ${e.message}\n`)}}await S.write(),t.debug(`Wrote job summary`)}catch(e){let n=d(e);t.warning(`Failed to write job summary`,{error:n}),y(`Failed to write job summary: ${n}`)}}function Me(){let e=0,t=null,n=`miss`,r=[],i=[],a=[],o=[],s=0,c=null,l=null,u=null,d=[];return{start(){e=Date.now()},end(){t=Date.now()},setCacheStatus(e){n=e},addSessionUsed(e){r.includes(e)||r.push(e)},addSessionCreated(e){i.includes(e)||i.push(e)},addPRCreated(e){a.includes(e)||a.push(e)},addCommitCreated(e){o.includes(e)||o.push(e)},incrementComments(){s++},setTokenUsage(e,t,n){c=e,l=t,u=n},recordError(e,t,n){d.push({timestamp:new Date().toISOString(),type:e,message:t,recoverable:n})},getMetrics(){let f=t==null?Date.now()-e:t-e;return Object.freeze({startTime:e,endTime:t,duration:f,cacheStatus:n,sessionsUsed:Object.freeze([...r]),sessionsCreated:Object.freeze([...i]),prsCreated:Object.freeze([...a]),commitsCreated:Object.freeze([...o]),commentsPosted:s,tokenUsage:c,model:l,cost:u,errors:Object.freeze([...d])})}}}function Ne(e){s(`session-id`,e.sessionId??``),s(`cache-status`,e.cacheStatus),s(`duration`,e.duration)}function U(e){let[t,n]=e.split(`/`);if(t==null||n==null||t.length===0||n.length===0)throw Error(`Invalid repository string: ${e}`);return{owner:t,repo:n}}async function Pe(e,t,n,r,i){try{let{owner:a,repo:o}=U(t),{data:s}=await e.rest.reactions.createForIssueComment({owner:a,repo:o,comment_id:n,content:r});return i.debug(`Created comment reaction`,{commentId:n,content:r,reactionId:s.id}),{id:s.id}}catch(e){return i.warning(`Failed to create comment reaction`,{commentId:n,content:r,error:d(e)}),null}}async function Fe(e,t,n,r){try{let{owner:r,repo:i}=U(t),{data:a}=await e.rest.reactions.listForIssueComment({owner:r,repo:i,comment_id:n,per_page:100});return a.map(e=>({id:e.id,content:e.content,userLogin:e.user?.login??null}))}catch(e){return r.warning(`Failed to list comment reactions`,{commentId:n,error:d(e)}),[]}}async function Ie(e,t,n,r,i){try{let{owner:a,repo:o}=U(t);return await e.rest.reactions.deleteForIssueComment({owner:a,repo:o,comment_id:n,reaction_id:r}),i.debug(`Deleted comment reaction`,{commentId:n,reactionId:r}),!0}catch(e){return i.warning(`Failed to delete comment reaction`,{commentId:n,reactionId:r,error:d(e)}),!1}}async function Le(e,t,n,r,i,a){let{owner:o,repo:s}=U(t);try{return await e.rest.issues.createLabel({owner:o,repo:s,name:n,color:r,description:i}),a.debug(`Created label`,{name:n,color:r}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===422?(a.debug(`Label already exists`,{name:n}),!0):(a.warning(`Failed to create label`,{name:n,error:d(e)}),!1)}}async function Re(e,t,n,r,i){try{let{owner:a,repo:o}=U(t);return await e.rest.issues.addLabels({owner:a,repo:o,issue_number:n,labels:[...r]}),i.debug(`Added labels to issue`,{issueNumber:n,labels:r}),!0}catch(e){return i.warning(`Failed to add labels to issue`,{issueNumber:n,labels:r,error:d(e)}),!1}}async function ze(e,t,n,r,i){try{let{owner:a,repo:o}=U(t);return await e.rest.issues.removeLabel({owner:a,repo:o,issue_number:n,name:r}),i.debug(`Removed label from issue`,{issueNumber:n,label:r}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===404?(i.debug(`Label was not present on issue`,{issueNumber:n,label:r}),!0):(i.warning(`Failed to remove label from issue`,{issueNumber:n,label:r,error:d(e)}),!1)}}async function Be(e,t,n){try{let{owner:n,repo:r}=U(t),{data:i}=await e.rest.repos.get({owner:n,repo:r});return i.default_branch}catch(e){return n.warning(`Failed to get default branch`,{repo:t,error:d(e)}),`main`}}const Ve={admin:`OWNER`,maintain:`MEMBER`,write:`COLLABORATOR`,triage:`COLLABORATOR`};async function He(e,t,n,r,i){try{let{data:a}=await e.rest.repos.getCollaboratorPermissionLevel({owner:t,repo:n,username:r}),o=Ve[a.permission]??null;return i.debug(`Resolved sender permission`,{username:r,permission:a.permission,association:o}),o}catch(e){return i.warning(`Failed to resolve sender permission`,{username:r,error:d(e)}),null}}async function Ue(e,t,n){try{let{data:n}=await e.rest.users.getByUsername({username:t});return{id:n.id,login:n.login}}catch(e){return n.debug(`Failed to get user by username`,{username:t,error:d(e)}),null}}const We={maxComments:50,maxCommits:100,maxFiles:100,maxReviews:100,maxBodyBytes:10*1024,maxTotalBytes:100*1024},Ge=`…[truncated]`;function Ke(e,t){if(e.length===0)return{text:``,truncated:!1};let n=new TextEncoder,r=n.encode(e);if(r.length<=t)return{text:e,truncated:!1};let i=t-n.encode(Ge).length;if(i<=0)return{text:Ge,truncated:!0};let a=r.slice(0,i),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);for(;o.length>0&&o.charCodeAt(o.length-1)===65533;)a=a.slice(0,-1),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);return{text:o+Ge,truncated:!0}}function qe(e){return e.length===0?``:`**Labels:** ${e.map(e=>`\`${e.name}\``).join(`, `)}\n`}function Je(e){return e.length===0?``:`**Assignees:** ${e.map(e=>`@${e.login}`).join(`, `)}\n`}function Ye(e){let t=[];t.push(`## Issue #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`);let n=qe(e.labels);n.length>0&&t.push(n.trimEnd());let r=Je(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Body`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Body was truncated due to size limits.*`)),e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),e.commentsTruncated&&(t.push(``),t.push(`*Note: Comments were truncated due to limits.*`)),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` -`)}function Xe(e){let t=[];t.push(`## Pull Request #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`),t.push(`**Base:** ${e.baseBranch} ← **Head:** ${e.headBranch}`),e.isFork&&t.push(`**Fork:** Yes (external contributor)`);let n=qe(e.labels);n.length>0&&t.push(n.trimEnd());let r=Je(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Description`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Description was truncated due to size limits.*`)),e.files.length>0){t.push(``),t.push(`### Files Changed (${e.files.length}${e.filesTruncated?` of ${e.totalFiles}`:``})`),t.push(``),t.push(`| File | +/- |`),t.push(`|------|-----|`);for(let n of e.files)t.push(`| \`${n.path}\` | +${n.additions}/-${n.deletions} |`)}if(e.commits.length>0){t.push(``),t.push(`### Commits (${e.commits.length}${e.commitsTruncated?` of ${e.totalCommits}`:``})`),t.push(``);for(let n of e.commits){let e=n.oid.slice(0,7);t.push(`- \`${e}\` ${n.message.split(` +import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,T as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as ee,a as T,b as E,c as D,d as te,f as O,g as ne,h as k,i as A,j,k as re,l as ie,m as ae,n as oe,o as se,p as M,q as ce,r as le,s as ue,t as de,u as fe,v as pe,w as me,x as he,y as ge,z as _e}from"./artifact-DhOKZxjK.js";import N from"node:process";import*as ve from"os";import*as ye from"crypto";import*as P from"fs";import*as F from"path";import{ok as be}from"assert";import*as xe from"util";import{Buffer as Se}from"node:buffer";import*as Ce from"node:crypto";import{createHash as we}from"node:crypto";import{pathToFileURL as Te}from"node:url";import*as I from"node:fs/promises";import Ee from"node:fs/promises";import*as L from"node:path";import R,{join as z}from"node:path";import{spawn as De}from"node:child_process";import*as Oe from"node:os";import ke,{homedir as Ae}from"node:os";import*as je from"stream";function Me(e){switch(e){case`hit`:return`✅ hit`;case`miss`:return`🆕 miss`;case`corrupted`:return`⚠️ corrupted (clean start)`}}function Ne(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}async function Pe(e,t){let{eventType:n,repo:r,ref:i,runId:a,runUrl:o,metrics:s,agent:c}=e;try{if(S.addHeading(`Fro Bot Agent Run`,2).addTable([[{data:`Field`,header:!0},{data:`Value`,header:!0}],[`Event`,n],[`Repository`,r],[`Ref`,i],[`Run ID`,`[${a}](${o})`],[`Agent`,c],[`Cache Status`,Me(s.cacheStatus)],[`Duration`,s.duration==null?`N/A`:Ne(s.duration)]]),(s.sessionsUsed.length>0||s.sessionsCreated.length>0)&&(S.addHeading(`Sessions`,3),s.sessionsUsed.length>0&&S.addRaw(`**Used:** ${s.sessionsUsed.join(`, `)}\n`),s.sessionsCreated.length>0&&S.addRaw(`**Created:** ${s.sessionsCreated.join(`, `)}\n`)),s.tokenUsage!=null&&(S.addHeading(`Token Usage`,3),S.addTable([[{data:`Metric`,header:!0},{data:`Count`,header:!0}],[`Input`,s.tokenUsage.input.toLocaleString()],[`Output`,s.tokenUsage.output.toLocaleString()],[`Reasoning`,s.tokenUsage.reasoning.toLocaleString()],[`Cache Read`,s.tokenUsage.cache.read.toLocaleString()],[`Cache Write`,s.tokenUsage.cache.write.toLocaleString()]]),s.model!=null&&S.addRaw(`**Model:** ${s.model}\n`),s.cost!=null&&S.addRaw(`**Cost:** $${s.cost.toFixed(4)}\n`)),(s.prsCreated.length>0||s.commitsCreated.length>0||s.commentsPosted>0)&&(S.addHeading(`Created Artifacts`,3),s.prsCreated.length>0&&S.addList([...s.prsCreated]),s.commitsCreated.length>0&&S.addList(s.commitsCreated.map(e=>`Commit \`${e.slice(0,7)}\``)),s.commentsPosted>0&&S.addRaw(`**Comments Posted:** ${s.commentsPosted}\n`)),s.errors.length>0){S.addHeading(`Errors`,3);for(let e of s.errors){let t=e.recoverable?`🔄 Recovered`:`❌ Failed`;S.addRaw(`- **${e.type}** (${t}): ${e.message}\n`)}}await S.write(),t.debug(`Wrote job summary`)}catch(e){let n=d(e);t.warning(`Failed to write job summary`,{error:n}),y(`Failed to write job summary: ${n}`)}}function Fe(){let e=0,t=null,n=`miss`,r=[],i=[],a=[],o=[],s=0,c=null,l=null,u=null,d=[];return{start(){e=Date.now()},end(){t=Date.now()},setCacheStatus(e){n=e},addSessionUsed(e){r.includes(e)||r.push(e)},addSessionCreated(e){i.includes(e)||i.push(e)},addPRCreated(e){a.includes(e)||a.push(e)},addCommitCreated(e){o.includes(e)||o.push(e)},incrementComments(){s++},setTokenUsage(e,t,n){c=e,l=t,u=n},recordError(e,t,n){d.push({timestamp:new Date().toISOString(),type:e,message:t,recoverable:n})},getMetrics(){let f=t==null?Date.now()-e:t-e;return Object.freeze({startTime:e,endTime:t,duration:f,cacheStatus:n,sessionsUsed:Object.freeze([...r]),sessionsCreated:Object.freeze([...i]),prsCreated:Object.freeze([...a]),commitsCreated:Object.freeze([...o]),commentsPosted:s,tokenUsage:c,model:l,cost:u,errors:Object.freeze([...d])})}}}function B(e){s(`session-id`,e.sessionId??``),s(`cache-status`,e.cacheStatus),s(`duration`,e.duration)}function V(e){let[t,n]=e.split(`/`);if(t==null||n==null||t.length===0||n.length===0)throw Error(`Invalid repository string: ${e}`);return{owner:t,repo:n}}async function Ie(e,t,n,r,i){try{let{owner:a,repo:o}=V(t),{data:s}=await e.rest.reactions.createForIssueComment({owner:a,repo:o,comment_id:n,content:r});return i.debug(`Created comment reaction`,{commentId:n,content:r,reactionId:s.id}),{id:s.id}}catch(e){return i.warning(`Failed to create comment reaction`,{commentId:n,content:r,error:d(e)}),null}}async function Le(e,t,n,r){try{let{owner:r,repo:i}=V(t),{data:a}=await e.rest.reactions.listForIssueComment({owner:r,repo:i,comment_id:n,per_page:100});return a.map(e=>({id:e.id,content:e.content,userLogin:e.user?.login??null}))}catch(e){return r.warning(`Failed to list comment reactions`,{commentId:n,error:d(e)}),[]}}async function Re(e,t,n,r,i){try{let{owner:a,repo:o}=V(t);return await e.rest.reactions.deleteForIssueComment({owner:a,repo:o,comment_id:n,reaction_id:r}),i.debug(`Deleted comment reaction`,{commentId:n,reactionId:r}),!0}catch(e){return i.warning(`Failed to delete comment reaction`,{commentId:n,reactionId:r,error:d(e)}),!1}}async function ze(e,t,n,r,i,a){let{owner:o,repo:s}=V(t);try{return await e.rest.issues.createLabel({owner:o,repo:s,name:n,color:r,description:i}),a.debug(`Created label`,{name:n,color:r}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===422?(a.debug(`Label already exists`,{name:n}),!0):(a.warning(`Failed to create label`,{name:n,error:d(e)}),!1)}}async function Be(e,t,n,r,i){try{let{owner:a,repo:o}=V(t);return await e.rest.issues.addLabels({owner:a,repo:o,issue_number:n,labels:[...r]}),i.debug(`Added labels to issue`,{issueNumber:n,labels:r}),!0}catch(e){return i.warning(`Failed to add labels to issue`,{issueNumber:n,labels:r,error:d(e)}),!1}}async function Ve(e,t,n,r,i){try{let{owner:a,repo:o}=V(t);return await e.rest.issues.removeLabel({owner:a,repo:o,issue_number:n,name:r}),i.debug(`Removed label from issue`,{issueNumber:n,label:r}),!0}catch(e){return e instanceof Error&&`status`in e&&e.status===404?(i.debug(`Label was not present on issue`,{issueNumber:n,label:r}),!0):(i.warning(`Failed to remove label from issue`,{issueNumber:n,label:r,error:d(e)}),!1)}}async function He(e,t,n){try{let{owner:n,repo:r}=V(t),{data:i}=await e.rest.repos.get({owner:n,repo:r});return i.default_branch}catch(e){return n.warning(`Failed to get default branch`,{repo:t,error:d(e)}),`main`}}const Ue={admin:`OWNER`,maintain:`MEMBER`,write:`COLLABORATOR`,triage:`COLLABORATOR`};async function We(e,t,n,r,i){try{let{data:a}=await e.rest.repos.getCollaboratorPermissionLevel({owner:t,repo:n,username:r}),o=Ue[a.permission]??null;return i.debug(`Resolved sender permission`,{username:r,permission:a.permission,association:o}),o}catch(e){return i.warning(`Failed to resolve sender permission`,{username:r,error:d(e)}),null}}async function Ge(e,t,n){try{let{data:n}=await e.rest.users.getByUsername({username:t});return{id:n.id,login:n.login}}catch(e){return n.debug(`Failed to get user by username`,{username:t,error:d(e)}),null}}const Ke={maxComments:50,maxCommits:100,maxFiles:100,maxReviews:100,maxBodyBytes:10*1024,maxTotalBytes:100*1024},qe=`…[truncated]`;function H(e,t){if(e.length===0)return{text:``,truncated:!1};let n=new TextEncoder,r=n.encode(e);if(r.length<=t)return{text:e,truncated:!1};let i=t-n.encode(qe).length;if(i<=0)return{text:qe,truncated:!0};let a=r.slice(0,i),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);for(;o.length>0&&o.charCodeAt(o.length-1)===65533;)a=a.slice(0,-1),o=new TextDecoder(`utf-8`,{fatal:!1}).decode(a);return{text:o+qe,truncated:!0}}function Je(e){return e.length===0?``:`**Labels:** ${e.map(e=>`\`${e.name}\``).join(`, `)}\n`}function Ye(e){return e.length===0?``:`**Assignees:** ${e.map(e=>`@${e.login}`).join(`, `)}\n`}function Xe(e){let t=[];t.push(`## Issue #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`);let n=Je(e.labels);n.length>0&&t.push(n.trimEnd());let r=Ye(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Body`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Body was truncated due to size limits.*`)),e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),e.commentsTruncated&&(t.push(``),t.push(`*Note: Comments were truncated due to limits.*`)),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` +`)}function Ze(e){let t=[];t.push(`## Pull Request #${e.number}`),t.push(``),t.push(`**Title:** ${e.title}`),t.push(`**State:** ${e.state}`),t.push(`**Author:** ${e.author??`unknown`}`),t.push(`**Created:** ${e.createdAt}`),t.push(`**Base:** ${e.baseBranch} ← **Head:** ${e.headBranch}`),e.isFork&&t.push(`**Fork:** Yes (external contributor)`);let n=Je(e.labels);n.length>0&&t.push(n.trimEnd());let r=Ye(e.assignees);if(r.length>0&&t.push(r.trimEnd()),t.push(``),t.push(`### Description`),t.push(``),t.push(e.body),e.bodyTruncated&&(t.push(``),t.push(`*Note: Description was truncated due to size limits.*`)),e.files.length>0){t.push(``),t.push(`### Files Changed (${e.files.length}${e.filesTruncated?` of ${e.totalFiles}`:``})`),t.push(``),t.push(`| File | +/- |`),t.push(`|------|-----|`);for(let n of e.files)t.push(`| \`${n.path}\` | +${n.additions}/-${n.deletions} |`)}if(e.commits.length>0){t.push(``),t.push(`### Commits (${e.commits.length}${e.commitsTruncated?` of ${e.totalCommits}`:``})`),t.push(``);for(let n of e.commits){let e=n.oid.slice(0,7);t.push(`- \`${e}\` ${n.message.split(` `)[0]}`)}}if(e.reviews.length>0){t.push(``),t.push(`### Reviews (${e.reviews.length}${e.reviewsTruncated?` of ${e.totalReviews}`:``})`),t.push(``);for(let n of e.reviews)t.push(`**${n.author??`unknown`}** - ${n.state}`),n.body.length>0&&t.push(n.body),t.push(``)}if(e.comments.length>0){t.push(``),t.push(`### Comments (${e.comments.length}${e.commentsTruncated?` of ${e.totalComments}`:``})`),t.push(``);for(let n of e.comments)t.push(`**${n.author??`unknown`}** (${n.createdAt}):`),t.push(n.body),t.push(``)}return t.join(` -`)}function Ze(e){return e.type===`issue`?Ye(e):Xe(e)}async function Qe(e,t,n,r,i,a){try{let[a,o]=await Promise.all([e.rest.issues.get({owner:t,repo:n,issue_number:r}),e.rest.issues.listComments({owner:t,repo:n,issue_number:r,per_page:i.maxComments})]),s=a.data,c=Ke(s.body??``,i.maxBodyBytes),l=o.data.slice(0,i.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),u=(s.labels??[]).filter(e=>typeof e==`object`&&!!e&&`name`in e).map(e=>({name:e.name??``,color:e.color})),d=(s.assignees??[]).map(e=>({login:e?.login??``}));return{type:`issue`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.user?.login??null,createdAt:s.created_at,labels:u,assignees:d,comments:l,commentsTruncated:o.data.length>=i.maxComments,totalComments:o.data.length}}catch(e){return a.warning(`REST issue fallback failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function $e(e,t,n,r,i,a){try{let[o,s,c,l,u]=await Promise.all([e.rest.pulls.get({owner:t,repo:n,pull_number:r}),e.rest.pulls.listCommits({owner:t,repo:n,pull_number:r,per_page:i.maxCommits}),e.rest.pulls.listFiles({owner:t,repo:n,pull_number:r,per_page:i.maxFiles}),e.rest.pulls.listReviews({owner:t,repo:n,pull_number:r,per_page:i.maxReviews}),e.rest.issues.listComments({owner:t,repo:n,issue_number:r,per_page:i.maxComments})]),f=await e.rest.pulls.listRequestedReviewers({owner:t,repo:n,pull_number:r}).catch(e=>(a.warning(`Failed to fetch requested reviewers, defaulting to empty`,{owner:t,repo:n,number:r,error:d(e)}),{data:{users:[],teams:[]}})),p=o.data,m=Ke(p.body??``,i.maxBodyBytes),h=p.base.repo?.owner.login,g=p.head.repo?.owner.login,_=g==null||h!==g,v=u.data.slice(0,i.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),y=s.data.slice(0,i.maxCommits).map(e=>({oid:e.sha,message:e.commit.message,author:e.commit.author?.name??null})),b=c.data.slice(0,i.maxFiles).map(e=>({path:e.filename,additions:e.additions,deletions:e.deletions,status:e.status})),x=l.data.slice(0,i.maxReviews).map(e=>({author:e.user?.login??null,state:e.state,body:e.body??``,createdAt:e.submitted_at??``,comments:[]})),S=(p.labels??[]).map(e=>({name:e.name??``,color:e.color})),C=(p.assignees??[]).map(e=>({login:e?.login??``})),w=(f.data.users??[]).map(e=>e.login),T=(f.data.teams??[]).map(e=>e.name);return{type:`pull_request`,number:p.number,title:p.title,body:m.text,bodyTruncated:m.truncated,state:p.state,author:p.user?.login??null,createdAt:p.created_at,baseBranch:p.base.ref,headBranch:p.head.ref,isFork:_,labels:S,assignees:C,comments:v,commentsTruncated:u.data.length>=i.maxComments,totalComments:u.data.length,commits:y,commitsTruncated:s.data.length>=i.maxCommits,totalCommits:s.data.length,files:b,filesTruncated:c.data.length>=i.maxFiles,totalFiles:c.data.length,reviews:x,reviewsTruncated:l.data.length>=i.maxReviews,totalReviews:l.data.length,authorAssociation:p.author_association,requestedReviewers:w,requestedReviewerTeams:T}}catch(e){return a.warning(`REST pull request fallback failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function et(e,t,n,r,i,a){try{return await e.graphql(` +`)}function Qe(e){return e.type===`issue`?Xe(e):Ze(e)}async function $e(e,t,n,r,i,a){try{let[a,o]=await Promise.all([e.rest.issues.get({owner:t,repo:n,issue_number:r}),e.rest.issues.listComments({owner:t,repo:n,issue_number:r,per_page:i.maxComments})]),s=a.data,c=H(s.body??``,i.maxBodyBytes),l=o.data.slice(0,i.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),u=(s.labels??[]).filter(e=>typeof e==`object`&&!!e&&`name`in e).map(e=>({name:e.name??``,color:e.color})),d=(s.assignees??[]).map(e=>({login:e?.login??``}));return{type:`issue`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.user?.login??null,createdAt:s.created_at,labels:u,assignees:d,comments:l,commentsTruncated:o.data.length>=i.maxComments,totalComments:o.data.length}}catch(e){return a.warning(`REST issue fallback failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function et(e,t,n,r,i,a){try{let[o,s,c,l,u]=await Promise.all([e.rest.pulls.get({owner:t,repo:n,pull_number:r}),e.rest.pulls.listCommits({owner:t,repo:n,pull_number:r,per_page:i.maxCommits}),e.rest.pulls.listFiles({owner:t,repo:n,pull_number:r,per_page:i.maxFiles}),e.rest.pulls.listReviews({owner:t,repo:n,pull_number:r,per_page:i.maxReviews}),e.rest.issues.listComments({owner:t,repo:n,issue_number:r,per_page:i.maxComments})]),f=await e.rest.pulls.listRequestedReviewers({owner:t,repo:n,pull_number:r}).catch(e=>(a.warning(`Failed to fetch requested reviewers, defaulting to empty`,{owner:t,repo:n,number:r,error:d(e)}),{data:{users:[],teams:[]}})),p=o.data,m=H(p.body??``,i.maxBodyBytes),h=p.base.repo?.owner.login,g=p.head.repo?.owner.login,_=g==null||h!==g,v=u.data.slice(0,i.maxComments).map(e=>({id:e.node_id??String(e.id),author:e.user?.login??null,body:e.body??``,createdAt:e.created_at,authorAssociation:e.author_association,isMinimized:!1})),y=s.data.slice(0,i.maxCommits).map(e=>({oid:e.sha,message:e.commit.message,author:e.commit.author?.name??null})),b=c.data.slice(0,i.maxFiles).map(e=>({path:e.filename,additions:e.additions,deletions:e.deletions,status:e.status})),x=l.data.slice(0,i.maxReviews).map(e=>({author:e.user?.login??null,state:e.state,body:e.body??``,createdAt:e.submitted_at??``,comments:[]})),S=(p.labels??[]).map(e=>({name:e.name??``,color:e.color})),C=(p.assignees??[]).map(e=>({login:e?.login??``})),w=(f.data.users??[]).map(e=>e.login),ee=(f.data.teams??[]).map(e=>e.name);return{type:`pull_request`,number:p.number,title:p.title,body:m.text,bodyTruncated:m.truncated,state:p.state,author:p.user?.login??null,createdAt:p.created_at,baseBranch:p.base.ref,headBranch:p.head.ref,isFork:_,labels:S,assignees:C,comments:v,commentsTruncated:u.data.length>=i.maxComments,totalComments:u.data.length,commits:y,commitsTruncated:s.data.length>=i.maxCommits,totalCommits:s.data.length,files:b,filesTruncated:c.data.length>=i.maxFiles,totalFiles:c.data.length,reviews:x,reviewsTruncated:l.data.length>=i.maxReviews,totalReviews:l.data.length,authorAssociation:p.author_association,requestedReviewers:w,requestedReviewerTeams:ee}}catch(e){return a.warning(`REST pull request fallback failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function tt(e,t,n,r,i,a){try{return await e.graphql(` query GetIssue($owner: String!, $repo: String!, $number: Int!, $maxComments: Int!) { repository(owner: $owner, name: $repo) { issue(number: $number) { @@ -31,7 +31,7 @@ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K a } } } -`,{owner:t,repo:n,number:r,maxComments:i})}catch(e){return a.warning(`GraphQL issue query failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function tt(e,t,n,r,i,a,o,s,c){try{return await e.graphql(` +`,{owner:t,repo:n,number:r,maxComments:i})}catch(e){return a.warning(`GraphQL issue query failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function nt(e,t,n,r,i,a,o,s,c){try{return await e.graphql(` query GetPullRequest( $owner: String!, $repo: String!, @@ -119,13 +119,13 @@ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K a } } } -`,{owner:t,repo:n,number:r,maxComments:i,maxCommits:a,maxFiles:o,maxReviews:s})}catch(e){return c.warning(`GraphQL pull request query failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function nt(e,t,n,r,i,a){let o=await et(e,t,n,r,i.maxComments,a);if(o==null)return null;let s=o.repository.issue;if(s==null)return a.debug(`Issue not found`,{owner:t,repo:n,number:r}),null;let c=Ke(s.body??``,i.maxBodyBytes),l=s.comments.nodes.slice(0,i.maxComments),u=s.comments.totalCount>l.length,d=l.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,createdAt:e.createdAt,authorAssociation:e.authorAssociation,isMinimized:e.isMinimized})),f=s.labels.nodes.map(e=>({name:e.name,color:e.color})),p=s.assignees.nodes.map(e=>({login:e.login}));return{type:`issue`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.author?.login??null,createdAt:s.createdAt,labels:f,assignees:p,comments:d,commentsTruncated:u,totalComments:s.comments.totalCount}}async function rt(e,t,n,r,i,a){let o=await tt(e,t,n,r,i.maxComments,i.maxCommits,i.maxFiles,i.maxReviews,a);if(o==null)return null;let s=o.repository.pullRequest;if(s==null)return a.debug(`Pull request not found`,{owner:t,repo:n,number:r}),null;let c=Ke(s.body??``,i.maxBodyBytes),l=s.baseRepository?.owner.login,u=s.headRepository?.owner.login,d=u==null||l!==u,f=s.comments.nodes.slice(0,i.maxComments),p=s.comments.totalCount>f.length,m=f.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,createdAt:e.createdAt,authorAssociation:e.authorAssociation,isMinimized:e.isMinimized})),h=s.commits.nodes.slice(0,i.maxCommits),g=s.commits.totalCount>h.length,_=h.map(e=>({oid:e.commit.oid,message:e.commit.message,author:e.commit.author?.name??null})),v=s.files.nodes.slice(0,i.maxFiles),y=s.files.totalCount>v.length,b=v.map(e=>({path:e.path,additions:e.additions,deletions:e.deletions})),x=s.reviews.nodes.slice(0,i.maxReviews),S=s.reviews.totalCount>x.length,C=x.map(e=>({author:e.author?.login??null,state:e.state,body:e.body,createdAt:e.createdAt,comments:e.comments.nodes.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,path:e.path,line:e.line,createdAt:e.createdAt}))})),w=s.labels.nodes.map(e=>({name:e.name,color:e.color})),T=s.assignees.nodes.map(e=>({login:e.login})),E=s.reviewRequests.nodes.map(e=>`login`in e.requestedReviewer?e.requestedReviewer.login:null).filter(e=>e!=null),D=s.reviewRequests.nodes.map(e=>`name`in e.requestedReviewer?e.requestedReviewer.name:null).filter(e=>e!=null);return{type:`pull_request`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.author?.login??null,createdAt:s.createdAt,baseBranch:s.baseRefName,headBranch:s.headRefName,isFork:d,labels:w,assignees:T,comments:m,commentsTruncated:p,totalComments:s.comments.totalCount,commits:_,commitsTruncated:g,totalCommits:s.commits.totalCount,files:b,filesTruncated:y,totalFiles:s.files.totalCount,reviews:C,reviewsTruncated:S,totalReviews:s.reviews.totalCount,authorAssociation:s.authorAssociation,requestedReviewers:E,requestedReviewerTeams:D}}const W={PER_PAGE:100,MAX_PAGES:50};async function it(e,t,n,r,i){i.debug(`Fetching PR diff`,{prNumber:r});let a=[],o=1,s=!1;for(;o<=W.MAX_PAGES;){let{data:c}=await e.rest.pulls.listFiles({owner:t,repo:n,pull_number:r,per_page:W.PER_PAGE,page:o}),l=c.map(e=>({filename:e.filename,status:e.status,additions:e.additions,deletions:e.deletions,patch:e.patch??null,previousFilename:e.previous_filename??null}));if(a.push(...l),c.lengthW.MAX_PAGES&&(s=!0,i.warning(`PR diff pagination limit reached`,{filesLoaded:a.length,maxPages:W.MAX_PAGES}))}let c=a.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0});return i.debug(`Fetched diff`,{files:a.length,additions:c.additions,deletions:c.deletions,truncated:s}),{files:a,additions:c.additions,deletions:c.deletions,changedFiles:a.length,truncated:s}}async function at(e,t,n,r){if(e.eventType!==`pull_request`)return null;let i=e.target?.number;if(i==null)return r.debug(`No PR number in trigger context, skipping diff collection`),null;let[a,o]=n.split(`/`);if(a==null||o==null)return r.warning(`Invalid repo format, skipping diff collection`,{repo:n}),null;try{let e=await it(t,a,o,i,r),n={changedFiles:e.changedFiles,additions:e.additions,deletions:e.deletions,truncated:e.truncated,files:e.files.slice(0,50).map(e=>({filename:e.filename,status:e.status,additions:e.additions,deletions:e.deletions}))};return r.debug(`Collected diff context`,{files:n.changedFiles,additions:n.additions,deletions:n.deletions,truncated:n.truncated}),n}catch(e){return r.warning(`Failed to fetch PR diff`,{error:d(e)}),null}}async function ot(e){let{logger:t,octokit:n,triggerContext:r,botLogin:i}=e,{repo:a,ref:o,actor:s,runId:c,target:l,author:u,commentBody:d,commentId:f}=r,p=`${a.owner}/${a.repo}`,m=l?.kind===`issue`||l?.kind===`pr`?l.kind:null,h=l?.number??null,g=l?.title??null,_=u?.login??null,v=await at(r,n,p,t),y=await st(n,a.owner,a.repo,h,m,t),b=y?.type===`pull_request`?y:null,x=b?.authorAssociation??null,S=i!=null&&b!=null?b.requestedReviewers.includes(i):!1;return t.info(`Collected agent context`,{eventName:r.eventName,repo:p,issueNumber:h,issueType:m,hasComment:d!=null,hasDiffContext:v!=null,hasHydratedContext:y!=null}),{eventName:r.eventName,repo:p,ref:o,actor:s,runId:String(c),issueNumber:h,issueTitle:g,issueType:m,commentBody:d,commentAuthor:_,commentId:f,defaultBranch:await Be(n,p,t),diffContext:v,hydratedContext:y,authorAssociation:x,isRequestedReviewer:S}}async function st(e,t,n,r,i,a){if(r==null||i==null)return null;let o=We;return i===`issue`?await nt(e,t,n,r,o,a)??Qe(e,t,n,r,o,a):await rt(e,t,n,r,o,a)??$e(e,t,n,r,o,a)}const ct=({onSseError:e,onSseEvent:t,responseTransformer:n,responseValidator:r,sseDefaultRetryDelay:i,sseMaxRetryAttempts:a,sseMaxRetryDelay:o,sseSleepFn:s,url:c,...l})=>{let u,d=s??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let s=i??3e3,f=0,p=l.signal??new AbortController().signal;for(;!p.aborted;){f++;let i=l.headers instanceof Headers?l.headers:new Headers(l.headers);u!==void 0&&i.set(`Last-Event-ID`,u);try{let e=await fetch(c,{...l,headers:i,signal:p});if(!e.ok)throw Error(`SSE failed: ${e.status} ${e.statusText}`);if(!e.body)throw Error(`No body in SSE response`);let a=e.body.pipeThrough(new TextDecoderStream).getReader(),o=``,d=()=>{try{a.cancel()}catch{}};p.addEventListener(`abort`,d);try{for(;;){let{done:e,value:i}=await a.read();if(e)break;o+=i;let c=o.split(` +`,{owner:t,repo:n,number:r,maxComments:i,maxCommits:a,maxFiles:o,maxReviews:s})}catch(e){return c.warning(`GraphQL pull request query failed`,{owner:t,repo:n,number:r,error:d(e)}),null}}async function rt(e,t,n,r,i,a){let o=await tt(e,t,n,r,i.maxComments,a);if(o==null)return null;let s=o.repository.issue;if(s==null)return a.debug(`Issue not found`,{owner:t,repo:n,number:r}),null;let c=H(s.body??``,i.maxBodyBytes),l=s.comments.nodes.slice(0,i.maxComments),u=s.comments.totalCount>l.length,d=l.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,createdAt:e.createdAt,authorAssociation:e.authorAssociation,isMinimized:e.isMinimized})),f=s.labels.nodes.map(e=>({name:e.name,color:e.color})),p=s.assignees.nodes.map(e=>({login:e.login}));return{type:`issue`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.author?.login??null,createdAt:s.createdAt,labels:f,assignees:p,comments:d,commentsTruncated:u,totalComments:s.comments.totalCount}}async function it(e,t,n,r,i,a){let o=await nt(e,t,n,r,i.maxComments,i.maxCommits,i.maxFiles,i.maxReviews,a);if(o==null)return null;let s=o.repository.pullRequest;if(s==null)return a.debug(`Pull request not found`,{owner:t,repo:n,number:r}),null;let c=H(s.body??``,i.maxBodyBytes),l=s.baseRepository?.owner.login,u=s.headRepository?.owner.login,d=u==null||l!==u,f=s.comments.nodes.slice(0,i.maxComments),p=s.comments.totalCount>f.length,m=f.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,createdAt:e.createdAt,authorAssociation:e.authorAssociation,isMinimized:e.isMinimized})),h=s.commits.nodes.slice(0,i.maxCommits),g=s.commits.totalCount>h.length,_=h.map(e=>({oid:e.commit.oid,message:e.commit.message,author:e.commit.author?.name??null})),v=s.files.nodes.slice(0,i.maxFiles),y=s.files.totalCount>v.length,b=v.map(e=>({path:e.path,additions:e.additions,deletions:e.deletions})),x=s.reviews.nodes.slice(0,i.maxReviews),S=s.reviews.totalCount>x.length,C=x.map(e=>({author:e.author?.login??null,state:e.state,body:e.body,createdAt:e.createdAt,comments:e.comments.nodes.map(e=>({id:e.id,author:e.author?.login??null,body:e.body,path:e.path,line:e.line,createdAt:e.createdAt}))})),w=s.labels.nodes.map(e=>({name:e.name,color:e.color})),ee=s.assignees.nodes.map(e=>({login:e.login})),T=s.reviewRequests.nodes.map(e=>`login`in e.requestedReviewer?e.requestedReviewer.login:null).filter(e=>e!=null),E=s.reviewRequests.nodes.map(e=>`name`in e.requestedReviewer?e.requestedReviewer.name:null).filter(e=>e!=null);return{type:`pull_request`,number:s.number,title:s.title,body:c.text,bodyTruncated:c.truncated,state:s.state,author:s.author?.login??null,createdAt:s.createdAt,baseBranch:s.baseRefName,headBranch:s.headRefName,isFork:d,labels:w,assignees:ee,comments:m,commentsTruncated:p,totalComments:s.comments.totalCount,commits:_,commitsTruncated:g,totalCommits:s.commits.totalCount,files:b,filesTruncated:y,totalFiles:s.files.totalCount,reviews:C,reviewsTruncated:S,totalReviews:s.reviews.totalCount,authorAssociation:s.authorAssociation,requestedReviewers:T,requestedReviewerTeams:E}}const U={PER_PAGE:100,MAX_PAGES:50};async function at(e,t,n,r,i){i.debug(`Fetching PR diff`,{prNumber:r});let a=[],o=1,s=!1;for(;o<=U.MAX_PAGES;){let{data:c}=await e.rest.pulls.listFiles({owner:t,repo:n,pull_number:r,per_page:U.PER_PAGE,page:o}),l=c.map(e=>({filename:e.filename,status:e.status,additions:e.additions,deletions:e.deletions,patch:e.patch??null,previousFilename:e.previous_filename??null}));if(a.push(...l),c.lengthU.MAX_PAGES&&(s=!0,i.warning(`PR diff pagination limit reached`,{filesLoaded:a.length,maxPages:U.MAX_PAGES}))}let c=a.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0});return i.debug(`Fetched diff`,{files:a.length,additions:c.additions,deletions:c.deletions,truncated:s}),{files:a,additions:c.additions,deletions:c.deletions,changedFiles:a.length,truncated:s}}async function ot(e,t,n,r){if(e.eventType!==`pull_request`)return null;let i=e.target?.number;if(i==null)return r.debug(`No PR number in trigger context, skipping diff collection`),null;let[a,o]=n.split(`/`);if(a==null||o==null)return r.warning(`Invalid repo format, skipping diff collection`,{repo:n}),null;try{let e=await at(t,a,o,i,r),n={changedFiles:e.changedFiles,additions:e.additions,deletions:e.deletions,truncated:e.truncated,files:e.files.slice(0,50).map(e=>({filename:e.filename,status:e.status,additions:e.additions,deletions:e.deletions}))};return r.debug(`Collected diff context`,{files:n.changedFiles,additions:n.additions,deletions:n.deletions,truncated:n.truncated}),n}catch(e){return r.warning(`Failed to fetch PR diff`,{error:d(e)}),null}}async function st(e){let{logger:t,octokit:n,triggerContext:r,botLogin:i}=e,{repo:a,ref:o,actor:s,runId:c,target:l,author:u,commentBody:d,commentId:f}=r,p=`${a.owner}/${a.repo}`,m=l?.kind===`issue`||l?.kind===`pr`?l.kind:null,h=l?.number??null,g=l?.title??null,_=u?.login??null,v=await ot(r,n,p,t),y=await ct(n,a.owner,a.repo,h,m,t),b=y?.type===`pull_request`?y:null,x=b?.authorAssociation??null,S=i!=null&&b!=null?b.requestedReviewers.includes(i):!1;return t.info(`Collected agent context`,{eventName:r.eventName,repo:p,issueNumber:h,issueType:m,hasComment:d!=null,hasDiffContext:v!=null,hasHydratedContext:y!=null}),{eventName:r.eventName,repo:p,ref:o,actor:s,runId:String(c),issueNumber:h,issueTitle:g,issueType:m,commentBody:d,commentAuthor:_,commentId:f,defaultBranch:await He(n,p,t),diffContext:v,hydratedContext:y,authorAssociation:x,isRequestedReviewer:S}}async function ct(e,t,n,r,i,a){if(r==null||i==null)return null;let o=Ke;return i===`issue`?await rt(e,t,n,r,o,a)??$e(e,t,n,r,o,a):await it(e,t,n,r,o,a)??et(e,t,n,r,o,a)}const lt=({onSseError:e,onSseEvent:t,responseTransformer:n,responseValidator:r,sseDefaultRetryDelay:i,sseMaxRetryAttempts:a,sseMaxRetryDelay:o,sseSleepFn:s,url:c,...l})=>{let u,d=s??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let s=i??3e3,f=0,p=l.signal??new AbortController().signal;for(;!p.aborted;){f++;let i=l.headers instanceof Headers?l.headers:new Headers(l.headers);u!==void 0&&i.set(`Last-Event-ID`,u);try{let e=await fetch(c,{...l,headers:i,signal:p});if(!e.ok)throw Error(`SSE failed: ${e.status} ${e.statusText}`);if(!e.body)throw Error(`No body in SSE response`);let a=e.body.pipeThrough(new TextDecoderStream).getReader(),o=``,d=()=>{try{a.cancel()}catch{}};p.addEventListener(`abort`,d);try{for(;;){let{done:e,value:i}=await a.read();if(e)break;o+=i;let c=o.split(` `);o=c.pop()??``;for(let e of c){let i=e.split(` `),a=[],o;for(let e of i)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))u=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(s=t)}let c,l=!1;if(a.length){let e=a.join(` -`);try{c=JSON.parse(e),l=!0}catch{c=e}}l&&(r&&await r(c),n&&(c=await n(c))),t?.({data:c,event:o,id:u,retry:s}),a.length&&(yield c)}}}finally{p.removeEventListener(`abort`,d),a.releaseLock()}break}catch(t){if(e?.(t),a!==void 0&&f>=a)break;await d(Math.min(s*2**(f-1),o??3e4))}}}()}},lt=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},ut={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)},dt=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},ft=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},pt=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},mt=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(ft(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=dt(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):ht({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},ht=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},gt=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=pt(r),s=Object.entries(i).map(([t,i])=>ht({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},_t=/\{[^{}]+\}/g,vt=({path:e,url:t})=>{let n=t,r=t.match(_t);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,mt({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,gt({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${ht({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},yt=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=vt({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o},bt=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r==`object`)for(let a in r){let o=r[a];if(o!=null)if(Array.isArray(o)){let n=mt({allowReserved:e,explode:!0,name:a,style:`form`,value:o,...t});n&&i.push(n)}else if(typeof o==`object`){let t=gt({allowReserved:e,explode:!0,name:a,style:`deepObject`,value:o,...n});t&&i.push(t)}else{let t=ht({allowReserved:e,name:a,value:o});t&&i.push(t)}}return i.join(`&`)},xt=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},St=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,Ct=async({security:e,...t})=>{for(let n of e){if(St(t,n.name))continue;let e=await lt(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},wt=e=>yt({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:bt(e.querySerializer),url:e.url}),Tt=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Et(e.headers,t.headers),n},Et=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t};var Dt=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}getInterceptorIndex(e){return typeof e==`number`?this._fns[e]?e:-1:this._fns.indexOf(e)}exists(e){let t=this.getInterceptorIndex(e);return!!this._fns[t]}eject(e){let t=this.getInterceptorIndex(e);this._fns[t]&&(this._fns[t]=null)}update(e,t){let n=this.getInterceptorIndex(e);return this._fns[n]?(this._fns[n]=t,e):!1}use(e){return this._fns=[...this._fns,e],this._fns.length-1}};const Ot=()=>({error:new Dt,request:new Dt,response:new Dt}),kt=bt({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),At={"Content-Type":`application/json`},jt=(e={})=>({...ut,headers:At,parseAs:`auto`,querySerializer:kt,...e}),Mt=(e={})=>{let t=Tt(jt(),e),n=()=>({...t}),r=e=>(t=Tt(t,e),n()),i=Ot(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:Et(t.headers,e.headers),serializedBody:void 0};return n.security&&await Ct({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.serializedBody===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`),{opts:n,url:wt(n)}},o=async e=>{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:t.serializedBody},o=new Request(n,r);for(let e of i.request._fns)e&&(o=await e(o,t));let s=t.fetch,c=await s(o);for(let e of i.response._fns)e&&(c=await e(c,o,t));let l={request:o,response:c};if(c.ok){if(c.status===204||c.headers.get(`Content-Length`)===`0`)return t.responseStyle===`data`?{}:{data:{},...l};let e=(t.parseAs===`auto`?xt(c.headers.get(`Content-Type`)):t.parseAs)??`json`,n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`json`:case`text`:n=await c[e]();break;case`stream`:return t.responseStyle===`data`?c.body:{data:c.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await c.text(),d;try{d=JSON.parse(u)}catch{}let f=d??u,p=f;for(let e of i.error._fns)e&&(p=await e(f,c,o,t));if(p||={},t.throwOnError)throw p;return t.responseStyle===`data`?void 0:{error:p,...l}},s=e=>{let t=t=>o({...t,method:e});return t.sse=async t=>{let{opts:n,url:r}=await a(t);return ct({...n,body:n.body,headers:n.headers,method:e,url:r})},t};return{buildUrl:wt,connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,trace:s(`TRACE`)}};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});const Nt=Mt(jt({baseUrl:`http://localhost:4096`}));var G=class{_client=Nt;constructor(e){e?.client&&(this._client=e.client)}},Pt=class extends G{event(e){return(e?.client??this._client).get.sse({url:`/global/event`,...e})}},Ft=class extends G{list(e){return(e?.client??this._client).get({url:`/project`,...e})}current(e){return(e?.client??this._client).get({url:`/project/current`,...e})}},It=class extends G{list(e){return(e?.client??this._client).get({url:`/pty`,...e})}create(e){return(e?.client??this._client).post({url:`/pty`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}remove(e){return(e.client??this._client).delete({url:`/pty/{id}`,...e})}get(e){return(e.client??this._client).get({url:`/pty/{id}`,...e})}update(e){return(e.client??this._client).put({url:`/pty/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}connect(e){return(e.client??this._client).get({url:`/pty/{id}/connect`,...e})}},Lt=class extends G{get(e){return(e?.client??this._client).get({url:`/config`,...e})}update(e){return(e?.client??this._client).patch({url:`/config`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}providers(e){return(e?.client??this._client).get({url:`/config/providers`,...e})}},Rt=class extends G{ids(e){return(e?.client??this._client).get({url:`/experimental/tool/ids`,...e})}list(e){return(e.client??this._client).get({url:`/experimental/tool`,...e})}},zt=class extends G{dispose(e){return(e?.client??this._client).post({url:`/instance/dispose`,...e})}},Bt=class extends G{get(e){return(e?.client??this._client).get({url:`/path`,...e})}},Vt=class extends G{get(e){return(e?.client??this._client).get({url:`/vcs`,...e})}},Ht=class extends G{list(e){return(e?.client??this._client).get({url:`/session`,...e})}create(e){return(e?.client??this._client).post({url:`/session`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}status(e){return(e?.client??this._client).get({url:`/session/status`,...e})}delete(e){return(e.client??this._client).delete({url:`/session/{id}`,...e})}get(e){return(e.client??this._client).get({url:`/session/{id}`,...e})}update(e){return(e.client??this._client).patch({url:`/session/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}children(e){return(e.client??this._client).get({url:`/session/{id}/children`,...e})}todo(e){return(e.client??this._client).get({url:`/session/{id}/todo`,...e})}init(e){return(e.client??this._client).post({url:`/session/{id}/init`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}fork(e){return(e.client??this._client).post({url:`/session/{id}/fork`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}abort(e){return(e.client??this._client).post({url:`/session/{id}/abort`,...e})}unshare(e){return(e.client??this._client).delete({url:`/session/{id}/share`,...e})}share(e){return(e.client??this._client).post({url:`/session/{id}/share`,...e})}diff(e){return(e.client??this._client).get({url:`/session/{id}/diff`,...e})}summarize(e){return(e.client??this._client).post({url:`/session/{id}/summarize`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}messages(e){return(e.client??this._client).get({url:`/session/{id}/message`,...e})}prompt(e){return(e.client??this._client).post({url:`/session/{id}/message`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}message(e){return(e.client??this._client).get({url:`/session/{id}/message/{messageID}`,...e})}promptAsync(e){return(e.client??this._client).post({url:`/session/{id}/prompt_async`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}command(e){return(e.client??this._client).post({url:`/session/{id}/command`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}shell(e){return(e.client??this._client).post({url:`/session/{id}/shell`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}revert(e){return(e.client??this._client).post({url:`/session/{id}/revert`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}unrevert(e){return(e.client??this._client).post({url:`/session/{id}/unrevert`,...e})}},Ut=class extends G{list(e){return(e?.client??this._client).get({url:`/command`,...e})}},Wt=class extends G{authorize(e){return(e.client??this._client).post({url:`/provider/{id}/oauth/authorize`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}callback(e){return(e.client??this._client).post({url:`/provider/{id}/oauth/callback`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}},Gt=class extends G{list(e){return(e?.client??this._client).get({url:`/provider`,...e})}auth(e){return(e?.client??this._client).get({url:`/provider/auth`,...e})}oauth=new Wt({client:this._client})},Kt=class extends G{text(e){return(e.client??this._client).get({url:`/find`,...e})}files(e){return(e.client??this._client).get({url:`/find/file`,...e})}symbols(e){return(e.client??this._client).get({url:`/find/symbol`,...e})}},qt=class extends G{list(e){return(e.client??this._client).get({url:`/file`,...e})}read(e){return(e.client??this._client).get({url:`/file/content`,...e})}status(e){return(e?.client??this._client).get({url:`/file/status`,...e})}},Jt=class extends G{log(e){return(e?.client??this._client).post({url:`/log`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}agents(e){return(e?.client??this._client).get({url:`/agent`,...e})}},Yt=class extends G{remove(e){return(e.client??this._client).delete({url:`/mcp/{name}/auth`,...e})}start(e){return(e.client??this._client).post({url:`/mcp/{name}/auth`,...e})}callback(e){return(e.client??this._client).post({url:`/mcp/{name}/auth/callback`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}authenticate(e){return(e.client??this._client).post({url:`/mcp/{name}/auth/authenticate`,...e})}set(e){return(e.client??this._client).put({url:`/auth/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}},Xt=class extends G{status(e){return(e?.client??this._client).get({url:`/mcp`,...e})}add(e){return(e?.client??this._client).post({url:`/mcp`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}connect(e){return(e.client??this._client).post({url:`/mcp/{name}/connect`,...e})}disconnect(e){return(e.client??this._client).post({url:`/mcp/{name}/disconnect`,...e})}auth=new Yt({client:this._client})},Zt=class extends G{status(e){return(e?.client??this._client).get({url:`/lsp`,...e})}},Qt=class extends G{status(e){return(e?.client??this._client).get({url:`/formatter`,...e})}},$t=class extends G{next(e){return(e?.client??this._client).get({url:`/tui/control/next`,...e})}response(e){return(e?.client??this._client).post({url:`/tui/control/response`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}},en=class extends G{appendPrompt(e){return(e?.client??this._client).post({url:`/tui/append-prompt`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}openHelp(e){return(e?.client??this._client).post({url:`/tui/open-help`,...e})}openSessions(e){return(e?.client??this._client).post({url:`/tui/open-sessions`,...e})}openThemes(e){return(e?.client??this._client).post({url:`/tui/open-themes`,...e})}openModels(e){return(e?.client??this._client).post({url:`/tui/open-models`,...e})}submitPrompt(e){return(e?.client??this._client).post({url:`/tui/submit-prompt`,...e})}clearPrompt(e){return(e?.client??this._client).post({url:`/tui/clear-prompt`,...e})}executeCommand(e){return(e?.client??this._client).post({url:`/tui/execute-command`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}showToast(e){return(e?.client??this._client).post({url:`/tui/show-toast`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}publish(e){return(e?.client??this._client).post({url:`/tui/publish`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}control=new $t({client:this._client})},tn=class extends G{subscribe(e){return(e?.client??this._client).get.sse({url:`/event`,...e})}},nn=class extends G{postSessionIdPermissionsPermissionId(e){return(e.client??this._client).post({url:`/session/{id}/permissions/{permissionID}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}global=new Pt({client:this._client});project=new Ft({client:this._client});pty=new It({client:this._client});config=new Lt({client:this._client});tool=new Rt({client:this._client});instance=new zt({client:this._client});path=new Bt({client:this._client});vcs=new Vt({client:this._client});session=new Ht({client:this._client});command=new Ut({client:this._client});provider=new Gt({client:this._client});find=new Kt({client:this._client});file=new qt({client:this._client});app=new Jt({client:this._client});mcp=new Xt({client:this._client});lsp=new Zt({client:this._client});formatter=new Qt({client:this._client});tui=new en({client:this._client});auth=new Yt({client:this._client});event=new tn({client:this._client})};function rn(e,t){if(e)return t&&(e===t||e===encodeURIComponent(t))?t:e}function an(e,t){if(e.method!==`GET`&&e.method!==`HEAD`)return e;let n=rn(e.headers.get(`x-opencode-directory`),t);if(!n)return e;let r=new URL(e.url);r.searchParams.has(`directory`)||r.searchParams.set(`directory`,n);let i=new Request(r,e);return i.headers.delete(`x-opencode-directory`),i}function on(e){if(!e?.fetch){let t=e=>(e.timeout=!1,fetch(e));e={...e,fetch:t}}e?.directory&&(e.headers={...e.headers,"x-opencode-directory":encodeURIComponent(e.directory)});let t=Mt(e);return t.interceptors.request.use(t=>an(t,e?.directory)),new nn({client:t})}async function sn(e){e=Object.assign({hostname:`127.0.0.1`,port:4096,timeout:5e3},e??{});let t=[`serve`,`--hostname=${e.hostname}`,`--port=${e.port}`];e.config?.logLevel&&t.push(`--log-level=${e.config.logLevel}`);let n=we(`opencode`,t,{signal:e.signal,env:{...process.env,OPENCODE_CONFIG_CONTENT:JSON.stringify(e.config??{})}});return{url:await new Promise((t,r)=>{let i=setTimeout(()=>{r(Error(`Timeout waiting for server to start after ${e.timeout}ms`))},e.timeout),a=``;n.stdout?.on(`data`,e=>{a+=e.toString();let n=a.split(` +`);try{c=JSON.parse(e),l=!0}catch{c=e}}l&&(r&&await r(c),n&&(c=await n(c))),t?.({data:c,event:o,id:u,retry:s}),a.length&&(yield c)}}}finally{p.removeEventListener(`abort`,d),a.releaseLock()}break}catch(t){if(e?.(t),a!==void 0&&f>=a)break;await d(Math.min(s*2**(f-1),o??3e4))}}}()}},ut=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},dt={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)},ft=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},pt=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},mt=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},ht=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(pt(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=ft(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):W({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},W=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},gt=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=mt(r),s=Object.entries(i).map(([t,i])=>W({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},_t=/\{[^{}]+\}/g,vt=({path:e,url:t})=>{let n=t,r=t.match(_t);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,ht({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,gt({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${W({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},yt=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=vt({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o},bt=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r==`object`)for(let a in r){let o=r[a];if(o!=null)if(Array.isArray(o)){let n=ht({allowReserved:e,explode:!0,name:a,style:`form`,value:o,...t});n&&i.push(n)}else if(typeof o==`object`){let t=gt({allowReserved:e,explode:!0,name:a,style:`deepObject`,value:o,...n});t&&i.push(t)}else{let t=W({allowReserved:e,name:a,value:o});t&&i.push(t)}}return i.join(`&`)},xt=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},St=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,Ct=async({security:e,...t})=>{for(let n of e){if(St(t,n.name))continue;let e=await ut(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},wt=e=>yt({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:bt(e.querySerializer),url:e.url}),Tt=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Et(e.headers,t.headers),n},Et=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t};var Dt=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}getInterceptorIndex(e){return typeof e==`number`?this._fns[e]?e:-1:this._fns.indexOf(e)}exists(e){let t=this.getInterceptorIndex(e);return!!this._fns[t]}eject(e){let t=this.getInterceptorIndex(e);this._fns[t]&&(this._fns[t]=null)}update(e,t){let n=this.getInterceptorIndex(e);return this._fns[n]?(this._fns[n]=t,e):!1}use(e){return this._fns=[...this._fns,e],this._fns.length-1}};const Ot=()=>({error:new Dt,request:new Dt,response:new Dt}),kt=bt({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),At={"Content-Type":`application/json`},jt=(e={})=>({...dt,headers:At,parseAs:`auto`,querySerializer:kt,...e}),Mt=(e={})=>{let t=Tt(jt(),e),n=()=>({...t}),r=e=>(t=Tt(t,e),n()),i=Ot(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:Et(t.headers,e.headers),serializedBody:void 0};return n.security&&await Ct({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.serializedBody===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`),{opts:n,url:wt(n)}},o=async e=>{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:t.serializedBody},o=new Request(n,r);for(let e of i.request._fns)e&&(o=await e(o,t));let s=t.fetch,c=await s(o);for(let e of i.response._fns)e&&(c=await e(c,o,t));let l={request:o,response:c};if(c.ok){if(c.status===204||c.headers.get(`Content-Length`)===`0`)return t.responseStyle===`data`?{}:{data:{},...l};let e=(t.parseAs===`auto`?xt(c.headers.get(`Content-Type`)):t.parseAs)??`json`,n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`json`:case`text`:n=await c[e]();break;case`stream`:return t.responseStyle===`data`?c.body:{data:c.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await c.text(),d;try{d=JSON.parse(u)}catch{}let f=d??u,p=f;for(let e of i.error._fns)e&&(p=await e(f,c,o,t));if(p||={},t.throwOnError)throw p;return t.responseStyle===`data`?void 0:{error:p,...l}},s=e=>{let t=t=>o({...t,method:e});return t.sse=async t=>{let{opts:n,url:r}=await a(t);return lt({...n,body:n.body,headers:n.headers,method:e,url:r})},t};return{buildUrl:wt,connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,trace:s(`TRACE`)}};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});const Nt=Mt(jt({baseUrl:`http://localhost:4096`}));var G=class{_client=Nt;constructor(e){e?.client&&(this._client=e.client)}},Pt=class extends G{event(e){return(e?.client??this._client).get.sse({url:`/global/event`,...e})}},Ft=class extends G{list(e){return(e?.client??this._client).get({url:`/project`,...e})}current(e){return(e?.client??this._client).get({url:`/project/current`,...e})}},It=class extends G{list(e){return(e?.client??this._client).get({url:`/pty`,...e})}create(e){return(e?.client??this._client).post({url:`/pty`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}remove(e){return(e.client??this._client).delete({url:`/pty/{id}`,...e})}get(e){return(e.client??this._client).get({url:`/pty/{id}`,...e})}update(e){return(e.client??this._client).put({url:`/pty/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}connect(e){return(e.client??this._client).get({url:`/pty/{id}/connect`,...e})}},Lt=class extends G{get(e){return(e?.client??this._client).get({url:`/config`,...e})}update(e){return(e?.client??this._client).patch({url:`/config`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}providers(e){return(e?.client??this._client).get({url:`/config/providers`,...e})}},Rt=class extends G{ids(e){return(e?.client??this._client).get({url:`/experimental/tool/ids`,...e})}list(e){return(e.client??this._client).get({url:`/experimental/tool`,...e})}},zt=class extends G{dispose(e){return(e?.client??this._client).post({url:`/instance/dispose`,...e})}},Bt=class extends G{get(e){return(e?.client??this._client).get({url:`/path`,...e})}},Vt=class extends G{get(e){return(e?.client??this._client).get({url:`/vcs`,...e})}},Ht=class extends G{list(e){return(e?.client??this._client).get({url:`/session`,...e})}create(e){return(e?.client??this._client).post({url:`/session`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}status(e){return(e?.client??this._client).get({url:`/session/status`,...e})}delete(e){return(e.client??this._client).delete({url:`/session/{id}`,...e})}get(e){return(e.client??this._client).get({url:`/session/{id}`,...e})}update(e){return(e.client??this._client).patch({url:`/session/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}children(e){return(e.client??this._client).get({url:`/session/{id}/children`,...e})}todo(e){return(e.client??this._client).get({url:`/session/{id}/todo`,...e})}init(e){return(e.client??this._client).post({url:`/session/{id}/init`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}fork(e){return(e.client??this._client).post({url:`/session/{id}/fork`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}abort(e){return(e.client??this._client).post({url:`/session/{id}/abort`,...e})}unshare(e){return(e.client??this._client).delete({url:`/session/{id}/share`,...e})}share(e){return(e.client??this._client).post({url:`/session/{id}/share`,...e})}diff(e){return(e.client??this._client).get({url:`/session/{id}/diff`,...e})}summarize(e){return(e.client??this._client).post({url:`/session/{id}/summarize`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}messages(e){return(e.client??this._client).get({url:`/session/{id}/message`,...e})}prompt(e){return(e.client??this._client).post({url:`/session/{id}/message`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}message(e){return(e.client??this._client).get({url:`/session/{id}/message/{messageID}`,...e})}promptAsync(e){return(e.client??this._client).post({url:`/session/{id}/prompt_async`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}command(e){return(e.client??this._client).post({url:`/session/{id}/command`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}shell(e){return(e.client??this._client).post({url:`/session/{id}/shell`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}revert(e){return(e.client??this._client).post({url:`/session/{id}/revert`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}unrevert(e){return(e.client??this._client).post({url:`/session/{id}/unrevert`,...e})}},Ut=class extends G{list(e){return(e?.client??this._client).get({url:`/command`,...e})}},Wt=class extends G{authorize(e){return(e.client??this._client).post({url:`/provider/{id}/oauth/authorize`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}callback(e){return(e.client??this._client).post({url:`/provider/{id}/oauth/callback`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}},Gt=class extends G{list(e){return(e?.client??this._client).get({url:`/provider`,...e})}auth(e){return(e?.client??this._client).get({url:`/provider/auth`,...e})}oauth=new Wt({client:this._client})},Kt=class extends G{text(e){return(e.client??this._client).get({url:`/find`,...e})}files(e){return(e.client??this._client).get({url:`/find/file`,...e})}symbols(e){return(e.client??this._client).get({url:`/find/symbol`,...e})}},qt=class extends G{list(e){return(e.client??this._client).get({url:`/file`,...e})}read(e){return(e.client??this._client).get({url:`/file/content`,...e})}status(e){return(e?.client??this._client).get({url:`/file/status`,...e})}},Jt=class extends G{log(e){return(e?.client??this._client).post({url:`/log`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}agents(e){return(e?.client??this._client).get({url:`/agent`,...e})}},Yt=class extends G{remove(e){return(e.client??this._client).delete({url:`/mcp/{name}/auth`,...e})}start(e){return(e.client??this._client).post({url:`/mcp/{name}/auth`,...e})}callback(e){return(e.client??this._client).post({url:`/mcp/{name}/auth/callback`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}authenticate(e){return(e.client??this._client).post({url:`/mcp/{name}/auth/authenticate`,...e})}set(e){return(e.client??this._client).put({url:`/auth/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}},Xt=class extends G{status(e){return(e?.client??this._client).get({url:`/mcp`,...e})}add(e){return(e?.client??this._client).post({url:`/mcp`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}connect(e){return(e.client??this._client).post({url:`/mcp/{name}/connect`,...e})}disconnect(e){return(e.client??this._client).post({url:`/mcp/{name}/disconnect`,...e})}auth=new Yt({client:this._client})},Zt=class extends G{status(e){return(e?.client??this._client).get({url:`/lsp`,...e})}},Qt=class extends G{status(e){return(e?.client??this._client).get({url:`/formatter`,...e})}},$t=class extends G{next(e){return(e?.client??this._client).get({url:`/tui/control/next`,...e})}response(e){return(e?.client??this._client).post({url:`/tui/control/response`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}},en=class extends G{appendPrompt(e){return(e?.client??this._client).post({url:`/tui/append-prompt`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}openHelp(e){return(e?.client??this._client).post({url:`/tui/open-help`,...e})}openSessions(e){return(e?.client??this._client).post({url:`/tui/open-sessions`,...e})}openThemes(e){return(e?.client??this._client).post({url:`/tui/open-themes`,...e})}openModels(e){return(e?.client??this._client).post({url:`/tui/open-models`,...e})}submitPrompt(e){return(e?.client??this._client).post({url:`/tui/submit-prompt`,...e})}clearPrompt(e){return(e?.client??this._client).post({url:`/tui/clear-prompt`,...e})}executeCommand(e){return(e?.client??this._client).post({url:`/tui/execute-command`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}showToast(e){return(e?.client??this._client).post({url:`/tui/show-toast`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}publish(e){return(e?.client??this._client).post({url:`/tui/publish`,...e,headers:{"Content-Type":`application/json`,...e?.headers}})}control=new $t({client:this._client})},tn=class extends G{subscribe(e){return(e?.client??this._client).get.sse({url:`/event`,...e})}},nn=class extends G{postSessionIdPermissionsPermissionId(e){return(e.client??this._client).post({url:`/session/{id}/permissions/{permissionID}`,...e,headers:{"Content-Type":`application/json`,...e.headers}})}global=new Pt({client:this._client});project=new Ft({client:this._client});pty=new It({client:this._client});config=new Lt({client:this._client});tool=new Rt({client:this._client});instance=new zt({client:this._client});path=new Bt({client:this._client});vcs=new Vt({client:this._client});session=new Ht({client:this._client});command=new Ut({client:this._client});provider=new Gt({client:this._client});find=new Kt({client:this._client});file=new qt({client:this._client});app=new Jt({client:this._client});mcp=new Xt({client:this._client});lsp=new Zt({client:this._client});formatter=new Qt({client:this._client});tui=new en({client:this._client});auth=new Yt({client:this._client});event=new tn({client:this._client})};function rn(e,t){if(e)return t&&(e===t||e===encodeURIComponent(t))?t:e}function an(e,t){if(e.method!==`GET`&&e.method!==`HEAD`)return e;let n=rn(e.headers.get(`x-opencode-directory`),t);if(!n)return e;let r=new URL(e.url);r.searchParams.has(`directory`)||r.searchParams.set(`directory`,n);let i=new Request(r,e);return i.headers.delete(`x-opencode-directory`),i}function on(e){if(!e?.fetch){let t=e=>(e.timeout=!1,fetch(e));e={...e,fetch:t}}e?.directory&&(e.headers={...e.headers,"x-opencode-directory":encodeURIComponent(e.directory)});let t=Mt(e);return t.interceptors.request.use(t=>an(t,e?.directory)),new nn({client:t})}async function sn(e){e=Object.assign({hostname:`127.0.0.1`,port:4096,timeout:5e3},e??{});let t=[`serve`,`--hostname=${e.hostname}`,`--port=${e.port}`];e.config?.logLevel&&t.push(`--log-level=${e.config.logLevel}`);let n=De(`opencode`,t,{signal:e.signal,env:{...process.env,OPENCODE_CONFIG_CONTENT:JSON.stringify(e.config??{})}});return{url:await new Promise((t,r)=>{let i=setTimeout(()=>{r(Error(`Timeout waiting for server to start after ${e.timeout}ms`))},e.timeout),a=``;n.stdout?.on(`data`,e=>{a+=e.toString();let n=a.split(` `);for(let e of n)if(e.startsWith(`opencode server listening`)){let n=e.match(/on\s+(https?:\/\/[^\s]+)/);if(!n)throw Error(`Failed to parse server url from output: ${e}`);clearTimeout(i),t(n[1]);return}}),n.stderr?.on(`data`,e=>{a+=e.toString()}),n.on(`exit`,e=>{clearTimeout(i);let t=`Server exited with code ${e}`;a.trim()&&(t+=`\nServer output: ${a}`),r(Error(t))}),n.on(`error`,e=>{clearTimeout(i),r(e)}),e.signal&&e.signal.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Aborted`))})}),close(){n.kill()}}}async function cn(e){let t=await sn({...e});return{client:on({baseUrl:t.url}),server:t}}async function ln(e,t,n,r){if(n!=null)try{let i=await e.session.update({path:{id:t},body:{title:n}});i.error!=null&&r.warning(`Best-effort session title re-assertion failed`,{sessionId:t,sessionTitle:n,error:String(i.error)})}catch(e){r.warning(`Best-effort session title re-assertion failed`,{sessionId:t,sessionTitle:n,error:e instanceof Error?e.message:String(e)})}}async function un(e){if(e<0||!Number.isFinite(e))throw Error(`Invalid sleep duration: ${e}`);return new Promise(t=>setTimeout(t,e))}const dn={api_error:`API Error`,configuration:`Configuration Error`,internal:`Internal Error`,llm_fetch_error:`LLM Fetch Error`,llm_timeout:`LLM Timeout`,permission:`Permission Error`,rate_limit:`Rate Limit`,validation:`Validation Error`};function fn(e){return e.type===`rate_limit`?`:warning:`:e.type===`llm_timeout`?`:hourglass:`:e.type===`llm_fetch_error`||e.retryable?`:warning:`:`:x:`}function pn(e){let t=fn(e),n=dn[e.type],r=[];return r.push(`${t} **${n}**`),r.push(``),r.push(e.message),e.details!=null&&(r.push(``),r.push(`> ${e.details}`)),e.suggestedAction!=null&&(r.push(``),r.push(`**Suggested action:** ${e.suggestedAction}`)),e.retryable&&(r.push(``),r.push(`_This error is retryable._`)),e.resetTime!=null&&(r.push(``),r.push(`_Rate limit resets at: ${e.resetTime.toISOString()}_`)),r.join(` -`)}function mn(e,t,n,r){return{type:e,message:t,retryable:n,details:r?.details,suggestedAction:r?.suggestedAction,resetTime:r?.resetTime}}const hn=[/fetch failed/i,/connect\s*timeout/i,/connecttimeouterror/i,/timed?\s*out/i,/econnrefused/i,/econnreset/i,/etimedout/i,/network error/i];function gn(e){if(e==null)return!1;let t=``;if(typeof e==`string`)t=e;else if(e instanceof Error)t=e.message,`cause`in e&&typeof e.cause==`string`&&(t+=` ${e.cause}`);else if(typeof e==`object`){let n=e;typeof n.message==`string`&&(t=n.message),typeof n.cause==`string`&&(t+=` ${n.cause}`)}return hn.some(e=>e.test(t))}function _n(e,t){return mn(`llm_fetch_error`,`LLM request failed: ${e}`,!0,{details:t==null?void 0:`Model: ${t}`,suggestedAction:`This is a transient network error. The request may succeed on retry, or try a different model.`})}function vn(e,t){return mn(`configuration`,`Agent error: ${e}`,!1,{details:t==null?void 0:`Requested agent: ${t}`,suggestedAction:`Verify the agent name is correct and the required plugins (e.g., oMo) are installed.`})}async function yn(e,t,n,r,i,a=p,o){let s=Date.now(),c=0;for(;!r.aborted;){if(await un(500),r.aborted)return{completed:!1,error:`Aborted`};if(o?.sessionError==null)c=0;else{if(c++,c>=3)return i.error(`Session error persisted through grace period`,{sessionId:t,error:o.sessionError,graceCycles:c}),{completed:!1,error:`Session error: ${o.sessionError}`};continue}if(o?.sessionIdle===!0)return i.debug(`Session idle detected via event stream`,{sessionId:t}),{completed:!0,error:null};let l=Date.now()-s;if(a>0&&l>=a)return i.warning(`Poll timeout reached`,{elapsedMs:l,maxPollTimeMs:a}),{completed:!1,error:`Poll timeout after ${l}ms`};try{let r=((await e.session.status({query:{directory:n}})).data??{})[t];if(r==null)i.debug(`Session status not found in poll response`,{sessionId:t});else if(r.type===`idle`)return i.debug(`Session idle detected via polling`,{sessionId:t}),{completed:!0,error:null};else i.debug(`Session status`,{sessionId:t,type:r.type});if(o!=null&&!o.firstMeaningfulEventReceived){let e=Date.now()-s;if(e>=9e4)return i.error(`No agent activity detected — server may have crashed during prompt processing`,{elapsedMs:e,sessionId:t}),{completed:!1,error:`No agent activity detected after ${e}ms — server may have crashed during prompt processing`}}}catch(e){i.debug(`Poll request failed`,{error:d(e)})}}return{completed:!1,error:`Aborted`}}async function bn(e,t=2e3){await Promise.race([e,new Promise(e=>{setTimeout(e,t)})])}function xn(e){try{let t=new URL(e);return t.hostname===`github.com`||t.hostname===`api.github.com`}catch{return!1}}function Sn(e){try{let t=new URL(e);return t.hostname===`github.com`&&(t.pathname.startsWith(`/user-attachments/assets/`)||t.pathname.startsWith(`/user-attachments/files/`))}catch{return!1}}function Cn(e){let t=e.match(/https:\/\/github\.com\/[a-zA-Z0-9-]+\/[\w.-]+\/(?:pull|issues)\/\d+(?:#issuecomment-\d+)?/g)??[];return[...new Set(t)].filter(xn)}function wn(e){let t=/\[[\w-]+\s+([a-f0-9]{7,40})\]/g,n=[];for(let r of e.matchAll(t))r[1]!=null&&n.push(r[1]);return[...new Set(n)]}const Tn={todowrite:[`Todo`,`\x1B[33m\x1B[1m`],todoread:[`Todo`,`\x1B[33m\x1B[1m`],bash:[`Bash`,`\x1B[31m\x1B[1m`],edit:[`Edit`,`\x1B[32m\x1B[1m`],glob:[`Glob`,`\x1B[34m\x1B[1m`],grep:[`Grep`,`\x1B[34m\x1B[1m`],list:[`List`,`\x1B[34m\x1B[1m`],read:[`Read`,`\x1B[35m\x1B[1m`],write:[`Write`,`\x1B[32m\x1B[1m`],websearch:[`Search`,`\x1B[2m\x1B[1m`]},En=`\x1B[0m`;function Dn(){return L.env.NO_COLOR==null}function On(e,t){let[n,r]=Tn[e.toLowerCase()]??[e,`\x1B[36m\x1B[1m`],i=n.padEnd(10,` `);Dn()?L.stdout.write(`\n${r}|${En} ${i} ${En}${t}\n`):L.stdout.write(`\n| ${i} ${t}\n`)}function kn(e){L.stdout.write(`\n${e}\n`)}function An(e,t){t.debug(`Server event`,{eventType:e.type,properties:e.properties})}function jn(e,t,n,r,i){let a=Cn(t);if(e.includes(`gh pr create`)){let e=a.filter(e=>e.includes(`/pull/`)&&!e.includes(`#`));for(let t of e)n.includes(t)||n.push(t)}if(e.includes(`git commit`)){let e=wn(t);for(let t of e)r.includes(t)||r.push(t)}(e.includes(`gh issue comment`)||e.includes(`gh pr comment`))&&a.some(e=>e.includes(`#issuecomment`))&&i()}async function Mn(e,t,n,r,i){let a=``,o=null,s=null,c=null,l=[],u=[],d=0,f=null;for await(let p of e){if(n.aborted)break;if(An(p,r),p.type===`message.part.updated`){let e=p.properties.part;if(e.sessionID!==t)continue;if(i!=null&&(i.firstMeaningfulEventReceived=!0),e.type===`text`&&`text`in e&&typeof e.text==`string`){a=e.text;let t=`time`in e?e.time?.end:void 0;t!=null&&Number.isFinite(t)&&(kn(a),a=``)}else if(e.type===`tool`){let t=e.state;t.status===`completed`&&(On(e.tool,t.title),e.tool.toLowerCase()===`bash`&&jn(String(t.input.command??t.input.cmd??``),String(t.output),l,u,()=>{d++}))}}else if(p.type===`message.updated`){let e=p.properties.info;e.sessionID===t&&e.role===`assistant`&&e.tokens!=null&&(i!=null&&(i.firstMeaningfulEventReceived=!0),o={input:e.tokens.input??0,output:e.tokens.output??0,reasoning:e.tokens.reasoning??0,cache:{read:e.tokens.cache?.read??0,write:e.tokens.cache?.write??0}},s=e.modelID??null,c=e.cost??null,r.debug(`Token usage received`,{tokens:o,model:s,cost:c}))}else if(p.type===`session.error`){if(p.properties.sessionID===t){let e=p.properties.error,t=typeof e==`string`?e:String(e);r.error(`Session error`,{error:e}),f=gn(e)?_n(t,s??void 0):vn(t),i!=null&&(i.sessionError=t)}}else p.type===`session.idle`&&p.properties.sessionID===t&&(i!=null&&(i.sessionIdle=!0),a.length>0&&(kn(a),a=``))}return a.length>0&&kn(a),{tokens:o,model:s,cost:c,prsCreated:l,commitsCreated:u,commentsPosted:d,llmError:f}}const Nn=5e3;async function Pn(e,t,n,r,i){let a=new AbortController,o={firstMeaningfulEventReceived:!1,sessionIdle:!1,sessionError:null},s=await e.event.subscribe(),c={tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null},l=Mn(s.stream,t,a.signal,i,o).then(e=>{c=e}).catch(e=>{e instanceof Error&&e.name!==`AbortError`&&i.debug(`Event stream error`,{error:e.message})}),u=async()=>{a.abort(),await bn(l)};try{let s=await yn(e,t,n,a.signal,i,r,o);if(await u(),!s.completed){let e=s.error??`Session did not reach idle state`;return i.error(`Session completion polling failed`,{error:e,sessionId:t}),{success:!1,error:e,llmError:c.llmError,shouldRetry:c.llmError!=null,eventStreamResult:c}}return{success:!0,error:null,llmError:null,shouldRetry:!1,eventStreamResult:c}}finally{a.abort(),await bn(l)}}const Fn=e=>{if(e?.model!=null)return{providerID:e.model.providerID,modelID:e.model.modelID};if(!(e!=null&&Object.values(e.omoProviders).some(e=>e!==`no`)))return{providerID:ue.providerID,modelID:ue.modelID}};async function In(e,t,n,r,i,a,o){let s={parts:[{type:`text`,text:n},...r??[]]},c=Fn(a);c!=null&&(s.model=c);let l=a?.agent??`sisyphus`;l!==`sisyphus`&&(s.agent=l);let u=await e.session.promptAsync({path:{id:t},body:s,query:{directory:i}});if(u.error!=null){let e=String(u.error),t=gn(u.error)?_n(e):null;return{success:!1,error:e,llmError:t,shouldRetry:t!=null,eventStreamResult:{tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:t}}}return Pn(e,t,i,a?.timeoutMs??18e5,o)}function Ln(){return[`## Critical Rules (NON-NEGOTIABLE)`,`- You are a NON-INTERACTIVE CI agent. Do NOT ask questions. Make decisions autonomously.`,`- Post EXACTLY ONE comment or review per invocation. Never multiple.`,`- Include the Run Summary marker block in your comment.`,"- Use `gh` CLI for all GitHub operations. Do not use the GitHub API directly.",`- Mark your comment with the bot identification marker.`].join(` +`)}function mn(e,t,n,r){return{type:e,message:t,retryable:n,details:r?.details,suggestedAction:r?.suggestedAction,resetTime:r?.resetTime}}const hn=[/fetch failed/i,/connect\s*timeout/i,/connecttimeouterror/i,/timed?\s*out/i,/econnrefused/i,/econnreset/i,/etimedout/i,/network error/i];function gn(e){if(e==null)return!1;let t=``;if(typeof e==`string`)t=e;else if(e instanceof Error)t=e.message,`cause`in e&&typeof e.cause==`string`&&(t+=` ${e.cause}`);else if(typeof e==`object`){let n=e;typeof n.message==`string`&&(t=n.message),typeof n.cause==`string`&&(t+=` ${n.cause}`)}return hn.some(e=>e.test(t))}function _n(e,t){return mn(`llm_fetch_error`,`LLM request failed: ${e}`,!0,{details:t==null?void 0:`Model: ${t}`,suggestedAction:`This is a transient network error. The request may succeed on retry, or try a different model.`})}function vn(e,t){return mn(`configuration`,`Agent error: ${e}`,!1,{details:t==null?void 0:`Requested agent: ${t}`,suggestedAction:`Verify the agent name is correct and the required plugins (e.g., oMo) are installed.`})}async function yn(e,t,n,r,i,a=p,o){let s=Date.now(),c=0;for(;!r.aborted;){if(await un(500),r.aborted)return{completed:!1,error:`Aborted`};if(o?.sessionError==null)c=0;else{if(c++,c>=3)return i.error(`Session error persisted through grace period`,{sessionId:t,error:o.sessionError,graceCycles:c}),{completed:!1,error:`Session error: ${o.sessionError}`};continue}if(o?.sessionIdle===!0)return i.debug(`Session idle detected via event stream`,{sessionId:t}),{completed:!0,error:null};let l=Date.now()-s;if(a>0&&l>=a)return i.warning(`Poll timeout reached`,{elapsedMs:l,maxPollTimeMs:a}),{completed:!1,error:`Poll timeout after ${l}ms`};try{let r=((await e.session.status({query:{directory:n}})).data??{})[t];if(r==null)i.debug(`Session status not found in poll response`,{sessionId:t});else if(r.type===`idle`)return i.debug(`Session idle detected via polling`,{sessionId:t}),{completed:!0,error:null};else i.debug(`Session status`,{sessionId:t,type:r.type});if(o!=null&&!o.firstMeaningfulEventReceived){let e=Date.now()-s;if(e>=9e4)return i.error(`No agent activity detected — server may have crashed during prompt processing`,{elapsedMs:e,sessionId:t}),{completed:!1,error:`No agent activity detected after ${e}ms — server may have crashed during prompt processing`}}}catch(e){i.debug(`Poll request failed`,{error:d(e)})}}return{completed:!1,error:`Aborted`}}async function bn(e,t=2e3){await Promise.race([e,new Promise(e=>{setTimeout(e,t)})])}function xn(e){try{let t=new URL(e);return t.hostname===`github.com`||t.hostname===`api.github.com`}catch{return!1}}function Sn(e){try{let t=new URL(e);return t.hostname===`github.com`&&(t.pathname.startsWith(`/user-attachments/assets/`)||t.pathname.startsWith(`/user-attachments/files/`))}catch{return!1}}function Cn(e){let t=e.match(/https:\/\/github\.com\/[a-zA-Z0-9-]+\/[\w.-]+\/(?:pull|issues)\/\d+(?:#issuecomment-\d+)?/g)??[];return[...new Set(t)].filter(xn)}function wn(e){let t=/\[[\w-]+\s+([a-f0-9]{7,40})\]/g,n=[];for(let r of e.matchAll(t))r[1]!=null&&n.push(r[1]);return[...new Set(n)]}const Tn={todowrite:[`Todo`,`\x1B[33m\x1B[1m`],todoread:[`Todo`,`\x1B[33m\x1B[1m`],bash:[`Bash`,`\x1B[31m\x1B[1m`],edit:[`Edit`,`\x1B[32m\x1B[1m`],glob:[`Glob`,`\x1B[34m\x1B[1m`],grep:[`Grep`,`\x1B[34m\x1B[1m`],list:[`List`,`\x1B[34m\x1B[1m`],read:[`Read`,`\x1B[35m\x1B[1m`],write:[`Write`,`\x1B[32m\x1B[1m`],websearch:[`Search`,`\x1B[2m\x1B[1m`]},En=`\x1B[0m`;function Dn(){return N.env.NO_COLOR==null}function On(e,t){let[n,r]=Tn[e.toLowerCase()]??[e,`\x1B[36m\x1B[1m`],i=n.padEnd(10,` `);Dn()?N.stdout.write(`\n${r}|${En} ${i} ${En}${t}\n`):N.stdout.write(`\n| ${i} ${t}\n`)}function kn(e){N.stdout.write(`\n${e}\n`)}function An(e,t){t.debug(`Server event`,{eventType:e.type,properties:e.properties})}function jn(e,t,n,r,i){let a=Cn(t);if(e.includes(`gh pr create`)){let e=a.filter(e=>e.includes(`/pull/`)&&!e.includes(`#`));for(let t of e)n.includes(t)||n.push(t)}if(e.includes(`git commit`)){let e=wn(t);for(let t of e)r.includes(t)||r.push(t)}(e.includes(`gh issue comment`)||e.includes(`gh pr comment`))&&a.some(e=>e.includes(`#issuecomment`))&&i()}async function Mn(e,t,n,r,i){let a=``,o=null,s=null,c=null,l=[],u=[],d=0,f=null;for await(let p of e){if(n.aborted)break;if(An(p,r),p.type===`message.part.updated`){let e=p.properties.part;if(e.sessionID!==t)continue;if(i!=null&&(i.firstMeaningfulEventReceived=!0),e.type===`text`&&`text`in e&&typeof e.text==`string`){a=e.text;let t=`time`in e?e.time?.end:void 0;t!=null&&Number.isFinite(t)&&(kn(a),a=``)}else if(e.type===`tool`){let t=e.state;t.status===`completed`&&(On(e.tool,t.title),e.tool.toLowerCase()===`bash`&&jn(String(t.input.command??t.input.cmd??``),String(t.output),l,u,()=>{d++}))}}else if(p.type===`message.updated`){let e=p.properties.info;e.sessionID===t&&e.role===`assistant`&&e.tokens!=null&&(i!=null&&(i.firstMeaningfulEventReceived=!0),o={input:e.tokens.input??0,output:e.tokens.output??0,reasoning:e.tokens.reasoning??0,cache:{read:e.tokens.cache?.read??0,write:e.tokens.cache?.write??0}},s=e.modelID??null,c=e.cost??null,r.debug(`Token usage received`,{tokens:o,model:s,cost:c}))}else if(p.type===`session.error`){if(p.properties.sessionID===t){let e=p.properties.error,t=typeof e==`string`?e:String(e);r.error(`Session error`,{error:e}),f=gn(e)?_n(t,s??void 0):vn(t),i!=null&&(i.sessionError=t)}}else p.type===`session.idle`&&p.properties.sessionID===t&&(i!=null&&(i.sessionIdle=!0),a.length>0&&(kn(a),a=``))}return a.length>0&&kn(a),{tokens:o,model:s,cost:c,prsCreated:l,commitsCreated:u,commentsPosted:d,llmError:f}}const Nn=5e3;async function Pn(e,t,n,r,i){let a=new AbortController,o={firstMeaningfulEventReceived:!1,sessionIdle:!1,sessionError:null},s=await e.event.subscribe(),c={tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null},l=Mn(s.stream,t,a.signal,i,o).then(e=>{c=e}).catch(e=>{e instanceof Error&&e.name!==`AbortError`&&i.debug(`Event stream error`,{error:e.message})}),u=async()=>{a.abort(),await bn(l)};try{let s=await yn(e,t,n,a.signal,i,r,o);if(await u(),!s.completed){let e=s.error??`Session did not reach idle state`;return i.error(`Session completion polling failed`,{error:e,sessionId:t}),{success:!1,error:e,llmError:c.llmError,shouldRetry:c.llmError!=null,eventStreamResult:c}}return{success:!0,error:null,llmError:null,shouldRetry:!1,eventStreamResult:c}}finally{a.abort(),await bn(l)}}const Fn=e=>{if(e?.model!=null)return{providerID:e.model.providerID,modelID:e.model.modelID};if(!(e!=null&&Object.values(e.omoProviders).some(e=>e!==`no`)))return{providerID:me.providerID,modelID:me.modelID}};async function In(e,t,n,r,i,a,o){let s={parts:[{type:`text`,text:n},...r??[]]},c=Fn(a);c!=null&&(s.model=c);let l=a?.agent??`sisyphus`;l!==`sisyphus`&&(s.agent=l);let u=await e.session.promptAsync({path:{id:t},body:s,query:{directory:i}});if(u.error!=null){let e=String(u.error),t=gn(u.error)?_n(e):null;return{success:!1,error:e,llmError:t,shouldRetry:t!=null,eventStreamResult:{tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:t}}}return Pn(e,t,i,a?.timeoutMs??18e5,o)}function Ln(){return[`## Critical Rules (NON-NEGOTIABLE)`,`- You are a NON-INTERACTIVE CI agent. Do NOT ask questions. Make decisions autonomously.`,`- Post EXACTLY ONE comment or review per invocation. Never multiple.`,`- Include the Run Summary marker block in your comment.`,"- Use `gh` CLI for all GitHub operations. Do not use the GitHub API directly.",`- Mark your comment with the bot identification marker.`].join(` `)}function Rn(e,t,n){if(e==null)return``;let r=[`## Thread Identity`];return r.push(`**Logical Thread**: \`${e.key}\` (${e.entityType} #${e.entityId})`),t?(r.push(`**Status**: Continuing previous conversation thread.`),n!=null&&n.length>0&&(r.push(``),r.push(`**Thread Summary**:`),r.push(n))):r.push(`**Status**: Fresh conversation — no prior thread found for this entity.`),r.join(` `)}function zn(e){return e==null||e.length===0?``:[`## Current Thread Context`,`This is work from your PREVIOUS runs on this same entity:`,``,e].join(` `)}function Bn(){return[`## Reminder: Critical Rules`,"- ONE comment/review only. Include Run Summary marker. Use `gh` CLI only."].join(` @@ -159,7 +159,7 @@ ${r.trim()} - **Number:** #${n.issueNumber} - **Title:** ${n.issueTitle??`N/A`} - **Type:** ${n.issueType??`unknown`} -`)}if(n.diffContext!=null&&l.push(Yn(n.diffContext)),n.hydratedContext!=null&&l.push(Ze(n.hydratedContext)),a!=null){let e=Jn(a,u,c,f!=null);e!=null&&l.push(e)}l.push(`# Agent Context +`)}if(n.diffContext!=null&&l.push(Yn(n.diffContext)),n.hydratedContext!=null&&l.push(Qe(n.hydratedContext)),a!=null){let e=Jn(a,u,c,f!=null);e!=null&&l.push(e)}l.push(`# Agent Context You are the Fro Bot Agent running in a non-interactive CI environment (GitHub Actions). @@ -257,13 +257,13 @@ Every response you post — regardless of channel (issue, PR, discussion, review `)}function qn(e,t){let n=e.filter(e=>e.sessionId===t);if(n.length===0)return null;let r=[];for(let e of n.slice(0,1)){r.push(`**Session ${e.sessionId}:**`),r.push("```markdown");for(let t of e.matches.slice(0,3))r.push(`- ${t.excerpt}`);r.push("```")}return r.join(` `)}function Jn(e,t,n,r){if(t&&n!=null){let t=e.priorWorkContext.filter(e=>e.sessionId!==n);return e.recentSessions.length===0&&t.length===0?null:Kn(e,`## Related Historical Context`,t)}return e.recentSessions.length===0&&e.priorWorkContext.length===0&&r?null:Kn(e,`## Prior Session Context`,e.priorWorkContext)}function Yn(e){let t=[`## Pull Request Diff Summary`];if(t.push(``),t.push(`- **Changed Files:** ${e.changedFiles}`),t.push(`- **Additions:** +${e.additions}`),t.push(`- **Deletions:** -${e.deletions}`),e.truncated&&t.push(`- **Note:** Diff was truncated due to size limits`),e.files.length>0){t.push(``),t.push(`### Changed Files`),t.push(`| File | Status | +/- |`),t.push(`|------|--------|-----|`);for(let n of e.files.slice(0,20))t.push(`| \`${n.filename}\` | ${n.status} | +${n.additions}/-${n.deletions} |`);e.files.length>20&&t.push(`| ... | | +${e.files.length-20} more files |`)}return t.push(``),t.join(` `)}function Xn(e){let t=[`## Output Contract`,``];return t.push(`- Review action: approve/request-changes if confident; otherwise comment-only`),t.push(`- Requested reviewer: ${e.isRequestedReviewer?`yes`:`no`}`),e.authorAssociation!=null&&t.push(`- Author association: ${e.authorAssociation}`),t.push(``),t.join(` -`)}async function Zn(e,t,n,r){let i=Date.now(),a=new AbortController,o=n?.timeoutMs??18e5,s=null,c=!1,l=r==null,u=null;o>0&&(s=setTimeout(()=>{c=!0,t.warning(`Execution timeout reached`,{timeoutMs:o}),a.abort()},o)),t.info(`Executing OpenCode agent (SDK mode)`,{agent:n?.agent??`sisyphus`,hasModelOverride:n?.model!=null,timeoutMs:o});try{let s;if(r==null){let e=await cn({signal:a.signal});s=e.client,u=e.server}else s=r.client;let l;if(n?.continueSessionId==null){let e=n?.sessionTitle==null?void 0:{body:{title:n.sessionTitle}},r=e==null?await s.session.create():await s.session.create(e);if(r.data==null||r.error!=null)throw Error(`Failed to create session: ${r.error==null?`No data returned`:String(r.error)}`);l=r.data.id,t.info(`Created new OpenCode session`,{sessionId:l,sessionTitle:n?.sessionTitle??null})}else l=n.continueSessionId,t.info(`Continuing existing OpenCode session`,{sessionId:l});let d=Wn({...e,sessionId:l},t),f=I();if(fe()){let e=M(),n=ye.createHash(`sha256`).update(d).digest(`hex`),r=V.join(e,`prompt-${l}-${n.slice(0,8)}.txt`);try{await B.mkdir(e,{recursive:!0}),await B.writeFile(r,d,`utf8`),t.info(`Prompt artifact written`,{hash:n,path:r})}catch(e){t.warning(`Failed to write prompt artifact`,{error:e instanceof Error?e.message:String(e),path:r})}}let p={tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null},m=null,h=null;for(let r=1;r<=3;r++){if(c)return{success:!1,exitCode:130,duration:Date.now()-i,sessionId:l,error:`Execution timed out after ${o}ms`,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:h};if(o>0&&o-(Date.now()-i)<=5e3&&r>1)break;let a=r===1?d:`The previous request was interrupted by a network error (fetch failed). +`)}async function Zn(e,t,n,r){let i=Date.now(),a=new AbortController,o=n?.timeoutMs??18e5,s=null,c=!1,l=r==null,u=null;o>0&&(s=setTimeout(()=>{c=!0,t.warning(`Execution timeout reached`,{timeoutMs:o}),a.abort()},o)),t.info(`Executing OpenCode agent (SDK mode)`,{agent:n?.agent??`sisyphus`,hasModelOverride:n?.model!=null,timeoutMs:o});try{let s;if(r==null){let e=await cn({signal:a.signal});s=e.client,u=e.server}else s=r.client;let l;if(n?.continueSessionId==null){let e=n?.sessionTitle==null?void 0:{body:{title:n.sessionTitle}},r=e==null?await s.session.create():await s.session.create(e);if(r.data==null||r.error!=null)throw Error(`Failed to create session: ${r.error==null?`No data returned`:String(r.error)}`);l=r.data.id,t.info(`Created new OpenCode session`,{sessionId:l,sessionTitle:n?.sessionTitle??null})}else l=n.continueSessionId,t.info(`Continuing existing OpenCode session`,{sessionId:l});let d=Wn({...e,sessionId:l},t),f=M();if(ge()){let e=k(),n=Ce.createHash(`sha256`).update(d).digest(`hex`),r=L.join(e,`prompt-${l}-${n.slice(0,8)}.txt`);try{await I.mkdir(e,{recursive:!0}),await I.writeFile(r,d,`utf8`),t.info(`Prompt artifact written`,{hash:n,path:r})}catch(e){t.warning(`Failed to write prompt artifact`,{error:e instanceof Error?e.message:String(e),path:r})}}let p={tokens:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null},m=null,h=null;for(let r=1;r<=3;r++){if(c)return{success:!1,exitCode:130,duration:Date.now()-i,sessionId:l,error:`Execution timed out after ${o}ms`,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:h};if(o>0&&o-(Date.now()-i)<=5e3&&r>1)break;let a=r===1?d:`The previous request was interrupted by a network error (fetch failed). Please continue where you left off. If you were in the middle of a task, resume it. -If you had completed the task, confirm the completion.`,u=r===1?e.fileParts:void 0,g=await(async()=>{try{return await In(s,l,a,u,f,n,t)}finally{await ln(s,l,n?.sessionTitle,t)}})();if(g.success)return p=g.eventStreamResult,{success:!0,exitCode:0,duration:Date.now()-i,sessionId:l,error:null,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:null};if(m=g.error,h=g.llmError,!g.shouldRetry||r>=3)break;t.warning(`LLM fetch error detected, retrying with continuation prompt`,{attempt:r,maxAttempts:3,error:g.error,delayMs:Nn,sessionId:l}),await un(Nn)}return{success:!1,exitCode:1,duration:Date.now()-i,sessionId:l,error:m??`Unknown error`,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:h}}catch(e){let n=Date.now()-i,r=d(e);return t.error(`OpenCode execution failed`,{error:r,durationMs:n}),{success:!1,exitCode:1,duration:n,sessionId:null,error:r,tokenUsage:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:gn(e)?_n(r):null}}finally{s!=null&&clearTimeout(s),a.abort(),l&&u?.close()}}async function Qn(e,t,n){return t.commentId==null?(n.debug(`No comment ID, skipping eyes reaction`),!1):await Pe(e,t.repo,t.commentId,`eyes`,n)==null?!1:(n.info(`Added eyes reaction`,{commentId:t.commentId}),!0)}async function $n(e,t,n){return t.issueNumber==null?(n.debug(`No issue number, skipping working label`),!1):await Le(e,t.repo,`agent: working`,`fcf2e1`,`Agent is currently working on this`,n)&&await Re(e,t.repo,t.issueNumber,[`agent: working`],n)?(n.info(`Added working label`,{issueNumber:t.issueNumber}),!0):!1}async function er(e,t,n){await Promise.all([Qn(e,t,n),$n(e,t,n)])}async function tr(e,t,n){if(t.commentId==null||t.botLogin==null)return;let r=(await Fe(e,t.repo,t.commentId,n)).find(e=>e.content===`eyes`&&e.userLogin===t.botLogin);r!=null&&await Ie(e,t.repo,t.commentId,r.id,n)}async function nr(e,t,n,r){t.commentId!=null&&await Pe(e,t.repo,t.commentId,n,r)}async function rr(e,t,n){if(t.commentId==null||t.botLogin==null){n.debug(`Missing comment ID or bot login, skipping reaction update`);return}try{await tr(e,t,n),await nr(e,t,`hooray`,n),n.info(`Updated reaction to success indicator`,{commentId:t.commentId,reaction:`hooray`})}catch(e){n.warning(`Failed to update reaction (non-fatal)`,{error:d(e)})}}async function ir(e,t,n){if(t.commentId==null||t.botLogin==null){n.debug(`Missing comment ID or bot login, skipping reaction update`);return}try{await tr(e,t,n),await nr(e,t,`confused`,n),n.info(`Updated reaction to confused`,{commentId:t.commentId})}catch(e){n.warning(`Failed to update failure reaction (non-fatal)`,{error:d(e)})}}async function ar(e,t,n){if(t.issueNumber==null){n.debug(`No issue number, skipping label removal`);return}await ze(e,t.repo,t.issueNumber,`agent: working`,n)&&n.info(`Removed working label`,{issueNumber:t.issueNumber})}async function or(e,t,n,r){n?await rr(e,t,r):await ir(e,t,r),await ar(e,t,r)}var K=h(O(),1),sr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},cr=class{constructor(e,t,n){if(e<1)throw Error(`max attempts should be greater than or equal to 1`);if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(n),this.minSeconds>this.maxSeconds)throw Error(`min seconds should be less than or equal to max seconds`)}execute(e,t){return sr(this,void 0,void 0,function*(){let n=1;for(;nsetTimeout(t,e*1e3))})}},q=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},lr=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};const ur=process.platform===`win32`;process.platform;function dr(e,t,n,r){return q(this,void 0,void 0,function*(){return t||=z.join(Er(),he.randomUUID()),yield ie(z.dirname(t)),m(`Downloading ${e}`),m(`Destination ${t}`),yield new cr(3,Dr(`TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS`,10),Dr(`TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS`,20)).execute(()=>q(this,void 0,void 0,function*(){return yield fr(e,t||``,n,r)}),e=>!(e instanceof lr&&e.httpStatusCode&&e.httpStatusCode<500&&e.httpStatusCode!==408&&e.httpStatusCode!==429))})}function fr(e,t,n,r){return q(this,void 0,void 0,function*(){if(R.existsSync(t))throw Error(`Destination file path ${t} already exists`);let i=new w(`actions/tool-cache`,[],{allowRetries:!1});n&&(m(`set auth`),r===void 0&&(r={}),r.authorization=n);let a=yield i.get(e,r);if(a.message.statusCode!==200){let t=new lr(a.message.statusCode);throw m(`Failed to download from "${e}". Code(${a.message.statusCode}) Message(${a.message.statusMessage})`),t}let o=_e.promisify(Oe.pipeline),s=Dr(`TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY`,()=>a.message)(),c=!1;try{return yield o(s,R.createWriteStream(t)),m(`download complete`),c=!0,t}finally{if(!c){m(`download failed`);try{yield l(t)}catch(e){m(`Failed to delete '${t}'. ${e.message}`)}}}})}function pr(e,t){return q(this,arguments,void 0,function*(e,t,n=`xz`){if(!e)throw Error(`parameter 'file' is required`);t=yield br(t),m(`Checking tar --version`);let r=``;yield x(`tar --version`,[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>r+=e.toString(),stderr:e=>r+=e.toString()}}),m(r.trim());let i=r.toUpperCase().includes(`GNU TAR`),a;a=n instanceof Array?n:[n],pe()&&!n.includes(`v`)&&a.push(`-v`);let o=t,s=e;return ur&&i&&(a.push(`--force-local`),o=t.replace(/\\/g,`/`),s=e.replace(/\\/g,`/`)),i&&(a.push(`--warning=no-unknown-keyword`),a.push(`--overwrite`)),a.push(`-C`,o,`-f`,s),yield x(`tar`,a),t})}function mr(e,t){return q(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'file' is required`);return t=yield br(t),ur?yield hr(e,t):yield gr(e,t),t})}function hr(e,t){return q(this,void 0,void 0,function*(){let n=e.replace(/'/g,`''`).replace(/"|\n|\r/g,``),r=t.replace(/'/g,`''`).replace(/"|\n|\r/g,``),i=yield C(`pwsh`,!1);if(i){let e=[`-NoLogo`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Unrestricted`,`-Command`,[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${n}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${n}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(` `)];m(`Using pwsh at path: ${i}`),yield x(`"${i}"`,e)}else{let e=[`-NoLogo`,`-Sta`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Unrestricted`,`-Command`,[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${n}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${n}', '${r}', $true) }`].join(` `)],t=yield C(`powershell`,!0);m(`Using powershell at path: ${t}`),yield x(`"${t}"`,e)}})}function gr(e,t){return q(this,void 0,void 0,function*(){let n=yield C(`unzip`,!0),r=[e];pe()||r.unshift(`-q`),r.unshift(`-o`),yield x(`"${n}"`,r,{cwd:t})})}function _r(e,t,n,r){return q(this,void 0,void 0,function*(){if(n=K.clean(n)||n,r||=me.arch(),m(`Caching tool ${t} ${n} ${r}`),m(`source dir: ${e}`),!R.statSync(e).isDirectory())throw Error(`sourceDir is not a directory`);let i=yield xr(t,n,r);for(let t of R.readdirSync(e))yield u(z.join(e,t),i,{recursive:!0});return Sr(t,n,r),i})}function vr(e,t,n){if(!e)throw Error(`toolName parameter is required`);if(!t)throw Error(`versionSpec parameter is required`);n||=me.arch(),Cr(t)||(t=wr(yr(e,n),t));let r=``;if(t){t=K.clean(t)||``;let i=z.join(Tr(),e,t,n);m(`checking cache: ${i}`),R.existsSync(i)&&R.existsSync(`${i}.complete`)?(m(`Found tool in cache ${e} ${t} ${n}`),r=i):m(`not found`)}return r}function yr(e,t){let n=[];t||=me.arch();let r=z.join(Tr(),e);if(R.existsSync(r)){let e=R.readdirSync(r);for(let i of e)if(Cr(i)){let e=z.join(r,i,t||``);R.existsSync(e)&&R.existsSync(`${e}.complete`)&&n.push(i)}}return n}function br(e){return q(this,void 0,void 0,function*(){return e||=z.join(Er(),he.randomUUID()),yield ie(e),e})}function xr(e,t,n){return q(this,void 0,void 0,function*(){let r=z.join(Tr(),e,K.clean(t)||t,n||``);m(`destination ${r}`);let i=`${r}.complete`;return yield l(r),yield l(i),yield ie(r),r})}function Sr(e,t,n){let r=`${z.join(Tr(),e,K.clean(t)||t,n||``)}.complete`;R.writeFileSync(r,``),m(`finished caching tool`)}function Cr(e){let t=K.clean(e)||``;m(`isExplicit: ${t}`);let n=K.valid(t)!=null;return m(`explicit? ${n}`),n}function wr(e,t){let n=``;m(`evaluating ${e.length} versions`),e=e.sort((e,t)=>K.gt(e,t)?1:-1);for(let r=e.length-1;r>=0;r--){let i=e[r];if(K.satisfies(i,t)){n=i;break}}return m(n?`matched: ${n}`:`match not found`),n}function Tr(){let e=process.env.RUNNER_TOOL_CACHE||``;return ge(e,`Expected RUNNER_TOOL_CACHE to be defined`),e}function Er(){let e=process.env.RUNNER_TEMP||``;return ge(e,`Expected RUNNER_TEMP to be defined`),e}function Dr(e,t){let n=global[e];return n===void 0?t:n}function Or(e){let t;try{t=JSON.parse(e)}catch(e){throw e instanceof SyntaxError?Error(`Invalid auth-json format: ${e.message}`):e}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`auth-json must be a JSON object`);return t}async function kr(e,t,n){let r=V.join(t,`auth.json`);await B.mkdir(t,{recursive:!0});let i=JSON.stringify(e,null,2);return await B.writeFile(r,i,{mode:384}),n.info(`Populated auth.json`,{path:r,providers:Object.keys(e).length}),r}function Ar(){let e=L.platform,t=L.arch;return{os:{darwin:`darwin`,linux:`linux`,win32:`windows`}[e]??`linux`,arch:{arm64:`aarch64`,x64:`x64`}[t]??`x64`,ext:`.zip`}}function jr(e,t){return`https://github.com/oven-sh/bun/releases/download/bun-${e.startsWith(`v`)?e:`v${e}`}/${`bun-${t.os}-${t.arch}${t.ext}`}`}async function Mr(e,t,n,r,i=_){let a=Ar(),o=t.find(`bun`,i,a.arch);if(o.length>0)return e.info(`Bun found in cache`,{version:i,path:o}),r(o),await Pr(o),{path:o,version:i,cached:!0};e.info(`Downloading Bun`,{version:i});let s=jr(i,a);try{let o=await t.downloadTool(s);if(L.platform!==`win32`&&!await Fr(o,e,n))throw Error(`Downloaded Bun archive appears corrupted`);e.info(`Extracting Bun`);let c=await Nr(await t.extractZip(o),t),l=H.dirname(c);e.info(`Caching Bun`);let u=await t.cacheDir(l,`bun`,i,a.arch);return r(u),await Pr(u),e.info(`Bun installed`,{version:i,path:u}),{path:u,version:i,cached:!1}}catch(e){let t=d(e);throw Error(`Failed to install Bun ${i}: ${t}`)}}async function Nr(e,t){for(let n of await Se.readdir(e,{withFileTypes:!0})){let{name:r}=n,i=H.join(e,r);if(n.isFile()){if(r===`bun`||r===`bun.exe`)return i;if(/^bun.*\.zip/.test(r))return Nr(await t.extractZip(i),t)}if(r.startsWith(`bun`)&&n.isDirectory())return Nr(i,t)}throw Error(`Could not find executable: bun`)}async function Pr(e){let t=e=>L.platform===`win32`?`${e}.exe`:e,n=H.join(e,t(`bun`));try{await Se.symlink(n,H.join(e,t(`bunx`)))}catch(e){let t=typeof e==`object`?e.code:void 0;if(t!==`EEXIST`&&t!==`EPERM`&&t!==`EACCES`)throw e}}async function Fr(e,t,n){try{let{stdout:r}=await n.getExecOutput(`file`,[e],{silent:!0}),i=r.includes(`Zip archive`)||r.includes(`ZIP`);return i||t.warning(`Bun download validation failed`,{output:r.trim()}),i}catch{return t.debug(`Could not validate Bun download (file command unavailable)`),!0}}function Ir(e){return{debug:t=>e.debug(t),info:t=>e.info(t),warn:t=>e.warning(t),error:t=>e.error(t)}}function Lr(e){let{token:t,logger:n}=e;return n.debug(`Creating GitHub client with token`),ce(t,{log:Ir(n)})}async function Rr(e,t){try{let{data:n}=await e.rest.users.getAuthenticated();return t.debug(`Authenticated as`,{login:n.login,type:n.type}),n.login}catch{return t.debug(`Failed to get authenticated user, may be app token`),`fro-bot[bot]`}}async function zr(e,t,n,r){let i=t??n,a=t==null?n.length>0?`github-token`:`none`:`app-token`;if(i.length===0)return r.warning(`No GitHub token available`),{authenticated:!1,method:`none`,botLogin:null};L.env.GH_TOKEN=i,r.info(`Configured authentication`,{method:a});let o=null;return e!=null&&(o=await Rr(e,r)),{authenticated:!0,method:a,botLogin:o}}async function Br(e,t){let n=await t.getExecOutput(`git`,[`config`,e],{ignoreReturnCode:!0,silent:!0});return n.exitCode===0&&n.stdout.trim().length>0?n.stdout.trim():null}async function Vr(e,t,n,r){let i=await Br(`user.name`,r),a=await Br(`user.email`,r);if(i!=null&&a!=null){n.info(`Git identity already configured`,{name:i,email:a});return}if(t==null)throw Error(`Cannot configure Git identity: no authenticated GitHub user`);let o=null;if(a==null){let r=await Ue(e,t,n);if(r==null)throw Error(`Cannot configure Git identity: failed to look up user ID for '${t}'`);o=String(r.id)}i??await r.exec(`git`,[`config`,`--global`,`user.name`,t],void 0);let s=`${o}+${t}@users.noreply.github.com`;a??await r.exec(`git`,[`config`,`--global`,`user.email`,s],void 0),n.info(`Configured git identity`,{name:i??t,email:a??s})}const Hr=new Set([`__proto__`,`prototype`,`constructor`]);function Ur(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Wr(e,t){let n=Object.create(null);for(let[t,r]of Object.entries(e))Hr.has(t)||(n[t]=r);for(let[e,r]of Object.entries(t)){if(Hr.has(e))continue;let t=n[e];Ur(r)&&Ur(t)?n[e]=Wr(t,r):n[e]=r}return n}async function Gr(e,t,n){let r=JSON.parse(e);if(!Ur(r))throw Error(`omo-config must be a JSON object (non-null, non-array)`);let i=r;await B.mkdir(t,{recursive:!0});let a=V.join(t,`oh-my-opencode.json`),o={};try{let e=await B.readFile(a,`utf8`),t=JSON.parse(e);typeof t==`object`&&t&&!Array.isArray(t)&&(o=t)}catch(e){n.debug(`Using empty base oMo config`,{path:a,error:String(e)})}let s=Wr(o,i);await B.writeFile(a,JSON.stringify(s,null,2)),n.info(`Wrote oMo config`,{path:a,keyCount:Object.keys(i).length})}async function Kr(e,t,n={}){let{logger:r,execAdapter:i}=t,{claude:a=`no`,copilot:o=`no`,gemini:s=`no`,openai:c=`no`,opencodeZen:l=`no`,zaiCodingPlan:u=`no`,kimiForCoding:f=`no`}=n;r.info(`Installing Oh My OpenAgent plugin`,{version:e,claude:a,copilot:o,gemini:s,openai:c,opencodeZen:l,zaiCodingPlan:u,kimiForCoding:f});let p=``,m=[`oh-my-openagent@${e}`,`install`,`--no-tui`,`--skip-auth`,`--claude=${a}`,`--copilot=${o}`,`--gemini=${s}`,`--openai=${c}`,`--opencode-zen=${l}`,`--zai-coding-plan=${u}`,`--kimi-for-coding=${f}`];try{let t=await i.exec(`bunx`,m,{listeners:{stdout:e=>{p+=e.toString()},stderr:e=>{p+=e.toString()}},ignoreReturnCode:!0});if(t!==0){let e=`bunx oh-my-openagent install returned exit code ${t}`;return r.error(e,{output:p.slice(0,1e3)}),{installed:!1,version:null,error:`${e}\n${p.slice(0,500)}`}}let n=/oh-my-opencode@(\d+\.\d+\.\d+)/i.exec(p),a=n!=null&&n[1]!=null?n[1]:e;return r.info(`oMo plugin installed`,{version:a}),{installed:!0,version:a,error:null}}catch(e){let t=d(e),n=p.length>0?`${t}\nOutput: ${p.slice(0,500)}`:t;return r.error(`Failed to run oMo installer`,{error:t,output:p.slice(0,500)}),{installed:!1,version:null,error:`bunx oh-my-openagent install failed: ${n}`}}}const qr=`opencode`,Jr=i;function Yr(){let e=Ee.platform(),t=Ee.arch(),n={darwin:`darwin`,linux:`linux`,win32:`windows`},r={x64:`x64`,arm64:`arm64`},i=e===`win32`||e===`darwin`?`.zip`:`.tar.gz`;return{os:n[e]??`linux`,arch:r[t]??`x64`,ext:i}}function Xr(e,t){return`https://github.com/anomalyco/opencode/releases/download/${e.startsWith(`v`)?e:`v${e}`}/${`opencode-${t.os}-${t.arch}${t.ext}`}`}async function Zr(e,t,n,r){if(L.platform===`win32`)return!0;try{let{stdout:i}=await r.getExecOutput(`file`,[e],{silent:!0}),a=(t===`.zip`?[`Zip archive`,`ZIP`]:[`gzip`,`tar`,`compressed`]).some(e=>i.includes(e));return a||n.warning(`Download validation failed`,{output:i.trim()}),a}catch{return n.debug(`Could not validate download (file command unavailable)`),!0}}async function Qr(e,t,n,r,i=Jr){let a=Yr(),o=n.find(qr,e,a.arch);if(o.length>0)return t.info(`OpenCode found in cache`,{version:e,path:o}),{path:o,version:e,cached:!0};try{return await $r(e,a,t,n,r)}catch(n){t.warning(`Primary version install failed, trying fallback`,{requestedVersion:e,fallbackVersion:i,error:d(n)})}if(e!==i)try{let e=await $r(i,a,t,n,r);return t.info(`Installed fallback version`,{version:i}),e}catch(t){throw Error(`Failed to install OpenCode (tried ${e} and ${i}): ${d(t)}`)}throw Error(`Failed to install OpenCode version ${e}`)}async function $r(e,t,n,r,i){n.info(`Downloading OpenCode`,{version:e});let a=Xr(e,t),o=await r.downloadTool(a);if(!await Zr(o,t.ext,n,i))throw Error(`Downloaded archive appears corrupted`);n.info(`Extracting OpenCode`);let s=t.ext===`.zip`?await r.extractZip(o):await r.extractTar(o);n.info(`Caching OpenCode`);let c=await r.cacheDir(s,qr,e,t.arch);return n.info(`OpenCode installed`,{version:e,path:c}),{path:c,version:e,cached:!1}}async function ei(e){let t=await fetch(`https://api.github.com/repos/anomalyco/opencode/releases/latest`);if(!t.ok)throw Error(`Failed to fetch latest OpenCode version: ${t.statusText}`);let n=(await t.json()).tag_name.replace(/^v/,``);return e.info(`Latest OpenCode version`,{version:n}),n}const ti={restoreCache:async(e,t,n)=>re(e,t,n),saveCache:async(e,t)=>oe(e,t)};function ni(e){let{os:t,opencodeVersion:n,omoVersion:r}=e;return`${F}-${t}-oc-${n}-omo-${r}`}function ri(e){let{os:t,opencodeVersion:n,omoVersion:r}=e;return[`${F}-${t}-oc-${n}-omo-${r}-`]}async function ii(e){let{logger:t,os:n,opencodeVersion:r,omoVersion:i,toolCachePath:a,bunCachePath:o,omoConfigPath:s,cacheAdapter:c=ti}=e,l=ni({os:n,opencodeVersion:r,omoVersion:i}),u=ri({os:n,opencodeVersion:r,omoVersion:i}),f=[a,o,s];t.info(`Restoring tools cache`,{primaryKey:l,restoreKeys:[...u],paths:f});try{let e=await c.restoreCache(f,l,[...u]);return e==null?(t.info(`Tools cache miss - will install tools`),{hit:!1,restoredKey:null}):(t.info(`Tools cache restored`,{restoredKey:e}),{hit:!0,restoredKey:e})}catch(e){return t.warning(`Tools cache restore failed`,{error:d(e)}),{hit:!1,restoredKey:null}}}async function ai(e){let{logger:t,os:n,opencodeVersion:r,omoVersion:i,toolCachePath:a,bunCachePath:o,omoConfigPath:s,cacheAdapter:c=ti}=e,l=ni({os:n,opencodeVersion:r,omoVersion:i}),u=[a,o,s];t.info(`Saving tools cache`,{saveKey:l,paths:u});try{return await c.saveCache(u,l),t.info(`Tools cache saved`,{saveKey:l}),!0}catch(e){return e instanceof Error&&e.message.includes(`already exists`)?(t.info(`Tools cache key already exists, skipping save`),!0):(t.warning(`Tools cache save failed`,{error:d(e)}),!1)}}function oi(){return{find:vr,downloadTool:dr,extractTar:pr,extractZip:mr,cacheDir:_r}}function si(){return{exec:x,getExecOutput:o}}async function ci(e,t){let n=Date.now(),r=P({component:`setup`}),i=oi(),o=si();try{r.info(`Starting setup`,{version:e.opencodeVersion});let c;try{c=Or(e.authJson)}catch(e){return b(`Invalid auth-json: ${d(e)}`),null}let l=e.opencodeVersion;if(l===`latest`)try{l=await ei(r)}catch(e){r.warning(`Failed to get latest version, using fallback`,{error:d(e)}),l=Jr}let u=e.omoVersion,p=L.env.RUNNER_TOOL_CACHE??`/opt/hostedtoolcache`,m=Ce(p,`opencode`),h=Ce(p,`bun`),g=Ce(De(),`.config`,`opencode`),v=T(),y=await ii({logger:r,os:v,opencodeVersion:l,omoVersion:u,toolCachePath:m,bunCachePath:h,omoConfigPath:g}),x=y.hit?`hit`:`miss`,S,C=!1,w=null;if(y.hit){let e=i.find(`opencode`,l);e.length>0?(S={path:e,version:l,cached:!0},r.info(`Tools cache hit, using cached OpenCode CLI`,{version:l,omoVersion:u})):r.warning(`Tools cache hit but binary not found in tool-cache, falling through to install`,{requestedVersion:l,restoredKey:y.restoredKey})}if(S==null)try{S=await Qr(l,r,i,o)}catch(e){return b(`Failed to install OpenCode: ${d(e)}`),null}let E=!1;try{await Mr(r,i,o,f,_),E=!0}catch(e){r.warning(`Bun installation failed, oMo will be unavailable`,{error:d(e)})}if(E){if(e.omoConfig!=null)try{await Gr(e.omoConfig,g,r)}catch(e){r.warning(`Failed to write omo-config, continuing without custom config`,{error:d(e)})}let t=await Kr(u,{logger:r,execAdapter:o},e.omoProviders);t.installed?(r.info(`oMo installed`,{version:t.version}),C=!0):r.warning(`oMo installation failed, continuing without oMo`,{error:t.error??`unknown error`}),w=t.error}let D={autoupdate:!1};if(e.opencodeConfig!=null){let t;try{t=JSON.parse(e.opencodeConfig)}catch{return b(`opencode-config must be valid JSON`),null}if(typeof t!=`object`||!t||Array.isArray(t))return b(`opencode-config must be a JSON object`),null;Object.assign(D,t)}let O=`@fro.bot/systematic@${e.systematicVersion}`,k=Array.isArray(D.plugins)?D.plugins:[];k.some(e=>typeof e==`string`&&e.startsWith(`@fro.bot/systematic`))||(D.plugins=[...k,O]),a(`OPENCODE_CONFIG_CONTENT`,JSON.stringify(D)),y.hit||await ai({logger:r,os:v,opencodeVersion:l,omoVersion:u,toolCachePath:m,bunCachePath:h,omoConfigPath:g}),f(S.path),s(`opencode-path`,S.path),s(`opencode-version`,S.version),r.info(`OpenCode ready`,{version:S.version,cached:S.cached});let A=ce(t),j=await zr(A,null,t,r);a(`GH_TOKEN`,t),r.info(`GitHub CLI configured`),await Vr(A,j.botLogin,r,o);let M=Ce(le(),`opencode`),N=await kr(c,M,r);s(`auth-json-path`,N),r.info(`auth.json populated`,{path:N});let P=Date.now()-n,F={opencodePath:S.path,opencodeVersion:S.version,ghAuthenticated:j.authenticated,omoInstalled:C,omoError:w,toolsCacheStatus:x,duration:P};return r.info(`Setup complete`,{duration:P}),F}catch(e){let t=d(e);return r.error(`Setup failed`,{error:t}),b(t),null}}function li(e){return{success:!0,data:e}}function ui(e){return{success:!1,error:e}}const di=[`OWNER`,`MEMBER`,`COLLABORATOR`];async function fi(e,t){try{let{client:n,server:r}=await cn({signal:e});return t.debug(`OpenCode server bootstrapped`,{url:r.url}),li({client:n,server:r,shutdown:()=>{r.close()}})}catch(e){let n=e instanceof Error?e.message:String(e);return t.warning(`Failed to bootstrap OpenCode server`,{error:n}),ui(Error(`Server bootstrap failed: ${n}`))}}async function pi(e,t){let n=e??`opencode`;try{let e=``;await x(n,[`--version`],{listeners:{stdout:t=>{e+=t.toString()}},silent:!0});let r=/(\d+\.\d+\.\d+)/.exec(e)?.[1]??null;return t.debug(`OpenCode version verified`,{version:r}),{available:!0,version:r}}catch{return t.debug(`OpenCode not available, will attempt auto-setup`),{available:!1,version:null}}}async function mi(e){let{logger:t,opencodeVersion:n}=e,r=L.env.OPENCODE_PATH??null,i=await pi(r,t);if(i.available&&i.version!=null)return t.info(`OpenCode already available`,{version:i.version}),{path:r??`opencode`,version:i.version,didSetup:!1};t.info(`OpenCode not found, running auto-setup`,{requestedVersion:n});let a=await ci({opencodeVersion:n,authJson:e.authJson,appId:null,privateKey:null,opencodeConfig:e.opencodeConfig,omoConfig:null,omoVersion:e.omoVersion,systematicVersion:e.systematicVersion,omoProviders:e.omoProviders},e.githubToken);if(a==null)throw Error(`Auto-setup failed: runSetup returned null`);return f(a.opencodePath),L.env.OPENCODE_PATH=a.opencodePath,t.info(`Auto-setup completed`,{version:a.opencodeVersion,path:a.opencodePath}),{path:a.opencodePath,version:a.opencodeVersion,didSetup:!0}}async function hi(e,t){let n={repo:e.agentContext.repo,commentId:e.agentContext.commentId,issueNumber:e.agentContext.issueNumber,issueType:e.agentContext.issueType,botLogin:e.botLogin},r=P({phase:`acknowledgment`});return await er(e.githubClient,n,r),t.debug(`Acknowledgment phase completed`),n}function gi(e,t){try{JSON.parse(e)}catch{throw Error(`${t} must be valid JSON`)}}function _i(e,t){let n=e.trim();if(!/^\d+$/.test(n))throw Error(`${t} must be a positive integer, received: ${e}`);let r=Number.parseInt(n,10);if(r===0)throw Error(`${t} must be a positive integer, received: ${e}`);return r}function vi(e){let t=e.trim(),n=t.indexOf(`/`);if(n===-1)throw Error(`Invalid model format: "${e}". Expected "provider/model" (e.g., "anthropic/claude-sonnet-4-20250514")`);let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();if(r.length===0)throw Error(`Invalid model format: "${e}". Provider cannot be empty.`);if(i.length===0)throw Error(`Invalid model format: "${e}". Model ID cannot be empty.`);return{providerID:r,modelID:i}}function yi(e,t=`timeout`){let n=e.trim();if(!/^\d+$/.test(n))throw Error(`${t} must be a non-negative integer, received: ${e}`);let r=Number.parseInt(n,10);if(Number.isNaN(r)||r<0)throw Error(`${t} must be a non-negative integer, received: ${e}`);return r}const bi=[`claude`,`claude-max20`,`copilot`,`gemini`,`openai`,`opencode-zen`,`zai-coding-plan`,`kimi-for-coding`];function xi(e){let t=e.split(`,`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0),n=`no`,r=`no`,i=`no`,a=`no`,o=`no`,s=`no`,c=`no`;for(let e of t){if(!bi.includes(e))throw Error(`Invalid omo-providers value: "${e}". Valid values: ${bi.join(`, `)}`);switch(e){case`claude`:n=`yes`;break;case`claude-max20`:n=`max20`;break;case`copilot`:r=`yes`;break;case`gemini`:i=`yes`;break;case`openai`:a=`yes`;break;case`opencode-zen`:o=`yes`;break;case`zai-coding-plan`:s=`yes`;break;case`kimi-for-coding`:c=`yes`;break}}return{claude:n,copilot:r,gemini:i,openai:a,opencodeZen:o,zaiCodingPlan:s,kimiForCoding:c}}function Si(){try{let e=c(`github-token`,{required:!0}).trim();if(e.length===0)return ui(Error(`github-token is required but was not provided`));let t=c(`auth-json`,{required:!0}).trim();if(t.length===0)return ui(Error(`auth-json is required but was not provided`));gi(t,`auth-json`);let a=c(`prompt`).trim(),o=a.length>0?a:null,s=c(`session-retention`).trim(),l=s.length>0?_i(s,`session-retention`):50,u=c(`s3-backup`).trim().toLowerCase()===`true`,d=c(`s3-bucket`).trim(),f=d.length>0?d:null,m=c(`aws-region`).trim(),h=m.length>0?m:null,g=c(`agent`).trim(),_=g.length>0?g:de,y=c(`model`).trim(),b=y.length>0?vi(y):null,x=c(`timeout`).trim(),S=x.length>0?yi(x):p,C=c(`opencode-version`).trim(),w=C.length>0?C:i,T=c(`skip-cache`).trim().toLowerCase()===`true`,E=c(`omo-version`).trim(),D=E.length>0?E:v,O=c(`systematic-version`).trim(),k=O.length>0?O:r,A=c(`omo-providers`).trim(),j=xi(A.length>0?A:``),M=c(`opencode-config`).trim(),N=M.length>0?M:null,P=c(`dedup-window`).trim(),F=P.length>0?yi(P,`dedup-window`):n;if(N!=null){gi(N,`opencode-config`);let e=JSON.parse(N);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Input 'opencode-config' must be a JSON object`)}return li({githubToken:e,authJson:t,prompt:o,sessionRetention:l,s3Backup:u,s3Bucket:f,awsRegion:h,agent:_,model:b,timeoutMs:S,opencodeVersion:w,skipCache:T,omoVersion:D,systematicVersion:k,omoProviders:j,opencodeConfig:N,dedupWindow:F})}catch(e){return ui(e instanceof Error?e:Error(String(e)))}}async function Ci(n){let r=Si();if(!r.success)return b(`Invalid inputs: ${r.error.message}`),null;let i=r.data,a=P({phase:`main`});a.info(`Action inputs parsed`,{sessionRetention:i.sessionRetention,s3Backup:i.s3Backup,hasGithubToken:i.githubToken.length>0,hasPrompt:i.prompt!=null,agent:i.agent,hasModelOverride:i.model!=null,timeoutMs:i.timeoutMs});let o=await mi({logger:a,opencodeVersion:i.opencodeVersion,githubToken:i.githubToken,authJson:i.authJson,omoVersion:i.omoVersion,systematicVersion:i.systematicVersion,omoProviders:i.omoProviders,opencodeConfig:i.opencodeConfig});return o.didSetup?a.info(`OpenCode auto-setup completed`,{version:o.version}):a.info(`OpenCode already available`,{version:o.version}),t(e.OPENCODE_VERSION,o.version),n.debug(`Bootstrap phase completed`,{opencodeVersion:o.version}),{inputs:i,logger:a,opencodeResult:o}}const wi=/^[0-9a-f]{40}$/i;function Ti(){return{exec:x,getExecOutput:o}}async function Ei(e){let{workspacePath:t,logger:n,execAdapter:r=Ti()}=e,i=V.join(t,`.git`),a=V.join(i,`opencode`);try{let e=(await B.readFile(a,`utf8`)).trim();if(e.length>0){if(wi.test(e))return n.debug(`Project ID loaded from cache`,{projectId:e}),{projectId:e,source:`cached`};n.warning(`Invalid cached project ID format, regenerating`,{cachedId:e})}}catch(e){n.debug(`No cached project ID found`,{error:d(e)})}try{let e=await B.readFile(i,`utf8`),n=/^gitdir: (.+)$/m.exec(e);if(n==null)return{projectId:null,source:`error`,error:`Invalid .git file format`};i=V.resolve(t,n[1]),a=V.join(i,`opencode`)}catch(e){if((typeof e==`object`?e.code:void 0)!==`EISDIR`)return{projectId:null,source:`error`,error:`Not a git repository`}}try{let{stdout:e,exitCode:i}=await r.getExecOutput(`git`,[`rev-list`,`--max-parents=0`,`--all`],{cwd:t,silent:!0});if(i!==0||e.trim().length===0)return{projectId:null,source:`error`,error:`No commits found in repository`};let o=e.trim().split(` -`).map(e=>e.trim()).filter(e=>e.length>0).sort();if(o.length===0)return{projectId:null,source:`error`,error:`No root commits found`};let s=o[0];try{await B.writeFile(a,s,{encoding:`utf8`,flag:`wx`}),n.info(`Project ID generated and cached`,{projectId:s,source:`generated`})}catch(e){(typeof e==`object`?e.code:void 0)===`EEXIST`?n.debug(`Project ID file already written by concurrent process, skipping`,{projectId:s}):n.warning(`Failed to cache project ID (continuing)`,{error:d(e)})}return{projectId:s,source:`generated`}}catch(e){return{projectId:null,source:`error`,error:d(e)}}}async function Di(e){let t=E(),n=P({phase:`cache`}),r=I(),i=V.join(r,`.git`,`opencode`),a=await ae({components:t,logger:n,storagePath:j(),authPath:te(),projectIdPath:i,opencodeVersion:e.opencodeResult.version}),o=a.corrupted?`corrupted`:a.hit?`hit`:`miss`;e.logger.info(`Cache restore completed`,{cacheStatus:o,key:a.key});let s=await Ei({workspacePath:r,logger:n});s.source===`error`?n.warning(`Failed to generate project ID (continuing)`,{error:s.error}):n.debug(`Project ID ready`,{projectId:s.projectId,source:s.source});let c=P({phase:`server-bootstrap`}),l=await fi(new AbortController().signal,c);if(!l.success)return b(`OpenCode server bootstrap failed: ${l.error.message}`),null;let u=l.data;return c.info(`SDK server bootstrapped successfully`),{cacheResult:a,cacheStatus:o,serverHandle:u}}const Oi={markdownImage:/!\[([^\]]*)\]\((https:\/\/github\.com\/user-attachments\/assets\/[^)]+)\)/gi,markdownLink:/\[([^\]]+)\]\((https:\/\/github\.com\/user-attachments\/files\/[^)]+)\)/gi,htmlImage:/]*src=["'](https:\/\/github\.com\/user-attachments\/assets\/[^"']+)["'][^>]*>/gi};function ki(e,t,n){e.lastIndex=0;let r=e.exec(t);for(;r!=null;)n(r),r=e.exec(t);e.lastIndex=0}function Ai(e){let t=[],n=new Set;return ki(Oi.markdownImage,e,e=>{let r=e[2],i=e[1],a=e[0];r!=null&&i!=null&&!n.has(r)&&Sn(r)&&(n.add(r),t.push({url:r,originalMarkdown:a,altText:i,type:`image`}))}),ki(Oi.markdownLink,e,e=>{let r=e[2],i=e[1],a=e[0];r!=null&&i!=null&&!n.has(r)&&Sn(r)&&(n.add(r),t.push({url:r,originalMarkdown:a,altText:i,type:`file`}))}),ki(Oi.htmlImage,e,e=>{let r=e[1],i=e[0];if(r!=null&&!n.has(r)&&Sn(r)){n.add(r);let e=/alt=["']([^"']*)["']/i.exec(i);t.push({url:r,originalMarkdown:i,altText:e?.[1]??``,type:`image`})}}),Oi.htmlImage.lastIndex=0,t}function ji(e,t,n){try{let r=new URL(e).pathname.split(`/`).at(-1);if(r!=null&&/\.[a-z0-9]+$/i.test(r))return r;if(t.trim().length>0){let e=t.replaceAll(/[^\w.-]/g,`_`).slice(0,50);return e.trim().length>0?e:`attachment_${n+1}`}return`attachment_${n+1}`}catch{return`attachment_${n+1}`}}const Mi={maxFiles:5,maxFileSizeBytes:5*1024*1024,maxTotalSizeBytes:15*1024*1024,allowedMimeTypes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`,`text/plain`,`text/markdown`,`text/csv`,`application/json`,`application/pdf`]},Ni=[`github.com`,`githubusercontent.com`];async function Pi(e,t,n,r,i){i.debug(`Downloading attachment`,{url:e.url});try{let a=await fetch(e.url,{headers:{Authorization:`Bearer ${n}`,Accept:`*/*`,"User-Agent":`fro-bot-agent`},redirect:`manual`}),o=a;if(a.status>=300&&a.status<400){let t=a.headers.get(`location`);if(t==null)return i.warning(`Redirect without location`,{url:e.url}),null;let n=new URL(t);if(!Ni.some(e=>n.hostname===e||n.hostname.endsWith(`.${e}`)))return i.warning(`Redirect to non-GitHub host blocked`,{url:e.url,redirectTo:n.hostname}),null;o=await fetch(t,{headers:{Accept:`*/*`,"User-Agent":`fro-bot-agent`},redirect:`follow`})}if(!o.ok)return i.warning(`Attachment download failed`,{url:e.url,status:o.status}),null;let s=o.headers.get(`content-length`);if(s!=null){let t=Number.parseInt(s,10);if(t>r.maxFileSizeBytes)return i.warning(`Attachment exceeds size limit (Content-Length)`,{url:e.url,size:t,limit:r.maxFileSizeBytes}),null}let c=ve.from(await o.arrayBuffer());if(c.length>r.maxFileSizeBytes)return i.warning(`Attachment exceeds size limit`,{url:e.url,size:c.length,limit:r.maxFileSizeBytes}),null;let l=o.headers.get(`content-type`)??`application/octet-stream`,u=ji(e.url,e.altText,t),d=l.split(`;`)[0],f=d==null?`application/octet-stream`:d.trim(),p=await B.mkdtemp(V.join(Te.tmpdir(),`fro-bot-attachments-`)),m=u.trim().length>0?u:`attachment_${t+1}`,h=V.join(p,m);return await B.writeFile(h,c),i.debug(`Attachment downloaded`,{filename:u,mime:f,sizeBytes:c.length,tempPath:h}),{url:e.url,filename:u,mime:f,sizeBytes:c.length,tempPath:h}}catch(t){return i.warning(`Attachment download error`,{url:e.url,error:d(t)}),null}}async function Fi(e,t,n=Mi,r){return Promise.all(e.map(async(e,i)=>Pi(e,i,t,n,r)))}async function Ii(e,t){for(let n of e)try{await B.unlink(n);let e=V.dirname(n);await B.rmdir(e).catch(()=>{})}catch(e){t.debug(`Failed to cleanup temp file`,{path:n,error:d(e)})}}function Li(e){return e.map(e=>({type:`file`,mime:e.mime,url:xe(e.tempPath).toString(),filename:e.filename}))}function Ri(e,t,n){let r=e,i=new Set(n.map(e=>e.filename));for(let e of t){let t=n.find(e=>i.has(e.filename));t!=null&&(r=r.replace(e.originalMarkdown,`@${t.filename}`))}return r}function zi(e,t,n,r){return{processed:n,skipped:r,modifiedBody:Ri(e,t,n),fileParts:Li(n),tempFiles:n.map(e=>e.tempPath)}}function Bi(e){if(e<0||!Number.isFinite(e))throw Error(`Invalid bytes value: ${e}`);return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Vi(e,t=Mi,n){let r=[],i=[],a=0;for(let o of e)if(o!=null){if(r.length>=t.maxFiles){i.push({url:o.url,reason:`Exceeds max file count (${t.maxFiles})`}),n.debug(`Attachment skipped: max count`,{url:o.url});continue}if(o.sizeBytes>t.maxFileSizeBytes){i.push({url:o.url,reason:`File too large (${Bi(o.sizeBytes)} > ${Bi(t.maxFileSizeBytes)})`}),n.debug(`Attachment skipped: too large`,{url:o.url,size:o.sizeBytes});continue}if(a+o.sizeBytes>t.maxTotalSizeBytes){i.push({url:o.url,reason:`Would exceed total size limit (${Bi(t.maxTotalSizeBytes)})`}),n.debug(`Attachment skipped: total size exceeded`,{url:o.url});continue}if(!Hi(o.mime,t.allowedMimeTypes)){i.push({url:o.url,reason:`MIME type not allowed: ${o.mime}`}),n.debug(`Attachment skipped: MIME type`,{url:o.url,mime:o.mime});continue}a+=o.sizeBytes,r.push({filename:o.filename,mime:o.mime,sizeBytes:o.sizeBytes,tempPath:o.tempPath}),n.info(`Attachment validated`,{filename:o.filename,mime:o.mime,sizeBytes:o.sizeBytes})}return{validated:r,skipped:i}}function Hi(e,t){let[n]=e.split(`/`);for(let r of t)if(r===e||r.endsWith(`/*`)&&n!=null&&n===r.slice(0,-2))return!0;return!1}function J(e){let t=V.resolve(e);return t.endsWith(V.sep)&&t.length>1?t.slice(0,-1):t}const Ui=e=>typeof e==`object`&&!!e,Y=e=>typeof e==`string`?e:null,Wi=e=>typeof e==`number`?e:null;function Gi(e){if(Array.isArray(e))return e.filter(Ui).map(e=>({file:Y(e.file)??``,additions:Wi(e.additions)??0,deletions:Wi(e.deletions)??0}))}function Ki(e){return{id:e.id,version:e.version,projectID:e.projectID,directory:e.directory,parentID:e.parentID,title:e.title,time:{created:e.time.created,updated:e.time.updated,compacting:e.time.compacting,archived:e.time.archived},summary:e.summary==null?void 0:{additions:e.summary.additions,deletions:e.summary.deletions,files:e.summary.files,diffs:Gi(e.summary.diffs)},share:e.share?.url==null?void 0:{url:e.share.url},permission:e.permission==null?void 0:{rules:e.permission.rules},revert:e.revert==null?void 0:{messageID:e.revert.messageID,partID:e.revert.partID,snapshot:e.revert.snapshot,diff:e.revert.diff}}}async function qi(e,t){let n=await e.project.list();if(n.error!=null||n.data==null)return t.warning(`SDK project list failed`,{error:String(n.error)}),[];if(!Array.isArray(n.data))return[];let r=[];for(let e of n.data){if(!Ui(e))continue;let t=Y(e.id),n=Y(e.worktree),i=Y(e.path);t==null||n==null||i==null||r.push({id:t,worktree:n,path:i,vcs:`git`,time:{created:0,updated:0}})}return r}async function Ji(e,t,n){let r=J(t),i=await qi(e,n);for(let e of i){if(J(e.worktree)===r)return e;let t=Y(e.path);if(t!=null&&J(t)===r)return e}return null}function Yi(e){return e.status===`running`?{status:`running`,input:e.input,time:{start:e.time.start}}:e.status===`error`?{status:`error`,input:e.input,error:e.error,time:{start:e.time.start,end:e.time.end}}:e.status===`pending`?{status:`pending`}:{status:`completed`,input:e.input,output:e.output,title:e.title,metadata:e.metadata,time:{start:e.time.start,end:e.time.end,compacted:e.time.compacted},attachments:void 0}}function Xi(e){let t={id:e.id,sessionID:e.sessionID,messageID:e.messageID};if(e.type===`text`)return{...t,type:`text`,text:e.text,synthetic:e.synthetic,ignored:e.ignored,time:e.time,metadata:e.metadata};if(e.type===`reasoning`)return{...t,type:`reasoning`,reasoning:e.reasoning??e.text,time:e.time};if(e.type===`tool`)return{...t,type:`tool`,callID:e.callID,tool:e.tool,state:Yi(e.state),metadata:e.metadata};if(e.type!==`step-finish`)return{...t,type:`text`,text:`text`in e?e.text:``};let n=e;return{...t,type:`step-finish`,reason:n.reason,snapshot:n.snapshot,cost:n.cost,tokens:{input:n.tokens.input,output:n.tokens.output,reasoning:n.tokens.reasoning,cache:{read:n.tokens.cache.read,write:n.tokens.cache.write}}}}function Zi(e){if(e.role===`user`){let t=e;return{id:t.id,sessionID:t.sessionID,role:`user`,time:{created:t.time.created},summary:t.summary==null?void 0:{title:t.summary.title,body:t.summary.body,diffs:Gi(t.summary.diffs)??[]},agent:t.agent,model:{providerID:t.model.providerID,modelID:t.model.modelID},system:t.system,tools:t.tools,variant:t.variant}}let t=e;return{id:t.id,sessionID:t.sessionID,role:`assistant`,time:{created:t.time.created,completed:t.time.completed},parentID:t.parentID,modelID:t.modelID,providerID:t.providerID,mode:t.mode,agent:t.agent??``,path:{cwd:t.path.cwd,root:t.path.root},summary:t.summary,cost:t.cost,tokens:{input:t.tokens.input,output:t.tokens.output,reasoning:t.tokens.reasoning,cache:{read:t.tokens.cache.read,write:t.tokens.cache.write}},finish:t.finish,error:t.error?{name:t.error.name,message:Y(t.error.data.message)??``}:void 0}}function Qi(e){return[...e.map(e=>{let t=Zi(`info`in e?e.info:e),n=`parts`in e?e.parts.map(Xi):void 0;return n==null||n.length===0?t:{...t,parts:n}})].sort((e,t)=>e.time.created-t.time.created)}async function $i(e,t,n){let r=await e.session.list({query:{directory:t}});return r.error==null&&r.data!=null?Array.isArray(r.data)?r.data.map(Ki):[]:(n.warning(`SDK session list failed`,{error:String(r.error)}),[])}async function ea(e,t,n){let r=await e.session.messages({path:{id:t}});return r.error==null&&r.data!=null?Qi(r.data):(n.warning(`SDK session messages failed`,{error:String(r.error)}),[])}async function ta(e,t,n,r){let i=await e.session.list({query:{directory:t,start:n,roots:!0,limit:10}});if(i.error!=null||i.data==null)return r.warning(`SDK session list failed`,{error:String(i.error)}),null;if(!Array.isArray(i.data)||i.data.length===0)return null;let a=i.data.map(Ki);if(a.length===0)return null;let o=a.reduce((e,t)=>t.time.created>e.time.created?t:e);return{projectID:o.projectID,session:o}}async function na(e,t,n){let r=await e.session.delete({path:{id:t}});if(r.error!=null){n.warning(`SDK session delete failed`,{sessionID:t,error:String(r.error)});return}n.debug(`Deleted session via SDK`,{sessionID:t})}const ra={maxSessions:50,maxAgeDays:30};async function ia(e,t,n,r){let{maxSessions:i,maxAgeDays:a}=n;if(r.info(`Starting session pruning`,{workspacePath:t,maxSessions:i,maxAgeDays:a}),await Ji(e,t,r)==null)return r.debug(`No project found for pruning`,{workspacePath:t}),{prunedCount:0,prunedSessionIds:[],remainingCount:0,freedBytes:0};let o=await $i(e,t,r),s=o.filter(e=>e.parentID==null);if(s.length===0)return{prunedCount:0,prunedSessionIds:[],remainingCount:0,freedBytes:0};let c=[...s].sort((e,t)=>t.time.updated-e.time.updated),l=new Date;l.setDate(l.getDate()-a);let u=l.getTime(),f=new Set;for(let e of c)e.time.updated>=u&&f.add(e.id);for(let e=0;e!f.has(e.id)),m=new Set;for(let e of p){m.add(e.id);for(let t of o)t.parentID===e.id&&m.add(t.id)}if(m.size===0)return r.info(`No sessions to prune`),{prunedCount:0,prunedSessionIds:[],remainingCount:s.length,freedBytes:0};let h=[];for(let t of m)try{await na(e,t,r),h.push(t),r.debug(`Pruned session`,{sessionId:t})}catch(e){r.warning(`Failed to prune session`,{sessionId:t,error:d(e)})}let g=s.length-p.length;return r.info(`Session pruning complete`,{prunedCount:h.length,remainingCount:g}),{prunedCount:h.length,prunedSessionIds:h,remainingCount:g,freedBytes:0}}async function aa(e,t,n,r){let{limit:i,fromDate:a,toDate:o}=n;r.debug(`Listing sessions`,{directory:t,limit:i});let s=[...(await $i(e,t,r)).filter(e=>!(e.parentID!=null||a!=null&&e.time.createdo.getTime()))].sort((e,t)=>t.time.updated-e.time.updated),c=[],l=i==null?s:s.slice(0,i);for(let t of l){let n=await ea(e,t.id,r),i=oa(n);c.push({id:t.id,projectID:t.projectID,directory:t.directory,title:t.title,createdAt:t.time.created,updatedAt:t.time.updated,messageCount:n.length,agents:i,isChild:!1})}return r.info(`Listed sessions`,{count:c.length,directory:t}),c}function oa(e){let t=new Set;for(let n of e)n.agent!=null&&t.add(n.agent);return[...t]}async function sa(e,t,n,r,i){let{limit:a=20,caseSensitive:o=!1,sessionId:s}=r;i.debug(`Searching sessions`,{query:e,directory:n,limit:a,caseSensitive:o});let c=o?e:e.toLowerCase(),l=[],u=0;if(s!=null){let e=await ca(t,s,c,o,i);return e.length>0&&l.push({sessionId:s,matches:e.slice(0,a)}),l}let d=await aa(t,n,{},i);for(let e of d){if(u>=a)break;let n=await ca(t,e.id,c,o,i);if(n.length>0){let t=a-u;l.push({sessionId:e.id,matches:n.slice(0,t)}),u+=Math.min(n.length,t)}}return i.info(`Session search complete`,{query:e,resultCount:l.length,totalMatches:u}),l}async function ca(e,t,n,r,i){let a=await ea(e,t,i),o=[];for(let e of a){let t=e.parts??[];for(let i of t){let t=la(i);if(t==null)continue;let a=r?t:t.toLowerCase();if(a.includes(n)){let r=a.indexOf(n),s=Math.max(0,r-50),c=Math.min(t.length,r+n.length+50),l=t.slice(s,c);o.push({messageId:e.id,partId:i.id,excerpt:`...${l}...`,role:e.role,agent:e.agent})}}}return o}function la(e){switch(e.type){case`text`:return e.text;case`reasoning`:return e.reasoning;case`tool`:return e.state.status===`completed`?`${e.tool}: ${e.state.output}`:null;case`step-finish`:return null}}function ua(e){let t=[`--- Fro Bot Run Summary ---`,`Event: ${e.eventType}`,`Repo: ${e.repo}`,`Ref: ${e.ref}`,`Run ID: ${e.runId}`,`Cache: ${e.cacheStatus}`,`Duration: ${e.duration}s`];return e.sessionIds.length>0&&t.push(`Sessions used: ${e.sessionIds.join(`, `)}`),e.logicalKey!=null&&t.push(`Logical Thread: ${e.logicalKey}`),e.createdPRs.length>0&&t.push(`PRs created: ${e.createdPRs.join(`, `)}`),e.createdCommits.length>0&&t.push(`Commits: ${e.createdCommits.join(`, `)}`),e.tokenUsage!=null&&t.push(`Tokens: ${e.tokenUsage.input} in / ${e.tokenUsage.output} out`),t.join(` -`)}async function da(e,t,n,r){let i=ua(t);try{let t=await n.session.prompt({path:{id:e},body:{noReply:!0,parts:[{type:`text`,text:i}]}});if(t.error!=null){r.warning(`SDK prompt writeback failed`,{sessionId:e,error:String(t.error)});return}r.info(`Session summary written via SDK`,{sessionId:e})}catch(t){r.warning(`SDK prompt writeback failed`,{sessionId:e,error:d(t)})}}async function fa(n){let{bootstrapLogger:r,reactionCtx:i,githubClient:a,agentSuccess:o,attachmentResult:s,serverHandle:c,detectedOpencodeVersion:l}=n;try{if(s!=null){let e=P({phase:`attachment-cleanup`});await Ii(s.tempFiles,e)}i!=null&&a!=null&&await or(a,i,o,P({phase:`cleanup`}));let n=P({phase:`prune`}),r=I();if(c!=null){let e=J(r),t=await ia(c.client,e,ra,n);t.prunedCount>0&&n.info(`Pruned old sessions`,{pruned:t.prunedCount,remaining:t.remainingCount})}let u=E(),d=P({phase:`cache-save`}),f=V.join(r,`.git`,`opencode`);if(await ne({components:u,runId:A(),logger:d,storagePath:j(),authPath:te(),projectIdPath:f,opencodeVersion:l})&&t(e.CACHE_SAVED,`true`),fe()){let n=P({phase:`artifact-upload`});await se({logPath:M(),runId:A(),runAttempt:k(),logger:n})&&t(e.ARTIFACT_UPLOADED,`true`)}}catch(e){r.warning(`Cleanup failed (non-fatal)`,{error:e instanceof Error?e.message:String(e)})}finally{if(c!=null)try{c.shutdown()}catch(e){r.warning(`Server shutdown failed (non-fatal)`,{error:e instanceof Error?e.message:String(e)})}}}const pa=V.join(Ee.homedir(),`.cache`,`fro-bot-dedup`);function ma(e){return e.replaceAll(`/`,`-`)}function ha(e,t){let n=ma(e);return V.join(pa,`${n}-${t.entityType}-${t.entityNumber}`)}function ga(e,t){return`${D}-${ma(e)}-${t.entityType}-${t.entityNumber}-`}function _a(e,t,n){return`${ga(e,t)}${n}`}async function va(e,t,n,r=N){let i=ha(e,t),a=V.join(i,`sentinel.json`),o=ga(e,t);try{if(await B.rm(i,{recursive:!0,force:!0}),await B.mkdir(i,{recursive:!0}),await r.restoreCache([i],o,[])==null)return null;let e=await B.readFile(a,`utf8`);return JSON.parse(e)}catch(e){return n.debug(`Dedup marker restore failed; proceeding without marker`,{error:d(e),entityType:t.entityType,entityNumber:t.entityNumber}),null}}async function ya(e,t,n,r,i=N){let a=ha(e,t),o=V.join(a,`sentinel.json`),s=_a(e,t,n.runId);try{return await B.mkdir(a,{recursive:!0}),await B.writeFile(o,JSON.stringify(n),`utf8`),await i.saveCache([a],s),!0}catch(e){return d(e).toLowerCase().includes(`already exists`)?!0:(r.debug(`Dedup marker save failed`,{error:d(e),entityType:t.entityType,entityNumber:t.entityNumber,saveKey:s}),!1)}}const ba=new Set([`pull_request`,`issues`]),xa=new Set([`synchronize`,`reopened`]);function Sa(e){return e.target==null||!ba.has(e.eventType)?null:e.eventType===`pull_request`&&e.target.kind===`pr`?{entityType:`pr`,entityNumber:e.target.number}:e.eventType===`issues`&&e.target.kind===`issue`?{entityType:`issue`,entityNumber:e.target.number}:null}async function Ca(e,t,n,r,i=P({phase:`dedup`}),a){let o=Sa(t);if(e===0)return{shouldProceed:!0,entity:o};if(o==null)return{shouldProceed:!0,entity:null};if(t.action!=null&&xa.has(t.action))return i.debug(`Dedup bypassed for action`,{action:t.action}),{shouldProceed:!0,entity:o};let s=await va(n,o,i,a);if(s==null||s.runId===t.runId)return{shouldProceed:!0,entity:o};let c=new Date(s.timestamp).getTime();if(Number.isNaN(c))return i.warning(`Dedup marker timestamp is invalid; proceeding without dedup`,{markerTimestamp:s.timestamp}),{shouldProceed:!0,entity:o};let l=Date.now()-c;if(l<-6e4)return i.warning(`Dedup marker timestamp is too far in the future; proceeding without dedup`,{markerTimestamp:s.timestamp,markerAge:l}),{shouldProceed:!0,entity:o};let u=Math.max(0,l);return u>e?{shouldProceed:!0,entity:o}:(i.info(`Skipping duplicate trigger within dedup window`,{eventType:t.eventType,action:t.action,runId:t.runId,markerRunId:s.runId,markerTimestamp:s.timestamp,dedupWindow:e,entityType:o.entityType,entityNumber:o.entityNumber}),Ne({sessionId:null,cacheStatus:`miss`,duration:Date.now()-r}),await Ta(t,o,s,u,e,i),{shouldProceed:!1,entity:o})}async function wa(e,t,n,r=P({phase:`dedup`}),i){await ya(n,t,{timestamp:new Date().toISOString(),runId:e.runId,action:e.action??`unknown`,eventType:e.eventType,entityType:t.entityType,entityNumber:t.entityNumber},r,i)}async function Ta(e,t,n,r,i,a){try{let a=Math.round(r/1e3),o=Math.round(i/1e3),s=`${t.entityType} #${t.entityNumber}`,c=`https://github.com/${e.repo.owner}/${e.repo.repo}/actions/runs/${n.runId}`;S.addHeading(`Fro Bot Agent Run — Skipped (Dedup)`,2).addRaw(`Execution skipped because the agent already ran for **${s}** recently.\n\n`).addTable([[{data:`Detail`,header:!0},{data:`Value`,header:!0}],[`Current action`,`\`${e.eventType}.${e.action??`unknown`}\``],[`Prior run`,`[${n.runId}](${c})`],[`Prior action`,`\`${n.eventType}.${n.action}\``],[`Time since prior run`,`${a}s`],[`Dedup window`,`${o}s`]]).addRaw(` +If you had completed the task, confirm the completion.`,u=r===1?e.fileParts:void 0,g=await(async()=>{try{return await In(s,l,a,u,f,n,t)}finally{await ln(s,l,n?.sessionTitle,t)}})();if(g.success)return p=g.eventStreamResult,{success:!0,exitCode:0,duration:Date.now()-i,sessionId:l,error:null,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:null};if(m=g.error,h=g.llmError,!g.shouldRetry||r>=3)break;t.warning(`LLM fetch error detected, retrying with continuation prompt`,{attempt:r,maxAttempts:3,error:g.error,delayMs:Nn,sessionId:l}),await un(Nn)}return{success:!1,exitCode:1,duration:Date.now()-i,sessionId:l,error:m??`Unknown error`,tokenUsage:p.tokens,model:p.model,cost:p.cost,prsCreated:p.prsCreated,commitsCreated:p.commitsCreated,commentsPosted:p.commentsPosted,llmError:h}}catch(e){let n=Date.now()-i,r=d(e);return t.error(`OpenCode execution failed`,{error:r,durationMs:n}),{success:!1,exitCode:1,duration:n,sessionId:null,error:r,tokenUsage:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:gn(e)?_n(r):null}}finally{s!=null&&clearTimeout(s),a.abort(),l&&u?.close()}}async function Qn(e,t,n){return t.commentId==null?(n.debug(`No comment ID, skipping eyes reaction`),!1):await Ie(e,t.repo,t.commentId,`eyes`,n)==null?!1:(n.info(`Added eyes reaction`,{commentId:t.commentId}),!0)}async function $n(e,t,n){return t.issueNumber==null?(n.debug(`No issue number, skipping working label`),!1):await ze(e,t.repo,`agent: working`,`fcf2e1`,`Agent is currently working on this`,n)&&await Be(e,t.repo,t.issueNumber,[`agent: working`],n)?(n.info(`Added working label`,{issueNumber:t.issueNumber}),!0):!1}async function er(e,t,n){await Promise.all([Qn(e,t,n),$n(e,t,n)])}async function tr(e,t,n){if(t.commentId==null||t.botLogin==null)return;let r=(await Le(e,t.repo,t.commentId,n)).find(e=>e.content===`eyes`&&e.userLogin===t.botLogin);r!=null&&await Re(e,t.repo,t.commentId,r.id,n)}async function nr(e,t,n,r){t.commentId!=null&&await Ie(e,t.repo,t.commentId,n,r)}async function rr(e,t,n){if(t.commentId==null||t.botLogin==null){n.debug(`Missing comment ID or bot login, skipping reaction update`);return}try{await tr(e,t,n),await nr(e,t,`hooray`,n),n.info(`Updated reaction to success indicator`,{commentId:t.commentId,reaction:`hooray`})}catch(e){n.warning(`Failed to update reaction (non-fatal)`,{error:d(e)})}}async function ir(e,t,n){if(t.commentId==null||t.botLogin==null){n.debug(`Missing comment ID or bot login, skipping reaction update`);return}try{await tr(e,t,n),await nr(e,t,`confused`,n),n.info(`Updated reaction to confused`,{commentId:t.commentId})}catch(e){n.warning(`Failed to update failure reaction (non-fatal)`,{error:d(e)})}}async function ar(e,t,n){if(t.issueNumber==null){n.debug(`No issue number, skipping label removal`);return}await Ve(e,t.repo,t.issueNumber,`agent: working`,n)&&n.info(`Removed working label`,{issueNumber:t.issueNumber})}async function or(e,t,n,r){n?await rr(e,t,r):await ir(e,t,r),await ar(e,t,r)}var K=h(D(),1),sr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},cr=class{constructor(e,t,n){if(e<1)throw Error(`max attempts should be greater than or equal to 1`);if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(n),this.minSeconds>this.maxSeconds)throw Error(`min seconds should be less than or equal to max seconds`)}execute(e,t){return sr(this,void 0,void 0,function*(){let n=1;for(;nsetTimeout(t,e*1e3))})}},q=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},lr=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};const ur=process.platform===`win32`;process.platform;function dr(e,t,n,r){return q(this,void 0,void 0,function*(){return t||=F.join(Er(),ye.randomUUID()),yield ce(F.dirname(t)),m(`Downloading ${e}`),m(`Destination ${t}`),yield new cr(3,Dr(`TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS`,10),Dr(`TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS`,20)).execute(()=>q(this,void 0,void 0,function*(){return yield fr(e,t||``,n,r)}),e=>!(e instanceof lr&&e.httpStatusCode&&e.httpStatusCode<500&&e.httpStatusCode!==408&&e.httpStatusCode!==429))})}function fr(e,t,n,r){return q(this,void 0,void 0,function*(){if(P.existsSync(t))throw Error(`Destination file path ${t} already exists`);let i=new w(`actions/tool-cache`,[],{allowRetries:!1});n&&(m(`set auth`),r===void 0&&(r={}),r.authorization=n);let a=yield i.get(e,r);if(a.message.statusCode!==200){let t=new lr(a.message.statusCode);throw m(`Failed to download from "${e}". Code(${a.message.statusCode}) Message(${a.message.statusMessage})`),t}let o=xe.promisify(je.pipeline),s=Dr(`TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY`,()=>a.message)(),c=!1;try{return yield o(s,P.createWriteStream(t)),m(`download complete`),c=!0,t}finally{if(!c){m(`download failed`);try{yield l(t)}catch(e){m(`Failed to delete '${t}'. ${e.message}`)}}}})}function pr(e,t){return q(this,arguments,void 0,function*(e,t,n=`xz`){if(!e)throw Error(`parameter 'file' is required`);t=yield br(t),m(`Checking tar --version`);let r=``;yield x(`tar --version`,[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>r+=e.toString(),stderr:e=>r+=e.toString()}}),m(r.trim());let i=r.toUpperCase().includes(`GNU TAR`),a;a=n instanceof Array?n:[n],_e()&&!n.includes(`v`)&&a.push(`-v`);let o=t,s=e;return ur&&i&&(a.push(`--force-local`),o=t.replace(/\\/g,`/`),s=e.replace(/\\/g,`/`)),i&&(a.push(`--warning=no-unknown-keyword`),a.push(`--overwrite`)),a.push(`-C`,o,`-f`,s),yield x(`tar`,a),t})}function mr(e,t){return q(this,void 0,void 0,function*(){if(!e)throw Error(`parameter 'file' is required`);return t=yield br(t),ur?yield hr(e,t):yield gr(e,t),t})}function hr(e,t){return q(this,void 0,void 0,function*(){let n=e.replace(/'/g,`''`).replace(/"|\n|\r/g,``),r=t.replace(/'/g,`''`).replace(/"|\n|\r/g,``),i=yield C(`pwsh`,!1);if(i){let e=[`-NoLogo`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Unrestricted`,`-Command`,[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${n}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${n}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(` `)];m(`Using pwsh at path: ${i}`),yield x(`"${i}"`,e)}else{let e=[`-NoLogo`,`-Sta`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Unrestricted`,`-Command`,[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${n}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${n}', '${r}', $true) }`].join(` `)],t=yield C(`powershell`,!0);m(`Using powershell at path: ${t}`),yield x(`"${t}"`,e)}})}function gr(e,t){return q(this,void 0,void 0,function*(){let n=yield C(`unzip`,!0),r=[e];_e()||r.unshift(`-q`),r.unshift(`-o`),yield x(`"${n}"`,r,{cwd:t})})}function _r(e,t,n,r){return q(this,void 0,void 0,function*(){if(n=K.clean(n)||n,r||=ve.arch(),m(`Caching tool ${t} ${n} ${r}`),m(`source dir: ${e}`),!P.statSync(e).isDirectory())throw Error(`sourceDir is not a directory`);let i=yield xr(t,n,r);for(let t of P.readdirSync(e))yield u(F.join(e,t),i,{recursive:!0});return Sr(t,n,r),i})}function vr(e,t,n){if(!e)throw Error(`toolName parameter is required`);if(!t)throw Error(`versionSpec parameter is required`);n||=ve.arch(),Cr(t)||(t=wr(yr(e,n),t));let r=``;if(t){t=K.clean(t)||``;let i=F.join(Tr(),e,t,n);m(`checking cache: ${i}`),P.existsSync(i)&&P.existsSync(`${i}.complete`)?(m(`Found tool in cache ${e} ${t} ${n}`),r=i):m(`not found`)}return r}function yr(e,t){let n=[];t||=ve.arch();let r=F.join(Tr(),e);if(P.existsSync(r)){let e=P.readdirSync(r);for(let i of e)if(Cr(i)){let e=F.join(r,i,t||``);P.existsSync(e)&&P.existsSync(`${e}.complete`)&&n.push(i)}}return n}function br(e){return q(this,void 0,void 0,function*(){return e||=F.join(Er(),ye.randomUUID()),yield ce(e),e})}function xr(e,t,n){return q(this,void 0,void 0,function*(){let r=F.join(Tr(),e,K.clean(t)||t,n||``);m(`destination ${r}`);let i=`${r}.complete`;return yield l(r),yield l(i),yield ce(r),r})}function Sr(e,t,n){let r=`${F.join(Tr(),e,K.clean(t)||t,n||``)}.complete`;P.writeFileSync(r,``),m(`finished caching tool`)}function Cr(e){let t=K.clean(e)||``;m(`isExplicit: ${t}`);let n=K.valid(t)!=null;return m(`explicit? ${n}`),n}function wr(e,t){let n=``;m(`evaluating ${e.length} versions`),e=e.sort((e,t)=>K.gt(e,t)?1:-1);for(let r=e.length-1;r>=0;r--){let i=e[r];if(K.satisfies(i,t)){n=i;break}}return m(n?`matched: ${n}`:`match not found`),n}function Tr(){let e=process.env.RUNNER_TOOL_CACHE||``;return be(e,`Expected RUNNER_TOOL_CACHE to be defined`),e}function Er(){let e=process.env.RUNNER_TEMP||``;return be(e,`Expected RUNNER_TEMP to be defined`),e}function Dr(e,t){let n=global[e];return n===void 0?t:n}function Or(){return{find:vr,downloadTool:dr,extractTar:pr,extractZip:mr,cacheDir:_r}}function kr(){return{exec:x,getExecOutput:o}}function Ar(e){let t;try{t=JSON.parse(e)}catch(e){throw e instanceof SyntaxError?Error(`Invalid auth-json format: ${e.message}`):e}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`auth-json must be a JSON object`);return t}async function jr(e,t,n){let r=L.join(t,`auth.json`);await I.mkdir(t,{recursive:!0});let i=JSON.stringify(e,null,2);return await I.writeFile(r,i,{mode:384}),n.info(`Populated auth.json`,{path:r,providers:Object.keys(e).length}),r}function Mr(){let e=N.platform,t=N.arch;return{os:{darwin:`darwin`,linux:`linux`,win32:`windows`}[e]??`linux`,arch:{arm64:`aarch64`,x64:`x64`}[t]??`x64`,ext:`.zip`}}function Nr(e,t){return`https://github.com/oven-sh/bun/releases/download/bun-${e.startsWith(`v`)?e:`v${e}`}/${`bun-${t.os}-${t.arch}${t.ext}`}`}async function Pr(e,t,n,r,i=_){let a=Mr(),o=t.find(`bun`,i,a.arch);if(o.length>0)return e.info(`Bun found in cache`,{version:i,path:o}),r(o),await Ir(o),{path:o,version:i,cached:!0};e.info(`Downloading Bun`,{version:i});let s=Nr(i,a);try{let o=await t.downloadTool(s);if(N.platform!==`win32`&&!await Lr(o,e,n))throw Error(`Downloaded Bun archive appears corrupted`);e.info(`Extracting Bun`);let c=await Fr(await t.extractZip(o),t),l=R.dirname(c);e.info(`Caching Bun`);let u=await t.cacheDir(l,`bun`,i,a.arch);return r(u),await Ir(u),e.info(`Bun installed`,{version:i,path:u}),{path:u,version:i,cached:!1}}catch(e){let t=d(e);throw Error(`Failed to install Bun ${i}: ${t}`)}}async function Fr(e,t){for(let n of await Ee.readdir(e,{withFileTypes:!0})){let{name:r}=n,i=R.join(e,r);if(n.isFile()){if(r===`bun`||r===`bun.exe`)return i;if(/^bun.*\.zip/.test(r))return Fr(await t.extractZip(i),t)}if(r.startsWith(`bun`)&&n.isDirectory())return Fr(i,t)}throw Error(`Could not find executable: bun`)}async function Ir(e){let t=e=>N.platform===`win32`?`${e}.exe`:e,n=R.join(e,t(`bun`));try{await Ee.symlink(n,R.join(e,t(`bunx`)))}catch(e){let t=typeof e==`object`?e.code:void 0;if(t!==`EEXIST`&&t!==`EPERM`&&t!==`EACCES`)throw e}}async function Lr(e,t,n){try{let{stdout:r}=await n.getExecOutput(`file`,[e],{silent:!0}),i=r.includes(`Zip archive`)||r.includes(`ZIP`);return i||t.warning(`Bun download validation failed`,{output:r.trim()}),i}catch{return t.debug(`Could not validate Bun download (file command unavailable)`),!0}}function Rr(e,t){let n={autoupdate:!1};if(e.opencodeConfig!=null){let t;try{t=JSON.parse(e.opencodeConfig)}catch{return{config:n,error:`opencode-config must be valid JSON`}}if(typeof t!=`object`||!t||Array.isArray(t))return{config:n,error:`opencode-config must be a JSON object`};Object.assign(n,t)}let r=`@fro.bot/systematic@${e.systematicVersion}`,i=Array.isArray(n.plugins)?n.plugins:[];return i.some(e=>typeof e==`string`&&e.startsWith(`@fro.bot/systematic`))||(n.plugins=[...i,r]),t.debug(`Built CI OpenCode config`,{hasUserConfig:e.opencodeConfig!=null,pluginCount:Array.isArray(n.plugins)?n.plugins.length:0}),{config:n,error:null}}function zr(e){return{debug:t=>e.debug(t),info:t=>e.info(t),warn:t=>e.warning(t),error:t=>e.error(t)}}function Br(e){let{token:t,logger:n}=e;return n.debug(`Creating GitHub client with token`),fe(t,{log:zr(n)})}async function Vr(e,t){try{let{data:n}=await e.rest.users.getAuthenticated();return t.debug(`Authenticated as`,{login:n.login,type:n.type}),n.login}catch{return t.debug(`Failed to get authenticated user, may be app token`),`fro-bot[bot]`}}async function Hr(e,t,n,r){let i=t??n,a=t==null?n.length>0?`github-token`:`none`:`app-token`;if(i.length===0)return r.warning(`No GitHub token available`),{authenticated:!1,method:`none`,botLogin:null};N.env.GH_TOKEN=i,r.info(`Configured authentication`,{method:a});let o=null;return e!=null&&(o=await Vr(e,r)),{authenticated:!0,method:a,botLogin:o}}async function Ur(e,t){let n=await t.getExecOutput(`git`,[`config`,e],{ignoreReturnCode:!0,silent:!0});return n.exitCode===0&&n.stdout.trim().length>0?n.stdout.trim():null}async function Wr(e,t,n,r){let i=await Ur(`user.name`,r),a=await Ur(`user.email`,r);if(i!=null&&a!=null){n.info(`Git identity already configured`,{name:i,email:a});return}if(t==null)throw Error(`Cannot configure Git identity: no authenticated GitHub user`);let o=null;if(a==null){let r=await Ge(e,t,n);if(r==null)throw Error(`Cannot configure Git identity: failed to look up user ID for '${t}'`);o=String(r.id)}i??await r.exec(`git`,[`config`,`--global`,`user.name`,t],void 0);let s=`${o}+${t}@users.noreply.github.com`;a??await r.exec(`git`,[`config`,`--global`,`user.email`,s],void 0),n.info(`Configured git identity`,{name:i??t,email:a??s})}const Gr=new Set([`__proto__`,`prototype`,`constructor`]);function Kr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qr(e,t){let n=Object.create(null);for(let[t,r]of Object.entries(e))Gr.has(t)||(n[t]=r);for(let[e,r]of Object.entries(t)){if(Gr.has(e))continue;let t=n[e];Kr(r)&&Kr(t)?n[e]=qr(t,r):n[e]=r}return n}async function Jr(e,t,n){let r=JSON.parse(e);if(!Kr(r))throw Error(`omo-config must be a JSON object (non-null, non-array)`);let i=r;await I.mkdir(t,{recursive:!0});let a=L.join(t,`oh-my-opencode.json`),o={};try{let e=await I.readFile(a,`utf8`),t=JSON.parse(e);typeof t==`object`&&t&&!Array.isArray(t)&&(o=t)}catch(e){n.debug(`Using empty base oMo config`,{path:a,error:String(e)})}let s=qr(o,i);await I.writeFile(a,JSON.stringify(s,null,2)),n.info(`Wrote oMo config`,{path:a,keyCount:Object.keys(i).length})}async function Yr(e,t,n={}){let{logger:r,execAdapter:i}=t,{claude:a=`no`,copilot:o=`no`,gemini:s=`no`,openai:c=`no`,opencodeZen:l=`no`,zaiCodingPlan:u=`no`,kimiForCoding:f=`no`}=n;r.info(`Installing Oh My OpenAgent plugin`,{version:e,claude:a,copilot:o,gemini:s,openai:c,opencodeZen:l,zaiCodingPlan:u,kimiForCoding:f});let p=``,m=[`oh-my-openagent@${e}`,`install`,`--no-tui`,`--skip-auth`,`--claude=${a}`,`--copilot=${o}`,`--gemini=${s}`,`--openai=${c}`,`--opencode-zen=${l}`,`--zai-coding-plan=${u}`,`--kimi-for-coding=${f}`];try{let t=await i.exec(`bunx`,m,{listeners:{stdout:e=>{p+=e.toString()},stderr:e=>{p+=e.toString()}},ignoreReturnCode:!0});if(t!==0){let e=`bunx oh-my-openagent install returned exit code ${t}`;return r.error(e,{output:p.slice(0,1e3)}),{installed:!1,version:null,error:`${e}\n${p.slice(0,500)}`}}let n=/oh-my-opencode@(\d+\.\d+\.\d+)/i.exec(p),a=n!=null&&n[1]!=null?n[1]:e;return r.info(`oMo plugin installed`,{version:a}),{installed:!0,version:a,error:null}}catch(e){let t=d(e),n=p.length>0?`${t}\nOutput: ${p.slice(0,500)}`:t;return r.error(`Failed to run oMo installer`,{error:t,output:p.slice(0,500)}),{installed:!1,version:null,error:`bunx oh-my-openagent install failed: ${n}`}}}const Xr=`opencode`,Zr=i;function Qr(){let e=ke.platform(),t=ke.arch(),n={darwin:`darwin`,linux:`linux`,win32:`windows`},r={x64:`x64`,arm64:`arm64`},i=e===`win32`||e===`darwin`?`.zip`:`.tar.gz`;return{os:n[e]??`linux`,arch:r[t]??`x64`,ext:i}}function $r(e,t){return`https://github.com/anomalyco/opencode/releases/download/${e.startsWith(`v`)?e:`v${e}`}/${`opencode-${t.os}-${t.arch}${t.ext}`}`}async function ei(e,t,n,r){if(N.platform===`win32`)return!0;try{let{stdout:i}=await r.getExecOutput(`file`,[e],{silent:!0}),a=(t===`.zip`?[`Zip archive`,`ZIP`]:[`gzip`,`tar`,`compressed`]).some(e=>i.includes(e));return a||n.warning(`Download validation failed`,{output:i.trim()}),a}catch{return n.debug(`Could not validate download (file command unavailable)`),!0}}async function ti(e,t,n,r,i=Zr){let a=Qr(),o=n.find(Xr,e,a.arch);if(o.length>0)return t.info(`OpenCode found in cache`,{version:e,path:o}),{path:o,version:e,cached:!0};try{return await ni(e,a,t,n,r)}catch(n){t.warning(`Primary version install failed, trying fallback`,{requestedVersion:e,fallbackVersion:i,error:d(n)})}if(e!==i)try{let e=await ni(i,a,t,n,r);return t.info(`Installed fallback version`,{version:i}),e}catch(t){throw Error(`Failed to install OpenCode (tried ${e} and ${i}): ${d(t)}`)}throw Error(`Failed to install OpenCode version ${e}`)}async function ni(e,t,n,r,i){n.info(`Downloading OpenCode`,{version:e});let a=$r(e,t),o=await r.downloadTool(a);if(!await ei(o,t.ext,n,i))throw Error(`Downloaded archive appears corrupted`);n.info(`Extracting OpenCode`);let s=t.ext===`.zip`?await r.extractZip(o):await r.extractTar(o);n.info(`Caching OpenCode`);let c=await r.cacheDir(s,Xr,e,t.arch);return n.info(`OpenCode installed`,{version:e,path:c}),{path:c,version:e,cached:!1}}async function ri(e){let t=await fetch(`https://api.github.com/repos/anomalyco/opencode/releases/latest`);if(!t.ok)throw Error(`Failed to fetch latest OpenCode version: ${t.statusText}`);let n=(await t.json()).tag_name.replace(/^v/,``);return e.info(`Latest OpenCode version`,{version:n}),n}function ii(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function ai(e,t,n){let r=JSON.parse(e);if(!ii(r))throw Error(`systematic-config must be a JSON object (non-null, non-array)`);await I.mkdir(t,{recursive:!0});let i=L.join(t,`systematic.json`),a={};try{let e=await I.readFile(i,`utf8`),t=JSON.parse(e);ii(t)&&(a=t)}catch(e){n.debug(`Using empty base Systematic config`,{path:i,error:String(e)})}let o=qr(a,r);await I.writeFile(i,JSON.stringify(o,null,2)),n.info(`Wrote Systematic config`,{path:i,keyCount:Object.keys(r).length})}const oi={restoreCache:async(e,t,n)=>se(e,t,n),saveCache:async(e,t)=>ue(e,t)};function si(e){let{os:t,opencodeVersion:n,omoVersion:r,systematicVersion:i}=e;return`${re}-${t}-oc-${n}-omo-${r}-sys-${i}`}function ci(e){let{os:t,opencodeVersion:n,omoVersion:r,systematicVersion:i}=e;return[`${re}-${t}-oc-${n}-omo-${r}-sys-${i}-`]}async function li(e){let{logger:t,os:n,opencodeVersion:r,omoVersion:i,systematicVersion:a,toolCachePath:o,bunCachePath:s,omoConfigPath:c,cacheAdapter:l=oi}=e,u=si({os:n,opencodeVersion:r,omoVersion:i,systematicVersion:a}),f=ci({os:n,opencodeVersion:r,omoVersion:i,systematicVersion:a}),p=[o,s,c];t.info(`Restoring tools cache`,{primaryKey:u,restoreKeys:[...f],paths:p});try{let e=await l.restoreCache(p,u,[...f]);return e==null?(t.info(`Tools cache miss - will install tools`),{hit:!1,restoredKey:null}):(t.info(`Tools cache restored`,{restoredKey:e}),{hit:!0,restoredKey:e})}catch(e){return t.warning(`Tools cache restore failed`,{error:d(e)}),{hit:!1,restoredKey:null}}}async function ui(e){let{logger:t,os:n,opencodeVersion:r,omoVersion:i,systematicVersion:a,toolCachePath:o,bunCachePath:s,omoConfigPath:c,cacheAdapter:l=oi}=e,u=si({os:n,opencodeVersion:r,omoVersion:i,systematicVersion:a}),f=[o,s,c];t.info(`Saving tools cache`,{saveKey:u,paths:f});try{return await l.saveCache(f,u),t.info(`Tools cache saved`,{saveKey:u}),!0}catch(e){return e instanceof Error&&e.message.includes(`already exists`)?(t.info(`Tools cache key already exists, skipping save`),!0):(t.warning(`Tools cache save failed`,{error:d(e)}),!1)}}async function di(e,t){let n=Date.now(),r=j({component:`setup`}),i=Or(),o=kr();try{r.info(`Starting setup`,{version:e.opencodeVersion});let c;try{c=Ar(e.authJson)}catch(e){return b(`Invalid auth-json: ${d(e)}`),null}let l=e.opencodeVersion;if(l===`latest`)try{l=await ri(r)}catch(e){r.warning(`Failed to get latest version, using fallback`,{error:d(e)}),l=Zr}let u=e.omoVersion,p=e.systematicVersion,m=N.env.RUNNER_TOOL_CACHE??`/opt/hostedtoolcache`,h=z(m,`opencode`),g=z(m,`bun`),v=z(Ae(),`.config`,`opencode`),y=ee(),x=await li({logger:r,os:y,opencodeVersion:l,omoVersion:u,systematicVersion:p,toolCachePath:h,bunCachePath:g,omoConfigPath:v}),S=x.hit?`hit`:`miss`,C,w=!1,T=null;if(x.hit){let e=i.find(`opencode`,l);e.length>0?(C={path:e,version:l,cached:!0},r.info(`Tools cache hit, using cached OpenCode CLI`,{version:l,omoVersion:u})):r.warning(`Tools cache hit but binary not found in tool-cache, falling through to install`,{requestedVersion:l,restoredKey:x.restoredKey})}if(C==null)try{C=await ti(l,r,i,o)}catch(e){return b(`Failed to install OpenCode: ${d(e)}`),null}let E=!1;try{await Pr(r,i,o,f,_),E=!0}catch(e){r.warning(`Bun installation failed, oMo will be unavailable`,{error:d(e)})}if(E){if(e.omoConfig!=null)try{await Jr(e.omoConfig,v,r)}catch(e){r.warning(`Failed to write omo-config, continuing without custom config`,{error:d(e)})}if(e.systematicConfig!=null)try{await ai(e.systematicConfig,v,r)}catch(e){r.warning(`systematic-config write failed: ${d(e)}`)}let t=await Yr(u,{logger:r,execAdapter:o},e.omoProviders);t.installed?(r.info(`oMo installed`,{version:t.version}),w=!0):r.warning(`oMo installation failed, continuing without oMo`,{error:t.error??`unknown error`}),T=t.error}let D=Rr({opencodeConfig:e.opencodeConfig,systematicVersion:p},r);if(D.error!=null)return b(D.error),null;a(`OPENCODE_CONFIG_CONTENT`,JSON.stringify(D.config)),x.hit||await ui({logger:r,os:y,opencodeVersion:l,omoVersion:u,systematicVersion:p,toolCachePath:h,bunCachePath:g,omoConfigPath:v}),f(C.path),s(`opencode-path`,C.path),s(`opencode-version`,C.version),r.info(`OpenCode ready`,{version:C.version,cached:C.cached});let te=fe(t),O=await Hr(te,null,t,r);a(`GH_TOKEN`,t),r.info(`GitHub CLI configured`),await Wr(te,O.botLogin,r,o);let ne=z(pe(),`opencode`),k=await jr(c,ne,r);s(`auth-json-path`,k),r.info(`auth.json populated`,{path:k});let A=Date.now()-n,j={opencodePath:C.path,opencodeVersion:C.version,ghAuthenticated:O.authenticated,omoInstalled:w,omoError:T,toolsCacheStatus:S,duration:A};return r.info(`Setup complete`,{duration:A}),j}catch(e){let t=d(e);return r.error(`Setup failed`,{error:t}),b(t),null}}function fi(e){return{success:!0,data:e}}function pi(e){return{success:!1,error:e}}const mi=[`OWNER`,`MEMBER`,`COLLABORATOR`];async function hi(e,t){try{let{client:n,server:r}=await cn({signal:e});return t.debug(`OpenCode server bootstrapped`,{url:r.url}),fi({client:n,server:r,shutdown:()=>{r.close()}})}catch(e){let n=e instanceof Error?e.message:String(e);return t.warning(`Failed to bootstrap OpenCode server`,{error:n}),pi(Error(`Server bootstrap failed: ${n}`))}}async function gi(e,t){let n=e??`opencode`;try{let e=``;await x(n,[`--version`],{listeners:{stdout:t=>{e+=t.toString()}},silent:!0});let r=/(\d+\.\d+\.\d+)/.exec(e)?.[1]??null;return t.debug(`OpenCode version verified`,{version:r}),{available:!0,version:r}}catch{return t.debug(`OpenCode not available, will attempt auto-setup`),{available:!1,version:null}}}async function _i(e){let{logger:t,opencodeVersion:n}=e,r=N.env.OPENCODE_PATH??null,i=await gi(r,t);if(i.available&&i.version!=null)return t.info(`OpenCode already available`,{version:i.version}),{path:r??`opencode`,version:i.version,didSetup:!1};t.info(`OpenCode not found, running auto-setup`,{requestedVersion:n});let a=await di({opencodeVersion:n,authJson:e.authJson,appId:null,privateKey:null,opencodeConfig:e.opencodeConfig,systematicConfig:e.systematicConfig,omoConfig:null,omoVersion:e.omoVersion,systematicVersion:e.systematicVersion,omoProviders:e.omoProviders},e.githubToken);if(a==null)throw Error(`Auto-setup failed: runSetup returned null`);return f(a.opencodePath),N.env.OPENCODE_PATH=a.opencodePath,t.info(`Auto-setup completed`,{version:a.opencodeVersion,path:a.opencodePath}),{path:a.opencodePath,version:a.opencodeVersion,didSetup:!0}}async function vi(e,t){let n={repo:e.agentContext.repo,commentId:e.agentContext.commentId,issueNumber:e.agentContext.issueNumber,issueType:e.agentContext.issueType,botLogin:e.botLogin},r=j({phase:`acknowledgment`});return await er(e.githubClient,n,r),t.debug(`Acknowledgment phase completed`),n}function yi(e,t){try{JSON.parse(e)}catch{throw Error(`${t} must be valid JSON`)}}function bi(e,t){let n=e.trim();if(!/^\d+$/.test(n))throw Error(`${t} must be a positive integer, received: ${e}`);let r=Number.parseInt(n,10);if(r===0)throw Error(`${t} must be a positive integer, received: ${e}`);return r}function xi(e){let t=e.trim(),n=t.indexOf(`/`);if(n===-1)throw Error(`Invalid model format: "${e}". Expected "provider/model" (e.g., "anthropic/claude-sonnet-4-20250514")`);let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();if(r.length===0)throw Error(`Invalid model format: "${e}". Provider cannot be empty.`);if(i.length===0)throw Error(`Invalid model format: "${e}". Model ID cannot be empty.`);return{providerID:r,modelID:i}}function Si(e,t=`timeout`){let n=e.trim();if(!/^\d+$/.test(n))throw Error(`${t} must be a non-negative integer, received: ${e}`);let r=Number.parseInt(n,10);if(Number.isNaN(r)||r<0)throw Error(`${t} must be a non-negative integer, received: ${e}`);return r}const Ci=[`claude`,`claude-max20`,`copilot`,`gemini`,`openai`,`opencode-zen`,`zai-coding-plan`,`kimi-for-coding`];function wi(e){let t=e.split(`,`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0),n=`no`,r=`no`,i=`no`,a=`no`,o=`no`,s=`no`,c=`no`;for(let e of t){if(!Ci.includes(e))throw Error(`Invalid omo-providers value: "${e}". Valid values: ${Ci.join(`, `)}`);switch(e){case`claude`:n=`yes`;break;case`claude-max20`:n=`max20`;break;case`copilot`:r=`yes`;break;case`gemini`:i=`yes`;break;case`openai`:a=`yes`;break;case`opencode-zen`:o=`yes`;break;case`zai-coding-plan`:s=`yes`;break;case`kimi-for-coding`:c=`yes`;break}}return{claude:n,copilot:r,gemini:i,openai:a,opencodeZen:o,zaiCodingPlan:s,kimiForCoding:c}}function Ti(){try{let e=c(`github-token`,{required:!0}).trim();if(e.length===0)return pi(Error(`github-token is required but was not provided`));let t=c(`auth-json`,{required:!0}).trim();if(t.length===0)return pi(Error(`auth-json is required but was not provided`));yi(t,`auth-json`);let a=c(`prompt`).trim(),o=a.length>0?a:null,s=c(`session-retention`).trim(),l=s.length>0?bi(s,`session-retention`):50,u=c(`s3-backup`).trim().toLowerCase()===`true`,d=c(`s3-bucket`).trim(),f=d.length>0?d:null,m=c(`aws-region`).trim(),h=m.length>0?m:null,g=c(`agent`).trim(),_=g.length>0?g:he,y=c(`model`).trim(),b=y.length>0?xi(y):null,x=c(`timeout`).trim(),S=x.length>0?Si(x):p,C=c(`opencode-version`).trim(),w=C.length>0?C:i,ee=c(`skip-cache`).trim().toLowerCase()===`true`,T=c(`omo-version`).trim(),E=T.length>0?T:v,D=c(`systematic-version`).trim(),te=D.length>0?D:r,O=c(`omo-providers`).trim(),ne=wi(O.length>0?O:``),k=c(`opencode-config`).trim(),A=k.length>0?k:null,j=c(`systematic-config`).trim(),re=j.length>0?j:null,ie=c(`dedup-window`).trim(),ae=ie.length>0?Si(ie,`dedup-window`):n;if(A!=null){yi(A,`opencode-config`);let e=JSON.parse(A);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Input 'opencode-config' must be a JSON object`)}return fi({githubToken:e,authJson:t,prompt:o,sessionRetention:l,s3Backup:u,s3Bucket:f,awsRegion:h,agent:_,model:b,timeoutMs:S,opencodeVersion:w,skipCache:ee,omoVersion:E,systematicVersion:te,omoProviders:ne,opencodeConfig:A,systematicConfig:re,dedupWindow:ae})}catch(e){return pi(e instanceof Error?e:Error(String(e)))}}async function Ei(n){let r=Ti();if(!r.success)return b(`Invalid inputs: ${r.error.message}`),null;let i=r.data,a=j({phase:`main`});a.info(`Action inputs parsed`,{sessionRetention:i.sessionRetention,s3Backup:i.s3Backup,hasGithubToken:i.githubToken.length>0,hasPrompt:i.prompt!=null,agent:i.agent,hasModelOverride:i.model!=null,timeoutMs:i.timeoutMs});let o=await _i({logger:a,opencodeVersion:i.opencodeVersion,githubToken:i.githubToken,authJson:i.authJson,omoVersion:i.omoVersion,systematicVersion:i.systematicVersion,omoProviders:i.omoProviders,opencodeConfig:i.opencodeConfig,systematicConfig:i.systematicConfig});return o.didSetup?a.info(`OpenCode auto-setup completed`,{version:o.version}):a.info(`OpenCode already available`,{version:o.version}),t(e.OPENCODE_VERSION,o.version),n.debug(`Bootstrap phase completed`,{opencodeVersion:o.version}),{inputs:i,logger:a,opencodeResult:o}}const Di=/^[0-9a-f]{40}$/i;function Oi(){return{exec:x,getExecOutput:o}}async function ki(e){let{workspacePath:t,logger:n,execAdapter:r=Oi()}=e,i=L.join(t,`.git`),a=L.join(i,`opencode`);try{let e=(await I.readFile(a,`utf8`)).trim();if(e.length>0){if(Di.test(e))return n.debug(`Project ID loaded from cache`,{projectId:e}),{projectId:e,source:`cached`};n.warning(`Invalid cached project ID format, regenerating`,{cachedId:e})}}catch(e){n.debug(`No cached project ID found`,{error:d(e)})}try{let e=await I.readFile(i,`utf8`),n=/^gitdir: (.+)$/m.exec(e);if(n==null)return{projectId:null,source:`error`,error:`Invalid .git file format`};i=L.resolve(t,n[1]),a=L.join(i,`opencode`)}catch(e){if((typeof e==`object`?e.code:void 0)!==`EISDIR`)return{projectId:null,source:`error`,error:`Not a git repository`}}try{let{stdout:e,exitCode:i}=await r.getExecOutput(`git`,[`rev-list`,`--max-parents=0`,`--all`],{cwd:t,silent:!0});if(i!==0||e.trim().length===0)return{projectId:null,source:`error`,error:`No commits found in repository`};let o=e.trim().split(` +`).map(e=>e.trim()).filter(e=>e.length>0).sort();if(o.length===0)return{projectId:null,source:`error`,error:`No root commits found`};let s=o[0];try{await I.writeFile(a,s,{encoding:`utf8`,flag:`wx`}),n.info(`Project ID generated and cached`,{projectId:s,source:`generated`})}catch(e){(typeof e==`object`?e.code:void 0)===`EEXIST`?n.debug(`Project ID file already written by concurrent process, skipping`,{projectId:s}):n.warning(`Failed to cache project ID (continuing)`,{error:d(e)})}return{projectId:s,source:`generated`}}catch(e){return{projectId:null,source:`error`,error:d(e)}}}async function Ai(e){let t=T(),n=j({phase:`cache`}),r=M(),i=L.join(r,`.git`,`opencode`),a=await le({components:t,logger:n,storagePath:ne(),authPath:ae(),projectIdPath:i,opencodeVersion:e.opencodeResult.version}),o=a.corrupted?`corrupted`:a.hit?`hit`:`miss`;e.logger.info(`Cache restore completed`,{cacheStatus:o,key:a.key});let s=await ki({workspacePath:r,logger:n});s.source===`error`?n.warning(`Failed to generate project ID (continuing)`,{error:s.error}):n.debug(`Project ID ready`,{projectId:s.projectId,source:s.source});let c=j({phase:`server-bootstrap`}),l=await hi(new AbortController().signal,c);if(!l.success)return b(`OpenCode server bootstrap failed: ${l.error.message}`),null;let u=l.data;return c.info(`SDK server bootstrapped successfully`),{cacheResult:a,cacheStatus:o,serverHandle:u}}const ji={markdownImage:/!\[([^\]]*)\]\((https:\/\/github\.com\/user-attachments\/assets\/[^)]+)\)/gi,markdownLink:/\[([^\]]+)\]\((https:\/\/github\.com\/user-attachments\/files\/[^)]+)\)/gi,htmlImage:/]*src=["'](https:\/\/github\.com\/user-attachments\/assets\/[^"']+)["'][^>]*>/gi};function Mi(e,t,n){e.lastIndex=0;let r=e.exec(t);for(;r!=null;)n(r),r=e.exec(t);e.lastIndex=0}function Ni(e){let t=[],n=new Set;return Mi(ji.markdownImage,e,e=>{let r=e[2],i=e[1],a=e[0];r!=null&&i!=null&&!n.has(r)&&Sn(r)&&(n.add(r),t.push({url:r,originalMarkdown:a,altText:i,type:`image`}))}),Mi(ji.markdownLink,e,e=>{let r=e[2],i=e[1],a=e[0];r!=null&&i!=null&&!n.has(r)&&Sn(r)&&(n.add(r),t.push({url:r,originalMarkdown:a,altText:i,type:`file`}))}),Mi(ji.htmlImage,e,e=>{let r=e[1],i=e[0];if(r!=null&&!n.has(r)&&Sn(r)){n.add(r);let e=/alt=["']([^"']*)["']/i.exec(i);t.push({url:r,originalMarkdown:i,altText:e?.[1]??``,type:`image`})}}),ji.htmlImage.lastIndex=0,t}function Pi(e,t,n){try{let r=new URL(e).pathname.split(`/`).at(-1);if(r!=null&&/\.[a-z0-9]+$/i.test(r))return r;if(t.trim().length>0){let e=t.replaceAll(/[^\w.-]/g,`_`).slice(0,50);return e.trim().length>0?e:`attachment_${n+1}`}return`attachment_${n+1}`}catch{return`attachment_${n+1}`}}const Fi={maxFiles:5,maxFileSizeBytes:5*1024*1024,maxTotalSizeBytes:15*1024*1024,allowedMimeTypes:[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`,`text/plain`,`text/markdown`,`text/csv`,`application/json`,`application/pdf`]},Ii=[`github.com`,`githubusercontent.com`];async function Li(e,t,n,r,i){i.debug(`Downloading attachment`,{url:e.url});try{let a=await fetch(e.url,{headers:{Authorization:`Bearer ${n}`,Accept:`*/*`,"User-Agent":`fro-bot-agent`},redirect:`manual`}),o=a;if(a.status>=300&&a.status<400){let t=a.headers.get(`location`);if(t==null)return i.warning(`Redirect without location`,{url:e.url}),null;let n=new URL(t);if(!Ii.some(e=>n.hostname===e||n.hostname.endsWith(`.${e}`)))return i.warning(`Redirect to non-GitHub host blocked`,{url:e.url,redirectTo:n.hostname}),null;o=await fetch(t,{headers:{Accept:`*/*`,"User-Agent":`fro-bot-agent`},redirect:`follow`})}if(!o.ok)return i.warning(`Attachment download failed`,{url:e.url,status:o.status}),null;let s=o.headers.get(`content-length`);if(s!=null){let t=Number.parseInt(s,10);if(t>r.maxFileSizeBytes)return i.warning(`Attachment exceeds size limit (Content-Length)`,{url:e.url,size:t,limit:r.maxFileSizeBytes}),null}let c=Se.from(await o.arrayBuffer());if(c.length>r.maxFileSizeBytes)return i.warning(`Attachment exceeds size limit`,{url:e.url,size:c.length,limit:r.maxFileSizeBytes}),null;let l=o.headers.get(`content-type`)??`application/octet-stream`,u=Pi(e.url,e.altText,t),d=l.split(`;`)[0],f=d==null?`application/octet-stream`:d.trim(),p=await I.mkdtemp(L.join(Oe.tmpdir(),`fro-bot-attachments-`)),m=u.trim().length>0?u:`attachment_${t+1}`,h=L.join(p,m);return await I.writeFile(h,c),i.debug(`Attachment downloaded`,{filename:u,mime:f,sizeBytes:c.length,tempPath:h}),{url:e.url,filename:u,mime:f,sizeBytes:c.length,tempPath:h}}catch(t){return i.warning(`Attachment download error`,{url:e.url,error:d(t)}),null}}async function Ri(e,t,n=Fi,r){return Promise.all(e.map(async(e,i)=>Li(e,i,t,n,r)))}async function zi(e,t){for(let n of e)try{await I.unlink(n);let e=L.dirname(n);await I.rmdir(e).catch(()=>{})}catch(e){t.debug(`Failed to cleanup temp file`,{path:n,error:d(e)})}}function Bi(e){return e.map(e=>({type:`file`,mime:e.mime,url:Te(e.tempPath).toString(),filename:e.filename}))}function Vi(e,t,n){let r=e,i=new Set(n.map(e=>e.filename));for(let e of t){let t=n.find(e=>i.has(e.filename));t!=null&&(r=r.replace(e.originalMarkdown,`@${t.filename}`))}return r}function Hi(e,t,n,r){return{processed:n,skipped:r,modifiedBody:Vi(e,t,n),fileParts:Bi(n),tempFiles:n.map(e=>e.tempPath)}}function Ui(e){if(e<0||!Number.isFinite(e))throw Error(`Invalid bytes value: ${e}`);return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Wi(e,t=Fi,n){let r=[],i=[],a=0;for(let o of e)if(o!=null){if(r.length>=t.maxFiles){i.push({url:o.url,reason:`Exceeds max file count (${t.maxFiles})`}),n.debug(`Attachment skipped: max count`,{url:o.url});continue}if(o.sizeBytes>t.maxFileSizeBytes){i.push({url:o.url,reason:`File too large (${Ui(o.sizeBytes)} > ${Ui(t.maxFileSizeBytes)})`}),n.debug(`Attachment skipped: too large`,{url:o.url,size:o.sizeBytes});continue}if(a+o.sizeBytes>t.maxTotalSizeBytes){i.push({url:o.url,reason:`Would exceed total size limit (${Ui(t.maxTotalSizeBytes)})`}),n.debug(`Attachment skipped: total size exceeded`,{url:o.url});continue}if(!Gi(o.mime,t.allowedMimeTypes)){i.push({url:o.url,reason:`MIME type not allowed: ${o.mime}`}),n.debug(`Attachment skipped: MIME type`,{url:o.url,mime:o.mime});continue}a+=o.sizeBytes,r.push({filename:o.filename,mime:o.mime,sizeBytes:o.sizeBytes,tempPath:o.tempPath}),n.info(`Attachment validated`,{filename:o.filename,mime:o.mime,sizeBytes:o.sizeBytes})}return{validated:r,skipped:i}}function Gi(e,t){let[n]=e.split(`/`);for(let r of t)if(r===e||r.endsWith(`/*`)&&n!=null&&n===r.slice(0,-2))return!0;return!1}function J(e){let t=L.resolve(e);return t.endsWith(L.sep)&&t.length>1?t.slice(0,-1):t}const Ki=e=>typeof e==`object`&&!!e,Y=e=>typeof e==`string`?e:null,qi=e=>typeof e==`number`?e:null;function Ji(e){if(Array.isArray(e))return e.filter(Ki).map(e=>({file:Y(e.file)??``,additions:qi(e.additions)??0,deletions:qi(e.deletions)??0}))}function Yi(e){return{id:e.id,version:e.version,projectID:e.projectID,directory:e.directory,parentID:e.parentID,title:e.title,time:{created:e.time.created,updated:e.time.updated,compacting:e.time.compacting,archived:e.time.archived},summary:e.summary==null?void 0:{additions:e.summary.additions,deletions:e.summary.deletions,files:e.summary.files,diffs:Ji(e.summary.diffs)},share:e.share?.url==null?void 0:{url:e.share.url},permission:e.permission==null?void 0:{rules:e.permission.rules},revert:e.revert==null?void 0:{messageID:e.revert.messageID,partID:e.revert.partID,snapshot:e.revert.snapshot,diff:e.revert.diff}}}async function Xi(e,t){let n=await e.project.list();if(n.error!=null||n.data==null)return t.warning(`SDK project list failed`,{error:String(n.error)}),[];if(!Array.isArray(n.data))return[];let r=[];for(let e of n.data){if(!Ki(e))continue;let t=Y(e.id),n=Y(e.worktree),i=Y(e.path);t==null||n==null||i==null||r.push({id:t,worktree:n,path:i,vcs:`git`,time:{created:0,updated:0}})}return r}async function Zi(e,t,n){let r=J(t),i=await Xi(e,n);for(let e of i){if(J(e.worktree)===r)return e;let t=Y(e.path);if(t!=null&&J(t)===r)return e}return null}function Qi(e){return e.status===`running`?{status:`running`,input:e.input,time:{start:e.time.start}}:e.status===`error`?{status:`error`,input:e.input,error:e.error,time:{start:e.time.start,end:e.time.end}}:e.status===`pending`?{status:`pending`}:{status:`completed`,input:e.input,output:e.output,title:e.title,metadata:e.metadata,time:{start:e.time.start,end:e.time.end,compacted:e.time.compacted},attachments:void 0}}function $i(e){let t={id:e.id,sessionID:e.sessionID,messageID:e.messageID};if(e.type===`text`)return{...t,type:`text`,text:e.text,synthetic:e.synthetic,ignored:e.ignored,time:e.time,metadata:e.metadata};if(e.type===`reasoning`)return{...t,type:`reasoning`,reasoning:e.reasoning??e.text,time:e.time};if(e.type===`tool`)return{...t,type:`tool`,callID:e.callID,tool:e.tool,state:Qi(e.state),metadata:e.metadata};if(e.type!==`step-finish`)return{...t,type:`text`,text:`text`in e?e.text:``};let n=e;return{...t,type:`step-finish`,reason:n.reason,snapshot:n.snapshot,cost:n.cost,tokens:{input:n.tokens.input,output:n.tokens.output,reasoning:n.tokens.reasoning,cache:{read:n.tokens.cache.read,write:n.tokens.cache.write}}}}function ea(e){if(e.role===`user`){let t=e;return{id:t.id,sessionID:t.sessionID,role:`user`,time:{created:t.time.created},summary:t.summary==null?void 0:{title:t.summary.title,body:t.summary.body,diffs:Ji(t.summary.diffs)??[]},agent:t.agent,model:{providerID:t.model.providerID,modelID:t.model.modelID},system:t.system,tools:t.tools,variant:t.variant}}let t=e;return{id:t.id,sessionID:t.sessionID,role:`assistant`,time:{created:t.time.created,completed:t.time.completed},parentID:t.parentID,modelID:t.modelID,providerID:t.providerID,mode:t.mode,agent:t.agent??``,path:{cwd:t.path.cwd,root:t.path.root},summary:t.summary,cost:t.cost,tokens:{input:t.tokens.input,output:t.tokens.output,reasoning:t.tokens.reasoning,cache:{read:t.tokens.cache.read,write:t.tokens.cache.write}},finish:t.finish,error:t.error?{name:t.error.name,message:Y(t.error.data.message)??``}:void 0}}function ta(e){return[...e.map(e=>{let t=ea(`info`in e?e.info:e),n=`parts`in e?e.parts.map($i):void 0;return n==null||n.length===0?t:{...t,parts:n}})].sort((e,t)=>e.time.created-t.time.created)}async function na(e,t,n){let r=await e.session.list({query:{directory:t}});return r.error==null&&r.data!=null?Array.isArray(r.data)?r.data.map(Yi):[]:(n.warning(`SDK session list failed`,{error:String(r.error)}),[])}async function ra(e,t,n){let r=await e.session.messages({path:{id:t}});return r.error==null&&r.data!=null?ta(r.data):(n.warning(`SDK session messages failed`,{error:String(r.error)}),[])}async function ia(e,t,n,r){let i=await e.session.list({query:{directory:t,start:n,roots:!0,limit:10}});if(i.error!=null||i.data==null)return r.warning(`SDK session list failed`,{error:String(i.error)}),null;if(!Array.isArray(i.data)||i.data.length===0)return null;let a=i.data.map(Yi);if(a.length===0)return null;let o=a.reduce((e,t)=>t.time.created>e.time.created?t:e);return{projectID:o.projectID,session:o}}async function aa(e,t,n){let r=await e.session.delete({path:{id:t}});if(r.error!=null){n.warning(`SDK session delete failed`,{sessionID:t,error:String(r.error)});return}n.debug(`Deleted session via SDK`,{sessionID:t})}const oa={maxSessions:50,maxAgeDays:30};async function sa(e,t,n,r){let{maxSessions:i,maxAgeDays:a}=n;if(r.info(`Starting session pruning`,{workspacePath:t,maxSessions:i,maxAgeDays:a}),await Zi(e,t,r)==null)return r.debug(`No project found for pruning`,{workspacePath:t}),{prunedCount:0,prunedSessionIds:[],remainingCount:0,freedBytes:0};let o=await na(e,t,r),s=o.filter(e=>e.parentID==null);if(s.length===0)return{prunedCount:0,prunedSessionIds:[],remainingCount:0,freedBytes:0};let c=[...s].sort((e,t)=>t.time.updated-e.time.updated),l=new Date;l.setDate(l.getDate()-a);let u=l.getTime(),f=new Set;for(let e of c)e.time.updated>=u&&f.add(e.id);for(let e=0;e!f.has(e.id)),m=new Set;for(let e of p){m.add(e.id);for(let t of o)t.parentID===e.id&&m.add(t.id)}if(m.size===0)return r.info(`No sessions to prune`),{prunedCount:0,prunedSessionIds:[],remainingCount:s.length,freedBytes:0};let h=[];for(let t of m)try{await aa(e,t,r),h.push(t),r.debug(`Pruned session`,{sessionId:t})}catch(e){r.warning(`Failed to prune session`,{sessionId:t,error:d(e)})}let g=s.length-p.length;return r.info(`Session pruning complete`,{prunedCount:h.length,remainingCount:g}),{prunedCount:h.length,prunedSessionIds:h,remainingCount:g,freedBytes:0}}async function ca(e,t,n,r){let{limit:i,fromDate:a,toDate:o}=n;r.debug(`Listing sessions`,{directory:t,limit:i});let s=[...(await na(e,t,r)).filter(e=>!(e.parentID!=null||a!=null&&e.time.createdo.getTime()))].sort((e,t)=>t.time.updated-e.time.updated),c=[],l=i==null?s:s.slice(0,i);for(let t of l){let n=await ra(e,t.id,r),i=la(n);c.push({id:t.id,projectID:t.projectID,directory:t.directory,title:t.title,createdAt:t.time.created,updatedAt:t.time.updated,messageCount:n.length,agents:i,isChild:!1})}return r.info(`Listed sessions`,{count:c.length,directory:t}),c}function la(e){let t=new Set;for(let n of e)n.agent!=null&&t.add(n.agent);return[...t]}async function ua(e,t,n,r,i){let{limit:a=20,caseSensitive:o=!1,sessionId:s}=r;i.debug(`Searching sessions`,{query:e,directory:n,limit:a,caseSensitive:o});let c=o?e:e.toLowerCase(),l=[],u=0;if(s!=null){let e=await da(t,s,c,o,i);return e.length>0&&l.push({sessionId:s,matches:e.slice(0,a)}),l}let d=await ca(t,n,{},i);for(let e of d){if(u>=a)break;let n=await da(t,e.id,c,o,i);if(n.length>0){let t=a-u;l.push({sessionId:e.id,matches:n.slice(0,t)}),u+=Math.min(n.length,t)}}return i.info(`Session search complete`,{query:e,resultCount:l.length,totalMatches:u}),l}async function da(e,t,n,r,i){let a=await ra(e,t,i),o=[];for(let e of a){let t=e.parts??[];for(let i of t){let t=fa(i);if(t==null)continue;let a=r?t:t.toLowerCase();if(a.includes(n)){let r=a.indexOf(n),s=Math.max(0,r-50),c=Math.min(t.length,r+n.length+50),l=t.slice(s,c);o.push({messageId:e.id,partId:i.id,excerpt:`...${l}...`,role:e.role,agent:e.agent})}}}return o}function fa(e){switch(e.type){case`text`:return e.text;case`reasoning`:return e.reasoning;case`tool`:return e.state.status===`completed`?`${e.tool}: ${e.state.output}`:null;case`step-finish`:return null}}function pa(e){let t=[`--- Fro Bot Run Summary ---`,`Event: ${e.eventType}`,`Repo: ${e.repo}`,`Ref: ${e.ref}`,`Run ID: ${e.runId}`,`Cache: ${e.cacheStatus}`,`Duration: ${e.duration}s`];return e.sessionIds.length>0&&t.push(`Sessions used: ${e.sessionIds.join(`, `)}`),e.logicalKey!=null&&t.push(`Logical Thread: ${e.logicalKey}`),e.createdPRs.length>0&&t.push(`PRs created: ${e.createdPRs.join(`, `)}`),e.createdCommits.length>0&&t.push(`Commits: ${e.createdCommits.join(`, `)}`),e.tokenUsage!=null&&t.push(`Tokens: ${e.tokenUsage.input} in / ${e.tokenUsage.output} out`),t.join(` +`)}async function ma(e,t,n,r){let i=pa(t);try{let t=await n.session.prompt({path:{id:e},body:{noReply:!0,parts:[{type:`text`,text:i}]}});if(t.error!=null){r.warning(`SDK prompt writeback failed`,{sessionId:e,error:String(t.error)});return}r.info(`Session summary written via SDK`,{sessionId:e})}catch(t){r.warning(`SDK prompt writeback failed`,{sessionId:e,error:d(t)})}}async function ha(n){let{bootstrapLogger:r,reactionCtx:i,githubClient:a,agentSuccess:o,attachmentResult:s,serverHandle:c,detectedOpencodeVersion:l}=n;try{if(s!=null){let e=j({phase:`attachment-cleanup`});await zi(s.tempFiles,e)}i!=null&&a!=null&&await or(a,i,o,j({phase:`cleanup`}));let n=j({phase:`prune`}),r=M();if(c!=null){let e=J(r),t=await sa(c.client,e,oa,n);t.prunedCount>0&&n.info(`Pruned old sessions`,{pruned:t.prunedCount,remaining:t.remainingCount})}let u=T(),d=j({phase:`cache-save`}),f=L.join(r,`.git`,`opencode`);if(await oe({components:u,runId:O(),logger:d,storagePath:ne(),authPath:ae(),projectIdPath:f,opencodeVersion:l})&&t(e.CACHE_SAVED,`true`),ge()){let n=j({phase:`artifact-upload`});await de({logPath:k(),runId:O(),runAttempt:te(),logger:n})&&t(e.ARTIFACT_UPLOADED,`true`)}}catch(e){r.warning(`Cleanup failed (non-fatal)`,{error:e instanceof Error?e.message:String(e)})}finally{if(c!=null)try{c.shutdown()}catch(e){r.warning(`Server shutdown failed (non-fatal)`,{error:e instanceof Error?e.message:String(e)})}}}const ga=L.join(ke.homedir(),`.cache`,`fro-bot-dedup`);function _a(e){return e.replaceAll(`/`,`-`)}function va(e,t){let n=_a(e);return L.join(ga,`${n}-${t.entityType}-${t.entityNumber}`)}function ya(e,t){return`${E}-${_a(e)}-${t.entityType}-${t.entityNumber}-`}function ba(e,t,n){return`${ya(e,t)}${n}`}async function xa(e,t,n,r=A){let i=va(e,t),a=L.join(i,`sentinel.json`),o=ya(e,t);try{if(await I.rm(i,{recursive:!0,force:!0}),await I.mkdir(i,{recursive:!0}),await r.restoreCache([i],o,[])==null)return null;let e=await I.readFile(a,`utf8`);return JSON.parse(e)}catch(e){return n.debug(`Dedup marker restore failed; proceeding without marker`,{error:d(e),entityType:t.entityType,entityNumber:t.entityNumber}),null}}async function Sa(e,t,n,r,i=A){let a=va(e,t),o=L.join(a,`sentinel.json`),s=ba(e,t,n.runId);try{return await I.mkdir(a,{recursive:!0}),await I.writeFile(o,JSON.stringify(n),`utf8`),await i.saveCache([a],s),!0}catch(e){return d(e).toLowerCase().includes(`already exists`)?!0:(r.debug(`Dedup marker save failed`,{error:d(e),entityType:t.entityType,entityNumber:t.entityNumber,saveKey:s}),!1)}}const Ca=new Set([`pull_request`,`issues`]),wa=new Set([`synchronize`,`reopened`]);function Ta(e){return e.target==null||!Ca.has(e.eventType)?null:e.eventType===`pull_request`&&e.target.kind===`pr`?{entityType:`pr`,entityNumber:e.target.number}:e.eventType===`issues`&&e.target.kind===`issue`?{entityType:`issue`,entityNumber:e.target.number}:null}async function Ea(e,t,n,r,i=j({phase:`dedup`}),a){let o=Ta(t);if(e===0)return{shouldProceed:!0,entity:o};if(o==null)return{shouldProceed:!0,entity:null};if(t.action!=null&&wa.has(t.action))return i.debug(`Dedup bypassed for action`,{action:t.action}),{shouldProceed:!0,entity:o};let s=await xa(n,o,i,a);if(s==null||s.runId===t.runId)return{shouldProceed:!0,entity:o};let c=new Date(s.timestamp).getTime();if(Number.isNaN(c))return i.warning(`Dedup marker timestamp is invalid; proceeding without dedup`,{markerTimestamp:s.timestamp}),{shouldProceed:!0,entity:o};let l=Date.now()-c;if(l<-6e4)return i.warning(`Dedup marker timestamp is too far in the future; proceeding without dedup`,{markerTimestamp:s.timestamp,markerAge:l}),{shouldProceed:!0,entity:o};let u=Math.max(0,l);return u>e?{shouldProceed:!0,entity:o}:(i.info(`Skipping duplicate trigger within dedup window`,{eventType:t.eventType,action:t.action,runId:t.runId,markerRunId:s.runId,markerTimestamp:s.timestamp,dedupWindow:e,entityType:o.entityType,entityNumber:o.entityNumber}),B({sessionId:null,cacheStatus:`miss`,duration:Date.now()-r}),await Oa(t,o,s,u,e,i),{shouldProceed:!1,entity:o})}async function Da(e,t,n,r=j({phase:`dedup`}),i){await Sa(n,t,{timestamp:new Date().toISOString(),runId:e.runId,action:e.action??`unknown`,eventType:e.eventType,entityType:t.entityType,entityNumber:t.entityNumber},r,i)}async function Oa(e,t,n,r,i,a){try{let a=Math.round(r/1e3),o=Math.round(i/1e3),s=`${t.entityType} #${t.entityNumber}`,c=`https://github.com/${e.repo.owner}/${e.repo.repo}/actions/runs/${n.runId}`;S.addHeading(`Fro Bot Agent Run — Skipped (Dedup)`,2).addRaw(`Execution skipped because the agent already ran for **${s}** recently.\n\n`).addTable([[{data:`Detail`,header:!0},{data:`Value`,header:!0}],[`Current action`,`\`${e.eventType}.${e.action??`unknown`}\``],[`Prior run`,`[${n.runId}](${c})`],[`Prior action`,`\`${n.eventType}.${n.action}\``],[`Time since prior run`,`${a}s`],[`Dedup window`,`${o}s`]]).addRaw(` > Dedup is best-effort suppression. Use workflow concurrency groups to prevent overlapping runs. -`),await S.write()}catch(e){a.warning(`Failed to write dedup skip summary`,{error:d(e)})}}async function Ea(n,r,i,a,o,s){let c={context:r.agentContext,customPrompt:n.inputs.prompt,cacheStatus:i.cacheStatus,sessionContext:{recentSessions:a.recentSessions,priorWorkContext:a.priorWorkContext},logicalKey:a.logicalKey??null,isContinuation:a.isContinuation,currentThreadSessionId:a.continueSessionId??null,triggerContext:r.triggerResult.context,fileParts:a.attachmentResult?.fileParts},l=L.env.SKIP_AGENT_EXECUTION===`true`,u=Date.now(),d;if(l)n.logger.info(`Skipping agent execution (SKIP_AGENT_EXECUTION=true)`),d={success:!0,exitCode:0,sessionId:null,error:null,tokenUsage:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null};else{let e=P({phase:`execution`});e.info(`Starting OpenCode execution`,{logicalKey:a.logicalKey?.key??null,continueSessionId:a.continueSessionId});let t=await Zn(c,e,{agent:n.inputs.agent,model:n.inputs.model,timeoutMs:n.inputs.timeoutMs,omoProviders:n.inputs.omoProviders,continueSessionId:a.continueSessionId??void 0,sessionTitle:a.sessionTitle??void 0},i.serverHandle),r=t.sessionId;if(r==null){let e=P({phase:`session`}),t=await ta(i.serverHandle.client,a.normalizedWorkspace,u,e);t!=null&&(r=t.session.id,e.debug(`Identified session from execution`,{sessionId:r}))}d={...t,sessionId:r},e.info(`Completed OpenCode execution`,{success:d.success,sessionId:d.sessionId,logicalKey:a.logicalKey?.key??null})}d.sessionId!=null&&(t(e.SESSION_ID,d.sessionId),o.addSessionCreated(d.sessionId)),d.tokenUsage!=null&&o.setTokenUsage(d.tokenUsage,d.model,d.cost);for(let e of d.prsCreated)o.addPRCreated(e);for(let e of d.commitsCreated)o.addCommitCreated(e);for(let e=0;e`)}async function ka(e,t,n){try{if(t.type===`pr`){let{data:n}=await e.rest.pulls.get({owner:t.owner,repo:t.repo,pull_number:t.number});return{title:n.title,body:n.body??``,author:n.user?.login??`unknown`}}let{data:n}=await e.rest.issues.get({owner:t.owner,repo:t.repo,issue_number:t.number});return{title:n.title,body:n.body??``,author:n.user?.login??`unknown`}}catch(e){return n.warning(`Failed to fetch issue/PR`,{target:t,error:d(e)}),null}}async function Aa(e,t,n,r){let i=[],a=1;for(;a<=50;)try{let{data:r}=await e.rest.issues.listComments({owner:t.owner,repo:t.repo,issue_number:t.number,per_page:100,page:a});if(r.length===0)break;for(let e of r){let t=e.user?.login??`unknown`;i.push({id:e.id,body:e.body??``,author:t,authorAssociation:e.author_association??`NONE`,createdAt:e.created_at,updatedAt:e.updated_at,isBot:Oa(t,e.body??``,n)})}if(r.length<100)break;a++}catch(e){r.warning(`Failed to fetch comments page`,{target:t,page:a,error:d(e)});break}return i}async function ja(e,t,n,r){try{let i=[],a=null,o=null,s=``,c=``,l=`unknown`,u=0;for(;u<50;){let d=(await e.graphql(` +`),await S.write()}catch(e){a.warning(`Failed to write dedup skip summary`,{error:d(e)})}}async function ka(n,r,i,a,o,s){let c={context:r.agentContext,customPrompt:n.inputs.prompt,cacheStatus:i.cacheStatus,sessionContext:{recentSessions:a.recentSessions,priorWorkContext:a.priorWorkContext},logicalKey:a.logicalKey??null,isContinuation:a.isContinuation,currentThreadSessionId:a.continueSessionId??null,triggerContext:r.triggerResult.context,fileParts:a.attachmentResult?.fileParts},l=N.env.SKIP_AGENT_EXECUTION===`true`,u=Date.now(),d;if(l)n.logger.info(`Skipping agent execution (SKIP_AGENT_EXECUTION=true)`),d={success:!0,exitCode:0,sessionId:null,error:null,tokenUsage:null,model:null,cost:null,prsCreated:[],commitsCreated:[],commentsPosted:0,llmError:null};else{let e=j({phase:`execution`});e.info(`Starting OpenCode execution`,{logicalKey:a.logicalKey?.key??null,continueSessionId:a.continueSessionId});let t=await Zn(c,e,{agent:n.inputs.agent,model:n.inputs.model,timeoutMs:n.inputs.timeoutMs,omoProviders:n.inputs.omoProviders,continueSessionId:a.continueSessionId??void 0,sessionTitle:a.sessionTitle??void 0},i.serverHandle),r=t.sessionId;if(r==null){let e=j({phase:`session`}),t=await ia(i.serverHandle.client,a.normalizedWorkspace,u,e);t!=null&&(r=t.session.id,e.debug(`Identified session from execution`,{sessionId:r}))}d={...t,sessionId:r},e.info(`Completed OpenCode execution`,{success:d.success,sessionId:d.sessionId,logicalKey:a.logicalKey?.key??null})}d.sessionId!=null&&(t(e.SESSION_ID,d.sessionId),o.addSessionCreated(d.sessionId)),d.tokenUsage!=null&&o.setTokenUsage(d.tokenUsage,d.model,d.cost);for(let e of d.prsCreated)o.addPRCreated(e);for(let e of d.commitsCreated)o.addCommitCreated(e);for(let e=0;e`)}async function Ma(e,t,n){try{if(t.type===`pr`){let{data:n}=await e.rest.pulls.get({owner:t.owner,repo:t.repo,pull_number:t.number});return{title:n.title,body:n.body??``,author:n.user?.login??`unknown`}}let{data:n}=await e.rest.issues.get({owner:t.owner,repo:t.repo,issue_number:t.number});return{title:n.title,body:n.body??``,author:n.user?.login??`unknown`}}catch(e){return n.warning(`Failed to fetch issue/PR`,{target:t,error:d(e)}),null}}async function Na(e,t,n,r){let i=[],a=1;for(;a<=50;)try{let{data:r}=await e.rest.issues.listComments({owner:t.owner,repo:t.repo,issue_number:t.number,per_page:100,page:a});if(r.length===0)break;for(let e of r){let t=e.user?.login??`unknown`;i.push({id:e.id,body:e.body??``,author:t,authorAssociation:e.author_association??`NONE`,createdAt:e.created_at,updatedAt:e.updated_at,isBot:ja(t,e.body??``,n)})}if(r.length<100)break;a++}catch(e){r.warning(`Failed to fetch comments page`,{target:t,page:a,error:d(e)});break}return i}async function Pa(e,t,n,r){try{let i=[],a=null,o=null,s=``,c=``,l=`unknown`,u=0;for(;u<50;){let d=(await e.graphql(` query GetDiscussion($owner: String!, $repo: String!, $number: Int!, $after: String) { repository(owner: $owner, name: $repo) { discussion(number: $number) { @@ -287,7 +287,7 @@ If you had completed the task, confirm the completion.`,u=r===1?e.fileParts:void } } } -`,{owner:t.owner,repo:t.repo,number:t.number,after:a})).repository.discussion;if(d==null)return r.debug(`Discussion not found`,{target:t}),null;u===0&&(o=d.id,s=d.title,c=d.body,l=d.author?.login??`unknown`);for(let e of d.comments.nodes){let t=e.author?.login??`unknown`;i.push({id:e.id,body:e.body,author:t,authorAssociation:`NONE`,createdAt:e.createdAt,updatedAt:e.updatedAt,isBot:Oa(t,e.body,n)})}if(!d.comments.pageInfo.hasNextPage)break;a=d.comments.pageInfo.endCursor,u++}return{type:`discussion`,number:t.number,title:s,body:c,author:l,comments:i,discussionId:o??void 0}}catch(e){return r.warning(`Failed to fetch discussion`,{target:t,error:d(e)}),null}}async function Ma(e,t,n,r){if(t.type===`discussion`)return ja(e,t,n,r);let i=await ka(e,t,r);if(i==null)return null;let a=await Aa(e,t,n,r);return{type:t.type,number:t.number,title:i.title,body:i.body,author:i.author,comments:a}}function Na(e,t){let n=e.comments.filter(e=>Da(e.author,t)&&e.body.includes(``));return n.length===0?null:n.at(-1)??null}async function Pa(e,t,n,r){try{let{data:i}=await e.rest.issues.createComment({owner:t.owner,repo:t.repo,issue_number:t.number,body:n});return r.debug(`Created issue comment`,{commentId:i.id,target:t}),{commentId:i.id,created:!0,updated:!1,url:i.html_url}}catch(e){return r.warning(`Failed to create issue comment`,{target:t,error:d(e)}),null}}async function Fa(e,t,n,r,i){try{let{data:a}=await e.rest.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:r});return i.debug(`Updated issue comment`,{commentId:a.id,target:t}),{commentId:a.id,created:!1,updated:!0,url:a.html_url}}catch(e){return i.warning(`Failed to update issue comment`,{target:t,commentId:n,error:d(e)}),null}}async function Ia(e,t,n,r){try{let i=(await e.graphql(` +`,{owner:t.owner,repo:t.repo,number:t.number,after:a})).repository.discussion;if(d==null)return r.debug(`Discussion not found`,{target:t}),null;u===0&&(o=d.id,s=d.title,c=d.body,l=d.author?.login??`unknown`);for(let e of d.comments.nodes){let t=e.author?.login??`unknown`;i.push({id:e.id,body:e.body,author:t,authorAssociation:`NONE`,createdAt:e.createdAt,updatedAt:e.updatedAt,isBot:ja(t,e.body,n)})}if(!d.comments.pageInfo.hasNextPage)break;a=d.comments.pageInfo.endCursor,u++}return{type:`discussion`,number:t.number,title:s,body:c,author:l,comments:i,discussionId:o??void 0}}catch(e){return r.warning(`Failed to fetch discussion`,{target:t,error:d(e)}),null}}async function Fa(e,t,n,r){if(t.type===`discussion`)return Pa(e,t,n,r);let i=await Ma(e,t,r);if(i==null)return null;let a=await Na(e,t,n,r);return{type:t.type,number:t.number,title:i.title,body:i.body,author:i.author,comments:a}}function Ia(e,t){let n=e.comments.filter(e=>Aa(e.author,t)&&e.body.includes(``));return n.length===0?null:n.at(-1)??null}async function La(e,t,n,r){try{let{data:i}=await e.rest.issues.createComment({owner:t.owner,repo:t.repo,issue_number:t.number,body:n});return r.debug(`Created issue comment`,{commentId:i.id,target:t}),{commentId:i.id,created:!0,updated:!1,url:i.html_url}}catch(e){return r.warning(`Failed to create issue comment`,{target:t,error:d(e)}),null}}async function Ra(e,t,n,r,i){try{let{data:a}=await e.rest.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:r});return i.debug(`Updated issue comment`,{commentId:a.id,target:t}),{commentId:a.id,created:!1,updated:!0,url:a.html_url}}catch(e){return i.warning(`Failed to update issue comment`,{target:t,commentId:n,error:d(e)}),null}}async function za(e,t,n,r){try{let i=(await e.graphql(` query GetDiscussionId($owner: String!, $repo: String!, $number: Int!) { repository(owner: $owner, name: $repo) { discussion(number: $number) { @@ -308,7 +308,7 @@ If you had completed the task, confirm the completion.`,u=r===1?e.fileParts:void } } } -`,{owner:t.owner,repo:t.repo,number:t.number})).repository.discussion;if(i==null)return r.warning(`Discussion not found`,{target:t}),null;if(n.updateExisting===!0&&n.botLogin!=null){let i=await Ma(e,t,n.botLogin,r);if(i!=null){let t=Na(i,n.botLogin);if(t!=null&&typeof t.id==`string`){let i=await e.graphql(` +`,{owner:t.owner,repo:t.repo,number:t.number})).repository.discussion;if(i==null)return r.warning(`Discussion not found`,{target:t}),null;if(n.updateExisting===!0&&n.botLogin!=null){let i=await Fa(e,t,n.botLogin,r);if(i!=null){let t=Ia(i,n.botLogin);if(t!=null&&typeof t.id==`string`){let i=await e.graphql(` mutation UpdateDiscussionComment($commentId: ID!, $body: String!) { updateDiscussionComment(input: {commentId: $commentId, body: $body}) { comment { id url } @@ -320,4 +320,4 @@ If you had completed the task, confirm the completion.`,u=r===1?e.fileParts:void comment { id url } } } -`,{discussionId:i.id,body:n.body});return r.debug(`Created discussion comment`,{discussionId:i.id}),{commentId:a.addDiscussionComment.comment.id,created:!0,updated:!1,url:a.addDiscussionComment.comment.url}}catch(e){return r.warning(`Failed to post discussion comment`,{target:t,error:d(e)}),null}}async function La(e,t,n,r){if(t.type===`discussion`)return Ia(e,t,n,r);if(n.updateExisting===!0&&n.botLogin!=null){let i=await Ma(e,t,n.botLogin,r);if(i!=null){let a=Na(i,n.botLogin);if(a!=null&&typeof a.id==`number`)return Fa(e,t,a.id,n.body,r)}}return Pa(e,t,n.body,r)}async function Ra(e,t,n,r,i,a,o){let s=Date.now()-a;if(Ne({sessionId:r.sessionId,cacheStatus:n.cacheStatus,duration:s}),await je({eventType:t.agentContext.eventName,repo:t.agentContext.repo,ref:t.agentContext.ref,runId:Number(t.agentContext.runId),runUrl:`https://github.com/${t.agentContext.repo}/actions/runs/${t.agentContext.runId}`,metrics:i.getMetrics(),agent:e.inputs.agent},o),r.success)return o.info(`Agent run completed successfully`,{durationMs:s}),0;if(r.llmError==null)return b(`Agent execution failed with exit code ${r.exitCode}`),r.exitCode;o.info(`Agent failed with recoverable LLM error`,{error:r.llmError.message,type:r.llmError.type,durationMs:s});let[c,l]=t.agentContext.repo.split(`/`),u={type:t.triggerResult.context.eventType===`discussion_comment`?`discussion`:t.agentContext.issueType===`pr`?`pr`:`issue`,number:t.agentContext.issueNumber??0,owner:c??``,repo:l??``};if(u.number>0&&u.owner.length>0&&u.repo.length>0){let e=pn(r.llmError),n=P({phase:`error-comment`}),a=await La(t.githubClient,u,{body:e},n);a==null?n.warning(`Failed to post LLM error comment`):(n.info(`Posted LLM error comment`,{commentUrl:a.url}),i.incrementComments())}else o.warning(`Cannot post error comment: missing target context`);return 0}function za(e){switch(e){case`issue_comment`:return`issue_comment`;case`discussion`:case`discussion_comment`:return`discussion_comment`;case`workflow_dispatch`:return`workflow_dispatch`;case`issues`:return`issues`;case`pull_request`:return`pull_request`;case`pull_request_review_comment`:return`pull_request_review_comment`;case`schedule`:return`schedule`;default:return`unsupported`}}function Ba(e,t){switch(e){case`issue_comment`:{let e=t;return{type:`issue_comment`,action:e.action,issue:{number:e.issue.number,title:e.issue.title,body:e.issue.body??null,locked:e.issue.locked??!1,isPullRequest:e.issue.pull_request!=null},comment:{id:e.comment.id,body:e.comment.body,author:e.comment.user.login,authorAssociation:e.comment.author_association??`NONE`}}}case`discussion_comment`:{let e=t;return{type:`discussion_comment`,action:e.action,discussion:{number:e.discussion.number,title:e.discussion.title,body:e.discussion.body??null,locked:e.discussion.locked??!1},comment:{id:e.comment.id,body:e.comment.body??null,author:e.comment.user.login,authorAssociation:e.comment.author_association??`NONE`}}}case`issues`:{let e=t;return{type:`issues`,action:e.action,issue:{number:e.issue.number,title:e.issue.title,body:e.issue.body??null,locked:e.issue.locked??!1,authorAssociation:e.issue.author_association??`NONE`},sender:{login:e.sender.login}}}case`pull_request`:{let e=t,n=e.pull_request.requested_reviewers??[],r=`requested_reviewer`in e&&e.requested_reviewer!=null?{login:e.requested_reviewer.login,type:e.requested_reviewer.type}:null,i=`requested_team`in e&&e.requested_team!=null?{name:e.requested_team.name,slug:e.requested_team.slug}:null,a=n.flatMap(e=>`login`in e&&`type`in e?[{login:e.login,type:e.type}]:[]);return{type:`pull_request`,action:e.action,requestedReviewer:r,requestedTeam:i,pullRequest:{number:e.pull_request.number,title:e.pull_request.title,body:e.pull_request.body??null,locked:e.pull_request.locked??!1,draft:e.pull_request.draft??!1,authorAssociation:e.pull_request.author_association??`NONE`,requestedReviewers:a},sender:{login:e.sender.login}}}case`pull_request_review_comment`:{let e=t;return{type:`pull_request_review_comment`,action:e.action,pullRequest:{number:e.pull_request.number,title:e.pull_request.title,locked:e.pull_request.locked??!1},comment:{id:e.comment.id,body:e.comment.body,author:e.comment.user.login,authorAssociation:e.comment.author_association,path:e.comment.path,line:e.comment.line??null,diffHunk:e.comment.diff_hunk,commitId:e.comment.commit_id}}}case`workflow_dispatch`:return{type:`workflow_dispatch`,inputs:{prompt:t.inputs?.prompt??void 0}};case`schedule`:return{type:`schedule`,schedule:t.schedule??void 0};case`unsupported`:return{type:`unsupported`}}}function Va(e){let t=ee,n=za(t.eventName),r=Ba(n,t.payload);return e.debug(`Parsed GitHub context`,{eventName:t.eventName,eventType:n,repo:`${t.repo.owner}/${t.repo.repo}`}),{eventName:t.eventName,eventType:n,repo:t.repo,ref:t.ref,sha:t.sha,runId:t.runId,actor:t.actor,payload:t.payload,event:r}}function Ha(e,t){return t.includes(e)}function X(e){return e.endsWith(`[bot]`)}function Ua(e,t){if(t.length===0)return!1;let n=t.replace(/\[bot\]$/i,``);return n.length===0?!1:new RegExp(String.raw`@${Wa(n)}(?:\[bot\])?(?:$|[^\w])`,`i`).test(e)}function Wa(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function Ga(e,t){if(t.length===0)return null;let n=t.replace(/\[bot\]$/i,``);if(n.length===0)return null;let r=new RegExp(String.raw`@${Wa(n)}(?:\[bot\])?\s*(.*)`,`is`).exec(e)?.[1];if(r==null)return null;let i=r.trim();if(i.length===0)return{raw:``,action:null,args:``};let a=i.split(/\s+/),o=a[0]??``;return{raw:i,action:o===``?null:o,args:a.slice(1).join(` `)}}function Z(e,t){if(t==null||t===``||e==null)return{hasMention:!1,command:null};let n=Ua(e,t);return{hasMention:n,command:n?Ga(e,t):null}}function Ka(e,t){if(e.type!==`issue_comment`)throw Error(`Event type must be issue_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r={kind:e.issue.isPullRequest?`pr`:`issue`,number:e.issue.number,title:e.issue.title,body:e.comment.body??null,locked:e.issue.locked},{hasMention:i,command:a}=Z(e.comment.body,t);return{action:e.action,author:n,target:r,commentBody:e.comment.body,commentId:e.comment.id,hasMention:i,command:a,isBotReviewRequested:!1}}function qa(e,t){if(e.type!==`discussion_comment`)throw Error(`Event type must be discussion_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r=e.comment.body??null,i={kind:`discussion`,number:e.discussion.number,title:e.discussion.title,body:r??e.discussion.body??null,locked:e.discussion.locked},{hasMention:a,command:o}=Z(r,t);return{action:e.action,author:n,target:i,commentBody:r,commentId:e.comment.id,hasMention:a,command:o,isBotReviewRequested:!1}}function Ja(e,t){if(e.type!==`pull_request_review_comment`)throw Error(`Event type must be pull_request_review_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r={kind:`pr`,number:e.pullRequest.number,title:e.pullRequest.title,body:e.comment.body,locked:e.pullRequest.locked,path:e.comment.path,line:e.comment.line??void 0,diffHunk:e.comment.diffHunk,commitId:e.comment.commitId},{hasMention:i,command:a}=Z(e.comment.body,t);return{action:e.action,author:n,target:r,commentBody:e.comment.body,commentId:e.comment.id,hasMention:i,command:a,isBotReviewRequested:!1}}function Ya(e,t,n){if(e.type!==`workflow_dispatch`)throw Error(`Event type must be workflow_dispatch`);let r=(n??e.inputs?.prompt??``).trim();return{action:null,author:{login:t,association:`OWNER`,isBot:!1},target:{kind:`manual`,number:0,title:`Manual workflow dispatch`,body:r===``?null:r,locked:!1},commentBody:r===``?null:r,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}function Xa(e,t,n){let r=n?.trim()??``;return{action:null,author:{login:t,association:`OWNER`,isBot:!1},target:{kind:`manual`,number:0,title:`Scheduled workflow`,body:r===``?null:r,locked:!1},commentBody:r===``?null:r,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}function Za(e){return e.toLowerCase().replace(/\[bot\]$/i,``)}function Qa(e,t){if(e.type!==`pull_request`||t==null||t===``)return!1;let n=Za(t);if(n===``)return!1;if(e.action===`review_requested`){let t=e.requestedReviewer?.login;return t!=null&&Za(t)===n}return e.action===`ready_for_review`?e.pullRequest.requestedReviewers.some(e=>Za(e.login)===n):!1}function $a(e,t){if(e.type!==`issues`)throw Error(`Event type must be issues`);let n={login:e.sender.login,association:e.issue.authorAssociation,isBot:X(e.sender.login)},r={kind:`issue`,number:e.issue.number,title:e.issue.title,body:e.issue.body,locked:e.issue.locked},{hasMention:i,command:a}=Z(e.issue.body??``,t);return{action:e.action,author:n,target:r,commentBody:e.issue.body,commentId:null,hasMention:i,command:a,isBotReviewRequested:!1}}function eo(e,t){if(e.type!==`pull_request`)throw Error(`Event type must be pull_request`);let n={login:e.sender.login,association:e.pullRequest.authorAssociation,isBot:X(e.sender.login)},r={kind:`pr`,number:e.pullRequest.number,title:e.pullRequest.title,body:e.pullRequest.body,locked:e.pullRequest.locked,isDraft:e.pullRequest.draft,requestedReviewerLogin:e.requestedReviewer?.login,requestedTeamSlug:e.requestedTeam?.slug,requestedReviewerLogins:e.pullRequest.requestedReviewers.map(e=>e.login)},{hasMention:i,command:a}=Z(e.pullRequest.body??``,t);return{action:e.action,author:n,target:r,commentBody:e.pullRequest.body,commentId:null,hasMention:i,command:a,isBotReviewRequested:Qa(e,t)}}function Q(e,t){return{...e,action:t.action,author:t.author,target:t.target,commentBody:t.commentBody,commentId:t.commentId,hasMention:t.hasMention,command:t.command,isBotReviewRequested:t.isBotReviewRequested}}function to(e,t,n){let r={eventType:e.eventType,eventName:e.eventName,repo:e.repo,ref:e.ref,sha:e.sha,runId:e.runId,actor:e.actor,raw:e};switch(e.eventType){case`issue_comment`:return Q(r,Ka(e.event,t));case`discussion_comment`:return Q(r,qa(e.event,t));case`workflow_dispatch`:return Q(r,Ya(e.event,e.actor,n));case`issues`:return Q(r,$a(e.event,t));case`pull_request`:return Q(r,eo(e.event,t));case`pull_request_review_comment`:return Q(r,Ja(e.event,t));case`schedule`:return Q(r,Xa(e.event,e.actor,n));case`unsupported`:return{...r,action:null,author:null,target:null,commentBody:null,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}}function no(e,t,n){let{targetLabel:r,actionLabel:i}=n;return e.action===`created`?e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`${r} is locked`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Comments from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ha(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.requireMention&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Comment does not mention the bot`}:{shouldSkip:!1}:{shouldSkip:!0,reason:`action_not_created`,message:`${i} action is '${e.action}', not 'created'`}}function ro(e,t){return no(e,t,{targetLabel:`Issue or PR`,actionLabel:`Comment`})}function io(e,t){return no(e,t,{targetLabel:`Discussion`,actionLabel:`Discussion comment`})}const ao=[`opened`,`edited`];function oo(e){return ao.includes(e)}function so(e,t){let n=e.action;return n==null||!oo(n)?{shouldSkip:!0,reason:`action_not_supported`,message:`Issues action '${n}' is not supported (only 'opened' and 'edited')`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Issues from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ha(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:n===`edited`&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Issue edit does not mention the bot`}:e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Issue is locked`}:{shouldSkip:!1}}function co(e){return(e.promptInput?.trim()??``)===``?{shouldSkip:!0,reason:`prompt_required`,message:`Schedule trigger requires prompt input`}:{shouldSkip:!1}}function lo(e){return(e.commentBody?.trim()??``)===``?{shouldSkip:!0,reason:`prompt_required`,message:`Workflow dispatch requires prompt input`}:{shouldSkip:!1}}const uo=[`opened`,`synchronize`,`reopened`,`ready_for_review`,`review_requested`];function fo(e){return uo.includes(e)}function po(e,t){let n=e.action;return n==null||!fo(n)?{shouldSkip:!0,reason:`action_not_supported`,message:`Pull request action '${n}' is not supported`}:e.action!==`review_requested`&&e.action!==`ready_for_review`&&e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Pull requests from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ha(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.skipDraftPRs&&e.target?.isDraft===!0?{shouldSkip:!0,reason:`draft_pr`,message:`Pull request is a draft`}:e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Pull request is locked`}:t.botLogin!=null&&t.botLogin!==``&&(e.action===`ready_for_review`||e.action===`review_requested`)&&e.isBotReviewRequested!==!0?{shouldSkip:!0,reason:`bot_not_requested`,message:`Pull request action '${e.action}' did not request review from the bot`}:{shouldSkip:!1}}function mo(e,t){let n=e.action;return n===`created`?e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Pull request is locked`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Review comments from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ha(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.requireMention&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Review comment does not mention the bot`}:{shouldSkip:!1}:{shouldSkip:!0,reason:`action_not_created`,message:`Review comment action '${n}' is not supported (only 'created')`}}function ho(e){return{shouldSkip:!0,reason:`unsupported_event`,message:`Unsupported event type: ${e}`}}function go(e,t,n){if(e.eventType===`unsupported`)return n.debug(`Skipping unsupported event`,{eventName:e.eventName}),ho(e.eventName);switch(e.eventType){case`issue_comment`:return ro(e,t);case`discussion_comment`:return io(e,t);case`issues`:return so(e,t);case`pull_request`:return po(e,t);case`pull_request_review_comment`:return mo(e,t);case`schedule`:return co(t);case`workflow_dispatch`:return lo(e);default:return{shouldSkip:!1}}}const _o={botLogin:null,requireMention:!0,allowedAssociations:di,skipDraftPRs:!0,promptInput:null,senderAssociation:null};function vo(e,t,n={}){let r={..._o,...n},i=to(e,r.botLogin,r.promptInput);r.senderAssociation!=null&&(i.action===`review_requested`||i.action===`ready_for_review`)&&i.author!=null&&(i={...i,author:{...i.author,association:r.senderAssociation}}),t.debug(`Routing event`,{eventName:e.eventName,eventType:e.eventType,hasMention:i.hasMention});let a=go(i,r,t);return a.shouldSkip?{shouldProcess:!1,skipReason:a.reason,skipMessage:a.message,context:i}:{shouldProcess:!0,context:i}}async function yo(n,r){let i=P({phase:`context`}),a=Va(i),o=Lr({token:n.inputs.githubToken,logger:i}),s=await Rr(o,i),c=null;if(a.event.type===`pull_request`&&(a.event.action===`review_requested`||a.event.action===`ready_for_review`)){let{owner:e,repo:t}=a.repo;c=await He(o,e,t,a.event.sender.login,i)}let l=P({phase:`trigger`}),u=vo(a,l,{botLogin:s,requireMention:!0,promptInput:n.inputs.prompt,senderAssociation:c});return u.shouldProcess?(l.info(`Event routed for processing`,{eventType:u.context.eventType,hasMention:u.context.hasMention,command:u.context.command?.action??null}),t(e.SHOULD_SAVE_CACHE,`true`),{githubClient:o,triggerResult:u,agentContext:await ot({logger:i,octokit:o,triggerContext:u.context,botLogin:s}),botLogin:s}):(l.info(`Skipping event`,{reason:u.skipReason,message:u.skipMessage}),Ne({sessionId:null,cacheStatus:`miss`,duration:Date.now()-r}),null)}function $(e,t){return{key:`${e}-${t}`,entityType:e,entityId:t}}function bo(e){return be(`sha256`).update(e).digest(`hex`).slice(0,8)}function xo(e){if(e.eventType===`unsupported`)return null;if(e.eventType===`schedule`){let t=e.raw.event.type===`schedule`?e.raw.event.schedule:void 0;return $(`schedule`,bo((t!=null&&t.trim().length>0?t:e.action)??`default`))}return e.eventType===`workflow_dispatch`?$(`dispatch`,String(e.runId)):e.target==null?null:e.eventType===`issue_comment`?e.target.kind===`issue`?$(`issue`,String(e.target.number)):e.target.kind===`pr`?$(`pr`,String(e.target.number)):null:e.eventType===`discussion_comment`?e.target.kind===`discussion`?$(`discussion`,String(e.target.number)):null:e.eventType===`issues`?e.target.kind===`issue`?$(`issue`,String(e.target.number)):null:(e.eventType===`pull_request`||e.eventType===`pull_request_review_comment`)&&e.target.kind===`pr`?$(`pr`,String(e.target.number)):null}function So(e){return`fro-bot: ${e.key}`}function Co(e,t){let n=e.filter(e=>e.title===t);return n.length===0?null:n.reduce((e,t)=>t.time.updated>e.time.updated?t:e)}async function wo(e,t,n,r){try{let i=Co(await $i(e,t,r),So(n));return i==null||i.time.archived!=null||i.time.compacting!=null?{status:`not-found`}:{status:`found`,session:i}}catch(e){return{status:`error`,error:e instanceof Error?e.message:String(e)}}}async function To(e,t,n,r){let i=P({phase:`session`}),a=J(I()),o=await aa(n.serverHandle.client,a,{limit:10},i);i.debug(`Listed recent sessions`,{count:o.length});let s=xo(t.triggerResult.context),c=s==null?null:So(s),l=null,u=!1;if(s!=null){let e=await wo(n.serverHandle.client,a,s,i);e.status===`found`?(l=e.session.id,u=!0,i.info(`Session continuity: found existing session`,{logicalKey:s.key,sessionId:l})):e.status===`error`?i.warning(`Session continuity: lookup error, will create new`,{logicalKey:s.key,error:e.error}):i.info(`Session continuity: no existing session found`,{logicalKey:s.key})}let d=s?.key??t.agentContext.issueTitle??t.agentContext.repo,f=await sa(d,n.serverHandle.client,a,{limit:5},i);i.debug(`Searched prior sessions`,{query:d,resultCount:f.length});for(let e of f)r.addSessionUsed(e.sessionId);let p=P({phase:`attachments`}),m=t.agentContext.commentBody??``,h=Ai(m),g=null;if(h.length>0){p.info(`Processing attachments`,{count:h.length});let{validated:t,skipped:n}=Vi(await Fi(h,e.inputs.githubToken,void 0,p),void 0,p);(t.length>0||n.length>0)&&(g=zi(m,h,t,n),p.info(`Attachments processed`,{processed:t.length,skipped:n.length}))}return{recentSessions:o,priorWorkContext:f,attachmentResult:g,normalizedWorkspace:a,logicalKey:s,continueSessionId:l,isContinuation:u,sessionTitle:c}}async function Eo(){let n=Date.now(),r=P({phase:`bootstrap`}),i=Me();i.start();let a=null,o=!1,s=0,c=null,l=null,u=null,d=null;t(e.SHOULD_SAVE_CACHE,`false`),t(e.CACHE_SAVED,`false`);try{r.info(`Starting Fro Bot Agent`);let e=await Ci(r);if(e==null)return 1;u=e.opencodeResult.version;let t=await yo(e,n);if(t==null)return 0;c=t.githubClient;let f=`${t.triggerResult.context.repo.owner}/${t.triggerResult.context.repo.repo}`,p=await Ca(e.inputs.dedupWindow,t.triggerResult.context,f,n);if(!p.shouldProceed)return 0;a=await hi(t,e.logger);let m=await Di(e);if(m==null)return 1;d=m.serverHandle,i.setCacheStatus(m.cacheStatus);let h=await To(e,t,m,i);l=h.attachmentResult;let g=await Ea(e,t,m,h,i,n);o=g.success,o&&p.entity!=null&&await wa(t.triggerResult.context,p.entity,f),i.end(),s=await Ra(e,t,m,g,i,n,e.logger)}catch(e){s=1;let t=Date.now()-n,a=e instanceof Error?e.name:`UnknownError`,o=e instanceof Error?e.message:String(e);i.recordError(a,o,!1),i.end(),Ne({sessionId:null,cacheStatus:`miss`,duration:t}),e instanceof Error?(r.error(`Agent failed`,{error:e.message}),b(e.message)):(r.error(`Agent failed with unknown error`),b(`An unknown error occurred`))}finally{await fa({bootstrapLogger:r,reactionCtx:a,githubClient:c,agentSuccess:o,attachmentResult:l,serverHandle:d,detectedOpencodeVersion:u})}return s}await Eo().then(e=>{L.exit(e)});export{}; \ No newline at end of file +`,{discussionId:i.id,body:n.body});return r.debug(`Created discussion comment`,{discussionId:i.id}),{commentId:a.addDiscussionComment.comment.id,created:!0,updated:!1,url:a.addDiscussionComment.comment.url}}catch(e){return r.warning(`Failed to post discussion comment`,{target:t,error:d(e)}),null}}async function Ba(e,t,n,r){if(t.type===`discussion`)return za(e,t,n,r);if(n.updateExisting===!0&&n.botLogin!=null){let i=await Fa(e,t,n.botLogin,r);if(i!=null){let a=Ia(i,n.botLogin);if(a!=null&&typeof a.id==`number`)return Ra(e,t,a.id,n.body,r)}}return La(e,t,n.body,r)}async function Va(e,t,n,r,i,a,o){let s=Date.now()-a;if(B({sessionId:r.sessionId,cacheStatus:n.cacheStatus,duration:s}),await Pe({eventType:t.agentContext.eventName,repo:t.agentContext.repo,ref:t.agentContext.ref,runId:Number(t.agentContext.runId),runUrl:`https://github.com/${t.agentContext.repo}/actions/runs/${t.agentContext.runId}`,metrics:i.getMetrics(),agent:e.inputs.agent},o),r.success)return o.info(`Agent run completed successfully`,{durationMs:s}),0;if(r.llmError==null)return b(`Agent execution failed with exit code ${r.exitCode}`),r.exitCode;o.info(`Agent failed with recoverable LLM error`,{error:r.llmError.message,type:r.llmError.type,durationMs:s});let[c,l]=t.agentContext.repo.split(`/`),u={type:t.triggerResult.context.eventType===`discussion_comment`?`discussion`:t.agentContext.issueType===`pr`?`pr`:`issue`,number:t.agentContext.issueNumber??0,owner:c??``,repo:l??``};if(u.number>0&&u.owner.length>0&&u.repo.length>0){let e=pn(r.llmError),n=j({phase:`error-comment`}),a=await Ba(t.githubClient,u,{body:e},n);a==null?n.warning(`Failed to post LLM error comment`):(n.info(`Posted LLM error comment`,{commentUrl:a.url}),i.incrementComments())}else o.warning(`Cannot post error comment: missing target context`);return 0}function Ha(e){switch(e){case`issue_comment`:return`issue_comment`;case`discussion`:case`discussion_comment`:return`discussion_comment`;case`workflow_dispatch`:return`workflow_dispatch`;case`issues`:return`issues`;case`pull_request`:return`pull_request`;case`pull_request_review_comment`:return`pull_request_review_comment`;case`schedule`:return`schedule`;default:return`unsupported`}}function Ua(e,t){switch(e){case`issue_comment`:{let e=t;return{type:`issue_comment`,action:e.action,issue:{number:e.issue.number,title:e.issue.title,body:e.issue.body??null,locked:e.issue.locked??!1,isPullRequest:e.issue.pull_request!=null},comment:{id:e.comment.id,body:e.comment.body,author:e.comment.user.login,authorAssociation:e.comment.author_association??`NONE`}}}case`discussion_comment`:{let e=t;return{type:`discussion_comment`,action:e.action,discussion:{number:e.discussion.number,title:e.discussion.title,body:e.discussion.body??null,locked:e.discussion.locked??!1},comment:{id:e.comment.id,body:e.comment.body??null,author:e.comment.user.login,authorAssociation:e.comment.author_association??`NONE`}}}case`issues`:{let e=t;return{type:`issues`,action:e.action,issue:{number:e.issue.number,title:e.issue.title,body:e.issue.body??null,locked:e.issue.locked??!1,authorAssociation:e.issue.author_association??`NONE`},sender:{login:e.sender.login}}}case`pull_request`:{let e=t,n=e.pull_request.requested_reviewers??[],r=`requested_reviewer`in e&&e.requested_reviewer!=null?{login:e.requested_reviewer.login,type:e.requested_reviewer.type}:null,i=`requested_team`in e&&e.requested_team!=null?{name:e.requested_team.name,slug:e.requested_team.slug}:null,a=n.flatMap(e=>`login`in e&&`type`in e?[{login:e.login,type:e.type}]:[]);return{type:`pull_request`,action:e.action,requestedReviewer:r,requestedTeam:i,pullRequest:{number:e.pull_request.number,title:e.pull_request.title,body:e.pull_request.body??null,locked:e.pull_request.locked??!1,draft:e.pull_request.draft??!1,authorAssociation:e.pull_request.author_association??`NONE`,requestedReviewers:a},sender:{login:e.sender.login}}}case`pull_request_review_comment`:{let e=t;return{type:`pull_request_review_comment`,action:e.action,pullRequest:{number:e.pull_request.number,title:e.pull_request.title,locked:e.pull_request.locked??!1},comment:{id:e.comment.id,body:e.comment.body,author:e.comment.user.login,authorAssociation:e.comment.author_association,path:e.comment.path,line:e.comment.line??null,diffHunk:e.comment.diff_hunk,commitId:e.comment.commit_id}}}case`workflow_dispatch`:return{type:`workflow_dispatch`,inputs:{prompt:t.inputs?.prompt??void 0}};case`schedule`:return{type:`schedule`,schedule:t.schedule??void 0};case`unsupported`:return{type:`unsupported`}}}function Wa(e){let t=ie,n=Ha(t.eventName),r=Ua(n,t.payload);return e.debug(`Parsed GitHub context`,{eventName:t.eventName,eventType:n,repo:`${t.repo.owner}/${t.repo.repo}`}),{eventName:t.eventName,eventType:n,repo:t.repo,ref:t.ref,sha:t.sha,runId:t.runId,actor:t.actor,payload:t.payload,event:r}}function Ga(e,t){return t.includes(e)}function X(e){return e.endsWith(`[bot]`)}function Ka(e,t){if(t.length===0)return!1;let n=t.replace(/\[bot\]$/i,``);return n.length===0?!1:new RegExp(String.raw`@${qa(n)}(?:\[bot\])?(?:$|[^\w])`,`i`).test(e)}function qa(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function Ja(e,t){if(t.length===0)return null;let n=t.replace(/\[bot\]$/i,``);if(n.length===0)return null;let r=new RegExp(String.raw`@${qa(n)}(?:\[bot\])?\s*(.*)`,`is`).exec(e)?.[1];if(r==null)return null;let i=r.trim();if(i.length===0)return{raw:``,action:null,args:``};let a=i.split(/\s+/),o=a[0]??``;return{raw:i,action:o===``?null:o,args:a.slice(1).join(` `)}}function Z(e,t){if(t==null||t===``||e==null)return{hasMention:!1,command:null};let n=Ka(e,t);return{hasMention:n,command:n?Ja(e,t):null}}function Ya(e,t){if(e.type!==`issue_comment`)throw Error(`Event type must be issue_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r={kind:e.issue.isPullRequest?`pr`:`issue`,number:e.issue.number,title:e.issue.title,body:e.comment.body??null,locked:e.issue.locked},{hasMention:i,command:a}=Z(e.comment.body,t);return{action:e.action,author:n,target:r,commentBody:e.comment.body,commentId:e.comment.id,hasMention:i,command:a,isBotReviewRequested:!1}}function Xa(e,t){if(e.type!==`discussion_comment`)throw Error(`Event type must be discussion_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r=e.comment.body??null,i={kind:`discussion`,number:e.discussion.number,title:e.discussion.title,body:r??e.discussion.body??null,locked:e.discussion.locked},{hasMention:a,command:o}=Z(r,t);return{action:e.action,author:n,target:i,commentBody:r,commentId:e.comment.id,hasMention:a,command:o,isBotReviewRequested:!1}}function Za(e,t){if(e.type!==`pull_request_review_comment`)throw Error(`Event type must be pull_request_review_comment`);let n={login:e.comment.author,association:e.comment.authorAssociation,isBot:X(e.comment.author)},r={kind:`pr`,number:e.pullRequest.number,title:e.pullRequest.title,body:e.comment.body,locked:e.pullRequest.locked,path:e.comment.path,line:e.comment.line??void 0,diffHunk:e.comment.diffHunk,commitId:e.comment.commitId},{hasMention:i,command:a}=Z(e.comment.body,t);return{action:e.action,author:n,target:r,commentBody:e.comment.body,commentId:e.comment.id,hasMention:i,command:a,isBotReviewRequested:!1}}function Qa(e,t,n){if(e.type!==`workflow_dispatch`)throw Error(`Event type must be workflow_dispatch`);let r=(n??e.inputs?.prompt??``).trim();return{action:null,author:{login:t,association:`OWNER`,isBot:!1},target:{kind:`manual`,number:0,title:`Manual workflow dispatch`,body:r===``?null:r,locked:!1},commentBody:r===``?null:r,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}function $a(e,t,n){let r=n?.trim()??``;return{action:null,author:{login:t,association:`OWNER`,isBot:!1},target:{kind:`manual`,number:0,title:`Scheduled workflow`,body:r===``?null:r,locked:!1},commentBody:r===``?null:r,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}function eo(e){return e.toLowerCase().replace(/\[bot\]$/i,``)}function to(e,t){if(e.type!==`pull_request`||t==null||t===``)return!1;let n=eo(t);if(n===``)return!1;if(e.action===`review_requested`){let t=e.requestedReviewer?.login;return t!=null&&eo(t)===n}return e.action===`ready_for_review`?e.pullRequest.requestedReviewers.some(e=>eo(e.login)===n):!1}function no(e,t){if(e.type!==`issues`)throw Error(`Event type must be issues`);let n={login:e.sender.login,association:e.issue.authorAssociation,isBot:X(e.sender.login)},r={kind:`issue`,number:e.issue.number,title:e.issue.title,body:e.issue.body,locked:e.issue.locked},{hasMention:i,command:a}=Z(e.issue.body??``,t);return{action:e.action,author:n,target:r,commentBody:e.issue.body,commentId:null,hasMention:i,command:a,isBotReviewRequested:!1}}function ro(e,t){if(e.type!==`pull_request`)throw Error(`Event type must be pull_request`);let n={login:e.sender.login,association:e.pullRequest.authorAssociation,isBot:X(e.sender.login)},r={kind:`pr`,number:e.pullRequest.number,title:e.pullRequest.title,body:e.pullRequest.body,locked:e.pullRequest.locked,isDraft:e.pullRequest.draft,requestedReviewerLogin:e.requestedReviewer?.login,requestedTeamSlug:e.requestedTeam?.slug,requestedReviewerLogins:e.pullRequest.requestedReviewers.map(e=>e.login)},{hasMention:i,command:a}=Z(e.pullRequest.body??``,t);return{action:e.action,author:n,target:r,commentBody:e.pullRequest.body,commentId:null,hasMention:i,command:a,isBotReviewRequested:to(e,t)}}function Q(e,t){return{...e,action:t.action,author:t.author,target:t.target,commentBody:t.commentBody,commentId:t.commentId,hasMention:t.hasMention,command:t.command,isBotReviewRequested:t.isBotReviewRequested}}function io(e,t,n){let r={eventType:e.eventType,eventName:e.eventName,repo:e.repo,ref:e.ref,sha:e.sha,runId:e.runId,actor:e.actor,raw:e};switch(e.eventType){case`issue_comment`:return Q(r,Ya(e.event,t));case`discussion_comment`:return Q(r,Xa(e.event,t));case`workflow_dispatch`:return Q(r,Qa(e.event,e.actor,n));case`issues`:return Q(r,no(e.event,t));case`pull_request`:return Q(r,ro(e.event,t));case`pull_request_review_comment`:return Q(r,Za(e.event,t));case`schedule`:return Q(r,$a(e.event,e.actor,n));case`unsupported`:return{...r,action:null,author:null,target:null,commentBody:null,commentId:null,hasMention:!1,command:null,isBotReviewRequested:!1}}}function ao(e,t,n){let{targetLabel:r,actionLabel:i}=n;return e.action===`created`?e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`${r} is locked`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Comments from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ga(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.requireMention&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Comment does not mention the bot`}:{shouldSkip:!1}:{shouldSkip:!0,reason:`action_not_created`,message:`${i} action is '${e.action}', not 'created'`}}function oo(e,t){return ao(e,t,{targetLabel:`Issue or PR`,actionLabel:`Comment`})}function so(e,t){return ao(e,t,{targetLabel:`Discussion`,actionLabel:`Discussion comment`})}const co=[`opened`,`edited`];function lo(e){return co.includes(e)}function uo(e,t){let n=e.action;return n==null||!lo(n)?{shouldSkip:!0,reason:`action_not_supported`,message:`Issues action '${n}' is not supported (only 'opened' and 'edited')`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Issues from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ga(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:n===`edited`&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Issue edit does not mention the bot`}:e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Issue is locked`}:{shouldSkip:!1}}function fo(e){return(e.promptInput?.trim()??``)===``?{shouldSkip:!0,reason:`prompt_required`,message:`Schedule trigger requires prompt input`}:{shouldSkip:!1}}function po(e){return(e.commentBody?.trim()??``)===``?{shouldSkip:!0,reason:`prompt_required`,message:`Workflow dispatch requires prompt input`}:{shouldSkip:!1}}const mo=[`opened`,`synchronize`,`reopened`,`ready_for_review`,`review_requested`];function ho(e){return mo.includes(e)}function go(e,t){let n=e.action;return n==null||!ho(n)?{shouldSkip:!0,reason:`action_not_supported`,message:`Pull request action '${n}' is not supported`}:e.action!==`review_requested`&&e.action!==`ready_for_review`&&e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Pull requests from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ga(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.skipDraftPRs&&e.target?.isDraft===!0?{shouldSkip:!0,reason:`draft_pr`,message:`Pull request is a draft`}:e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Pull request is locked`}:t.botLogin!=null&&t.botLogin!==``&&(e.action===`ready_for_review`||e.action===`review_requested`)&&e.isBotReviewRequested!==!0?{shouldSkip:!0,reason:`bot_not_requested`,message:`Pull request action '${e.action}' did not request review from the bot`}:{shouldSkip:!1}}function _o(e,t){let n=e.action;return n===`created`?e.target?.locked===!0?{shouldSkip:!0,reason:`issue_locked`,message:`Pull request is locked`}:e.author!=null&&e.author.isBot?{shouldSkip:!0,reason:`self_comment`,message:`Review comments from bots (${e.author.login}) are not processed`}:e.author!=null&&!Ga(e.author.association,t.allowedAssociations)?{shouldSkip:!0,reason:`unauthorized_author`,message:`Author association '${e.author.association}' is not authorized`}:t.requireMention&&!e.hasMention?{shouldSkip:!0,reason:`no_mention`,message:`Review comment does not mention the bot`}:{shouldSkip:!1}:{shouldSkip:!0,reason:`action_not_created`,message:`Review comment action '${n}' is not supported (only 'created')`}}function vo(e){return{shouldSkip:!0,reason:`unsupported_event`,message:`Unsupported event type: ${e}`}}function yo(e,t,n){if(e.eventType===`unsupported`)return n.debug(`Skipping unsupported event`,{eventName:e.eventName}),vo(e.eventName);switch(e.eventType){case`issue_comment`:return oo(e,t);case`discussion_comment`:return so(e,t);case`issues`:return uo(e,t);case`pull_request`:return go(e,t);case`pull_request_review_comment`:return _o(e,t);case`schedule`:return fo(t);case`workflow_dispatch`:return po(e);default:return{shouldSkip:!1}}}const bo={botLogin:null,requireMention:!0,allowedAssociations:mi,skipDraftPRs:!0,promptInput:null,senderAssociation:null};function xo(e,t,n={}){let r={...bo,...n},i=io(e,r.botLogin,r.promptInput);r.senderAssociation!=null&&(i.action===`review_requested`||i.action===`ready_for_review`)&&i.author!=null&&(i={...i,author:{...i.author,association:r.senderAssociation}}),t.debug(`Routing event`,{eventName:e.eventName,eventType:e.eventType,hasMention:i.hasMention});let a=yo(i,r,t);return a.shouldSkip?{shouldProcess:!1,skipReason:a.reason,skipMessage:a.message,context:i}:{shouldProcess:!0,context:i}}async function So(n,r){let i=j({phase:`context`}),a=Wa(i),o=Br({token:n.inputs.githubToken,logger:i}),s=await Vr(o,i),c=null;if(a.event.type===`pull_request`&&(a.event.action===`review_requested`||a.event.action===`ready_for_review`)){let{owner:e,repo:t}=a.repo;c=await We(o,e,t,a.event.sender.login,i)}let l=j({phase:`trigger`}),u=xo(a,l,{botLogin:s,requireMention:!0,promptInput:n.inputs.prompt,senderAssociation:c});return u.shouldProcess?(l.info(`Event routed for processing`,{eventType:u.context.eventType,hasMention:u.context.hasMention,command:u.context.command?.action??null}),t(e.SHOULD_SAVE_CACHE,`true`),{githubClient:o,triggerResult:u,agentContext:await st({logger:i,octokit:o,triggerContext:u.context,botLogin:s}),botLogin:s}):(l.info(`Skipping event`,{reason:u.skipReason,message:u.skipMessage}),B({sessionId:null,cacheStatus:`miss`,duration:Date.now()-r}),null)}function $(e,t){return{key:`${e}-${t}`,entityType:e,entityId:t}}function Co(e){return we(`sha256`).update(e).digest(`hex`).slice(0,8)}function wo(e){if(e.eventType===`unsupported`)return null;if(e.eventType===`schedule`){let t=e.raw.event.type===`schedule`?e.raw.event.schedule:void 0;return $(`schedule`,Co((t!=null&&t.trim().length>0?t:e.action)??`default`))}return e.eventType===`workflow_dispatch`?$(`dispatch`,String(e.runId)):e.target==null?null:e.eventType===`issue_comment`?e.target.kind===`issue`?$(`issue`,String(e.target.number)):e.target.kind===`pr`?$(`pr`,String(e.target.number)):null:e.eventType===`discussion_comment`?e.target.kind===`discussion`?$(`discussion`,String(e.target.number)):null:e.eventType===`issues`?e.target.kind===`issue`?$(`issue`,String(e.target.number)):null:(e.eventType===`pull_request`||e.eventType===`pull_request_review_comment`)&&e.target.kind===`pr`?$(`pr`,String(e.target.number)):null}function To(e){return`fro-bot: ${e.key}`}function Eo(e,t){let n=e.filter(e=>e.title===t);return n.length===0?null:n.reduce((e,t)=>t.time.updated>e.time.updated?t:e)}async function Do(e,t,n,r){try{let i=Eo(await na(e,t,r),To(n));return i==null||i.time.archived!=null||i.time.compacting!=null?{status:`not-found`}:{status:`found`,session:i}}catch(e){return{status:`error`,error:e instanceof Error?e.message:String(e)}}}async function Oo(e,t,n,r){let i=j({phase:`session`}),a=J(M()),o=await ca(n.serverHandle.client,a,{limit:10},i);i.debug(`Listed recent sessions`,{count:o.length});let s=wo(t.triggerResult.context),c=s==null?null:To(s),l=null,u=!1;if(s!=null){let e=await Do(n.serverHandle.client,a,s,i);e.status===`found`?(l=e.session.id,u=!0,i.info(`Session continuity: found existing session`,{logicalKey:s.key,sessionId:l})):e.status===`error`?i.warning(`Session continuity: lookup error, will create new`,{logicalKey:s.key,error:e.error}):i.info(`Session continuity: no existing session found`,{logicalKey:s.key})}let d=s?.key??t.agentContext.issueTitle??t.agentContext.repo,f=await ua(d,n.serverHandle.client,a,{limit:5},i);i.debug(`Searched prior sessions`,{query:d,resultCount:f.length});for(let e of f)r.addSessionUsed(e.sessionId);let p=j({phase:`attachments`}),m=t.agentContext.commentBody??``,h=Ni(m),g=null;if(h.length>0){p.info(`Processing attachments`,{count:h.length});let{validated:t,skipped:n}=Wi(await Ri(h,e.inputs.githubToken,void 0,p),void 0,p);(t.length>0||n.length>0)&&(g=Hi(m,h,t,n),p.info(`Attachments processed`,{processed:t.length,skipped:n.length}))}return{recentSessions:o,priorWorkContext:f,attachmentResult:g,normalizedWorkspace:a,logicalKey:s,continueSessionId:l,isContinuation:u,sessionTitle:c}}async function ko(){let n=Date.now(),r=j({phase:`bootstrap`}),i=Fe();i.start();let a=null,o=!1,s=0,c=null,l=null,u=null,d=null;t(e.SHOULD_SAVE_CACHE,`false`),t(e.CACHE_SAVED,`false`);try{r.info(`Starting Fro Bot Agent`);let e=await Ei(r);if(e==null)return 1;u=e.opencodeResult.version;let t=await So(e,n);if(t==null)return 0;c=t.githubClient;let f=`${t.triggerResult.context.repo.owner}/${t.triggerResult.context.repo.repo}`,p=await Ea(e.inputs.dedupWindow,t.triggerResult.context,f,n);if(!p.shouldProceed)return 0;a=await vi(t,e.logger);let m=await Ai(e);if(m==null)return 1;d=m.serverHandle,i.setCacheStatus(m.cacheStatus);let h=await Oo(e,t,m,i);l=h.attachmentResult;let g=await ka(e,t,m,h,i,n);o=g.success,o&&p.entity!=null&&await Da(t.triggerResult.context,p.entity,f),i.end(),s=await Va(e,t,m,g,i,n,e.logger)}catch(e){s=1;let t=Date.now()-n,a=e instanceof Error?e.name:`UnknownError`,o=e instanceof Error?e.message:String(e);i.recordError(a,o,!1),i.end(),B({sessionId:null,cacheStatus:`miss`,duration:t}),e instanceof Error?(r.error(`Agent failed`,{error:e.message}),b(e.message)):(r.error(`Agent failed with unknown error`),b(`An unknown error occurred`))}finally{await ha({bootstrapLogger:r,reactionCtx:a,githubClient:c,agentSuccess:o,attachmentResult:l,serverHandle:d,detectedOpencodeVersion:u})}return s}await ko().then(e=>{N.exit(e)});export{}; \ No newline at end of file diff --git a/dist/post.js b/dist/post.js index 3ecabdf2..9095912e 100644 --- a/dist/post.js +++ b/dist/post.js @@ -1 +1 @@ -import{A as e,L as t,M as n,a as r,d as i,f as a,g as o,h as s,j as c,m as l,n as u,t as d,y as f}from"./artifact-DnDoCHSt.js";async function p(p={}){let m=p.logger??c({phase:`post`}),h=t(e.SHOULD_SAVE_CACHE),g=t(e.CACHE_SAVED),_=t(e.SESSION_ID)||null,v=t(e.OPENCODE_VERSION)||null;if(m.debug(`Post-action state`,{shouldSaveCache:h,cacheSaved:g,sessionId:_,opencodeVersion:v}),h!==`true`){m.info(`Skipping post-action: event was not processed`,{shouldSaveCache:h});return}if(g===`true`)m.info(`Skipping post-action: cache already saved by main action`,{cacheSaved:g});else try{await u({components:r(),runId:a(),logger:m,storagePath:o(),authPath:l(),opencodeVersion:v})?m.info(`Post-action cache saved`,{sessionId:_}):m.info(`Post-action: no cache content to save`,{sessionId:_})}catch(e){m.warning(`Post-action cache save failed (non-fatal)`,{error:n(e)})}if(f()&&t(e.ARTIFACT_UPLOADED)!==`true`)try{let e=c({phase:`post-artifact-upload`});await d({logPath:s(),runId:a(),runAttempt:i(),logger:e})}catch(e){m.warning(`Post-action artifact upload failed (non-fatal)`,{error:n(e)})}}await p();export{}; \ No newline at end of file +import{A as e,L as t,M as n,a as r,d as i,f as a,g as o,h as s,j as c,m as l,n as u,t as d,y as f}from"./artifact-DhOKZxjK.js";async function p(p={}){let m=p.logger??c({phase:`post`}),h=t(e.SHOULD_SAVE_CACHE),g=t(e.CACHE_SAVED),_=t(e.SESSION_ID)||null,v=t(e.OPENCODE_VERSION)||null;if(m.debug(`Post-action state`,{shouldSaveCache:h,cacheSaved:g,sessionId:_,opencodeVersion:v}),h!==`true`){m.info(`Skipping post-action: event was not processed`,{shouldSaveCache:h});return}if(g===`true`)m.info(`Skipping post-action: cache already saved by main action`,{cacheSaved:g});else try{await u({components:r(),runId:a(),logger:m,storagePath:o(),authPath:l(),opencodeVersion:v})?m.info(`Post-action cache saved`,{sessionId:_}):m.info(`Post-action: no cache content to save`,{sessionId:_})}catch(e){m.warning(`Post-action cache save failed (non-fatal)`,{error:n(e)})}if(f()&&t(e.ARTIFACT_UPLOADED)!==`true`)try{let e=c({phase:`post-artifact-upload`});await d({logPath:s(),runId:a(),runAttempt:i(),logger:e})}catch(e){m.warning(`Post-action artifact upload failed (non-fatal)`,{error:n(e)})}}await p();export{}; \ No newline at end of file diff --git a/docs/solutions/best-practices/versioned-tool-config-plugin-pattern-2026-03-29.md b/docs/solutions/best-practices/versioned-tool-config-plugin-pattern-2026-03-29.md new file mode 100644 index 00000000..3a19a743 --- /dev/null +++ b/docs/solutions/best-practices/versioned-tool-config-plugin-pattern-2026-03-29.md @@ -0,0 +1,182 @@ +--- +title: "Adding a Config-Declared Plugin to the Versioned Tool Pattern" +date: 2026-03-29 +problem_type: best_practice +component: tooling +root_cause: missing_tooling +resolution_type: tooling_addition +severity: medium +tags: + - versioning + - plugin + - opencode + - systematic + - setup + - renovate +category: best_practice +--- + +# Adding a Config-Declared Plugin to the Versioned Tool Pattern + +## Problem + +The fro-bot/agent project manages external CLI tools (OpenCode, Bun, oMo) through a single-source-of-truth version constant pattern documented in `.agents/skills/versioned-tool/SKILL.md`. The `@fro.bot/systematic` OpenCode plugin needed to be added as a fourth bundled tool, but it installs differently from all existing tools — it's a config-declared plugin, not a downloaded binary or bunx-installed package. + +## Symptoms + +- No `@fro.bot/systematic` reference anywhere in the codebase +- Agent running in CI had no access to Systematic skills/workflows (brainstorming, planning, code review) +- The versioned-tool skill pattern covered binary downloads and bunx installs but not config-declared plugins + +## What Didn't Work + +The initial instinct was to model Systematic after oMo's installer pattern (`bunx oh-my-openagent@{version} install --no-tui --skip-auth`). This was wrong because: + +1. Systematic has no `install` CLI subcommand — it's an OpenCode plugin, not a standalone CLI tool +2. OpenCode resolves plugins declared in its config at startup; no separate install step is needed +3. Creating a `systematic.ts` installer file would have been dead code + +The versioned-tool skill itself warns: _"Do not copy installer structure blindly between tools. Copy the version-source pattern; verify the install mechanics per tool."_ + +## Solution + +### Adapted Pattern: Version Constant → Config Plugin Injection + +Instead of a separate installer, the version flows through the existing data pipeline and lands in `OPENCODE_CONFIG_CONTENT`'s `plugins` array. + +**Data flow:** + +``` +constants.ts → inputs.ts fallback → ActionInputs → bootstrap.ts + → EnsureOpenCodeOptions → SetupInputs → setup.ts ciConfig.plugins + → OPENCODE_CONFIG_CONTENT env var → OpenCode resolves at startup +``` + +### 1. Version Constant (single source of truth) + +```typescript +// src/shared/constants.ts +export const DEFAULT_SYSTEMATIC_VERSION = "2.1.0" +``` + +### 2. Type Thread (4 interfaces updated) + +```typescript +// src/shared/types.ts — ActionInputs +readonly systematicVersion: string + +// src/services/setup/types.ts — SetupInputs +readonly systematicVersion: string + +// src/features/agent/server.ts — EnsureOpenCodeOptions +systematicVersion: string +``` + +### 3. Input Parsing with Constant Fallback + +```typescript +// src/harness/config/inputs.ts +const systematicVersionRaw = core.getInput("systematic-version").trim() +const systematicVersion = systematicVersionRaw.length > 0 ? systematicVersionRaw : DEFAULT_SYSTEMATIC_VERSION +``` + +### 4. Plugin Registration in OpenCode Config (the key adaptation) + +```typescript +// src/services/setup/setup.ts — after user opencode-config merge +const systematicPlugin = `@fro.bot/systematic@${inputs.systematicVersion}` +const rawPlugins: unknown[] = Array.isArray(ciConfig.plugins) ? (ciConfig.plugins as unknown[]) : [] +const hasSystematic = rawPlugins.some((p: unknown) => typeof p === "string" && p.startsWith("@fro.bot/systematic")) +if (!hasSystematic) { + ciConfig.plugins = [...rawPlugins, systematicPlugin] +} +``` + +Design decisions: + +- Plugin appended AFTER user `opencode-config` merge, so it's always present +- Dedup via `@fro.bot/systematic` prefix match so user version pins win +- Explicit `unknown[]` annotation avoids `@typescript-eslint/no-unsafe-assignment` lint error + +### 5. Renovate Tracking (npm datasource) + +```json5 +// .github/renovate.json5 — customManagers entry +{ + customType: "regex", + managerFilePatterns: ["/src\\/shared\\/constants\\.ts/"], + matchStrings: ["DEFAULT_SYSTEMATIC_VERSION = '(?\\d+\\.\\d+\\.\\d+)'"], + depNameTemplate: "@fro.bot/systematic", + datasourceTemplate: "npm", +} +``` + +### 6. Action Input (no hardcoded default) + +```yaml +# action.yaml — NO default: value, falls through to constant +systematic-version: + description: Systematic plugin version to register with OpenCode. + required: false +``` + +## Why This Works + +OpenCode reads `OPENCODE_CONFIG_CONTENT` as its highest-precedence config. By adding `plugins: ["@fro.bot/systematic@2.1.0"]` to this env var during setup, OpenCode resolves and installs the plugin at startup. The version is pinned via the same constant pattern used by all other tools, with Renovate automating npm version bumps through the `customManagers` regex. + +## Prevention + +### 1. Follow the versioned-tool skill + +`.agents/skills/versioned-tool/SKILL.md` documents the exact pattern. Every new tool should follow its verification checklist: + +- Constant updated in `constants.ts` +- No duplicate version literals (grep for old version string) +- `action.yaml` has no hardcoded default +- Renovate regex matches the constant pattern +- Tests pass, lint clean, dist/ rebuilt + +### 2. Verify install mechanics BEFORE copying patterns + +The four tools now use four different installation mechanisms: + +| Tool | Mechanism | Install Location | +| ---------- | ----------------------------------------------- | ---------------------------- | +| OpenCode | Binary download + tool-cache | PATH binary | +| Bun | Binary download + tool-cache | PATH binary | +| oMo | `bunx` CLI with `install` subcommand | npm global + config | +| Systematic | Config declaration in `OPENCODE_CONFIG_CONTENT` | OpenCode resolves at startup | + +When adding a fifth tool, check the tool's README first. The install mechanism determines whether you need an installer file or just config wiring. + +### 3. Dedup array injections + +When programmatically injecting into arrays that users can also populate (like `plugins`), always check for existing entries before appending. Prefix matching (`p.startsWith('@fro.bot/systematic')`) handles version differences gracefully. + +### 4. Type safety with `Record` + +When spreading arrays extracted from `unknown`-typed objects, `Array.isArray()` narrows to `any[]` in TypeScript. Use explicit `unknown[]` annotation (`ciConfig.plugins as unknown[]`) to satisfy `@typescript-eslint/no-unsafe-assignment`. + +### 5. Update ALL ciConfig test assertions + +When changing what goes into `OPENCODE_CONFIG_CONTENT`, grep `setup.test.ts` for every `OPENCODE_CONFIG_CONTENT` assertion. There were 3 that needed updating for the plugins array addition. + +## Related Documentation + +- [Tool Binary Caching on Ephemeral Runners](../build-errors/tool-binary-caching-ephemeral-runners.md) — Covers the tools cache layer, oMo version pinning, and the input→type→constant flow pattern that Systematic also follows +- [Versioned Tool Skill](/.agents/skills/versioned-tool/SKILL.md) — The canonical reference for this pattern +- [PR #409](https://github.com/fro-bot/agent/pull/409) — Implementation PR + +## Files Changed + +| File | Change | +| --------------------------------- | ----------------------------------------------- | +| `src/shared/constants.ts` | Added `DEFAULT_SYSTEMATIC_VERSION` | +| `src/shared/types.ts` | Added `systematicVersion` to `ActionInputs` | +| `src/harness/config/inputs.ts` | Parse `systematic-version` with fallback | +| `src/services/setup/types.ts` | Added `systematicVersion` to `SetupInputs` | +| `src/features/agent/server.ts` | Added to `EnsureOpenCodeOptions` + pass-through | +| `src/harness/phases/bootstrap.ts` | Pass `inputs.systematicVersion` downstream | +| `src/services/setup/setup.ts` | Plugin injection into `ciConfig.plugins` | +| `action.yaml` | Added `systematic-version` input | +| `.github/renovate.json5` | npm customManager + packageRule | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7428643b..07eb436f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,10 +5,14 @@ settings: excludeLinksFromLockfile: false overrides: + brace-expansion: '>=5.0.5' fast-xml-parser: '>=5.5.7' flatted: 3.4.2 + handlebars: '>=4.7.9' + picomatch: '>=4.0.4' tar@^7: '>=7.5.11' undici@^7: '>=7.24.0' + yaml: '>=2.8.3' importers: @@ -44,7 +48,7 @@ importers: devDependencies: '@bfra.me/eslint-config': specifier: 0.50.1 - version: 0.50.1(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/rule-tester@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/typescript-estree@8.57.0(typescript@5.9.3))(@typescript-eslint/utils@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2))))(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) + version: 0.50.1(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/rule-tester@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/typescript-estree@8.57.0(typescript@5.9.3))(@typescript-eslint/utils@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3))))(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) '@bfra.me/prettier-config': specifier: 0.16.7 version: 0.16.7(prettier@3.8.1) @@ -65,7 +69,7 @@ importers: version: 24.10.13 '@vitest/eslint-plugin': specifier: 1.6.13 - version: 1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2))) + version: 1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3))) conventional-changelog-conventionalcommits: specifier: 9.3.0 version: 9.3.0 @@ -110,7 +114,7 @@ importers: version: 5.9.3 vitest: specifier: 4.1.2 - version: 4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2)) + version: 4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3)) packages: @@ -1625,9 +1629,6 @@ packages: react-native-b4a: optional: true - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} @@ -1700,14 +1701,8 @@ packages: bottleneck@2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} - brace-expansion@1.1.12: - resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - - brace-expansion@2.0.3: - resolution: {integrity: sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==} - - brace-expansion@5.0.4: - resolution: {integrity: sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==} + brace-expansion@5.0.5: + resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==} engines: {node: 18 || 20 || >=22} braces@3.0.3: @@ -1879,9 +1874,6 @@ packages: resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} engines: {node: '>= 14'} - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} @@ -2366,7 +2358,7 @@ packages: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} peerDependencies: - picomatch: ^3 || ^4 + picomatch: '>=4.0.4' peerDependenciesMeta: picomatch: optional: true @@ -2518,8 +2510,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + handlebars@4.7.9: + resolution: {integrity: sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==} engines: {node: '>=0.4.7'} hasBin: true @@ -3471,10 +3463,6 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - picomatch@4.0.4: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} @@ -4223,7 +4211,7 @@ packages: sugarss: ^5.0.0 terser: ^5.16.0 tsx: ^4.8.1 - yaml: ^2.4.2 + yaml: '>=2.8.3' peerDependenciesMeta: '@types/node': optional: true @@ -4350,8 +4338,8 @@ packages: resolution: {integrity: sha512-h0uDm97wvT2bokfwwTmY6kJ1hp6YDFL0nRHwNKz8s/VD1FH/vvZjAKoMUE+un0eaYBSG7/c6h+lJTP+31tjgTw==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - yaml@2.8.2: - resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + yaml@2.8.3: + resolution: {integrity: sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==} engines: {node: '>= 14.6'} hasBin: true @@ -4618,7 +4606,7 @@ snapshots: dependencies: is-in-ci: 2.0.0 - '@bfra.me/eslint-config@0.50.1(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/rule-tester@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/typescript-estree@8.57.0(typescript@5.9.3))(@typescript-eslint/utils@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2))))(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)': + '@bfra.me/eslint-config@0.50.1(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/rule-tester@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@typescript-eslint/typescript-estree@8.57.0(typescript@5.9.3))(@typescript-eslint/utils@8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3))))(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@bfra.me/es': 0.1.0 '@eslint-community/eslint-plugin-eslint-comments': 4.6.0(eslint@10.1.0(jiti@2.6.1)) @@ -4647,7 +4635,7 @@ snapshots: sort-package-json: 3.6.1 typescript-eslint: 8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) optionalDependencies: - '@vitest/eslint-plugin': 1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2))) + '@vitest/eslint-plugin': 1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3))) eslint-config-prettier: 10.1.8(eslint@10.1.0(jiti@2.6.1)) eslint-plugin-prettier: 5.5.5(eslint-config-prettier@10.1.8(eslint@10.1.0(jiti@2.6.1)))(eslint@10.1.0(jiti@2.6.1))(prettier@3.8.1) transitivePeerDependencies: @@ -5809,7 +5797,7 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true - '@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2)))': + '@vitest/eslint-plugin@1.6.13(@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)(vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3)))': dependencies: '@typescript-eslint/scope-manager': 8.57.0 '@typescript-eslint/utils': 8.57.0(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) @@ -5817,7 +5805,7 @@ snapshots: optionalDependencies: '@typescript-eslint/eslint-plugin': 8.56.1(@typescript-eslint/parser@8.56.1(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3))(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) typescript: 5.9.3 - vitest: 4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2)) + vitest: 4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3)) transitivePeerDependencies: - supports-color @@ -5830,13 +5818,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.2(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2))': + '@vitest/mocker@4.1.2(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3))': dependencies: '@vitest/spy': 4.1.2 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2) + vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3) '@vitest/pretty-format@4.1.2': dependencies: @@ -5968,8 +5956,6 @@ snapshots: b4a@1.8.0: {} - balanced-match@1.0.2: {} - balanced-match@4.0.4: {} bare-events@2.8.2: {} @@ -6033,16 +6019,7 @@ snapshots: bottleneck@2.19.5: {} - brace-expansion@1.1.12: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - brace-expansion@2.0.3: - dependencies: - balanced-match: 1.0.2 - - brace-expansion@5.0.4: + brace-expansion@5.0.5: dependencies: balanced-match: 4.0.4 @@ -6214,8 +6191,6 @@ snapshots: normalize-path: 3.0.0 readable-stream: 4.7.0 - concat-map@0.0.1: {} - confbox@0.1.8: {} confbox@0.2.4: {} @@ -6237,7 +6212,7 @@ snapshots: dependencies: '@simple-libs/stream-utils': 1.2.0 conventional-commits-filter: 5.0.0 - handlebars: 4.7.8 + handlebars: 4.7.9 meow: 13.2.0 semver: 7.7.4 @@ -6946,7 +6921,7 @@ snapshots: graceful-fs@4.2.11: {} - handlebars@4.7.8: + handlebars@4.7.9: dependencies: minimist: 1.2.8 neo-async: 2.6.2 @@ -7191,7 +7166,7 @@ snapshots: picomatch: 4.0.4 string-argv: 0.3.2 tinyexec: 1.0.4 - yaml: 2.8.2 + yaml: 2.8.3 listr2@9.0.5: dependencies: @@ -7618,7 +7593,7 @@ snapshots: micromatch@4.0.8: dependencies: braces: 3.0.3 - picomatch: 2.3.1 + picomatch: 4.0.4 mime@4.1.0: {} @@ -7630,19 +7605,19 @@ snapshots: minimatch@10.2.4: dependencies: - brace-expansion: 5.0.4 + brace-expansion: 5.0.5 minimatch@3.1.5: dependencies: - brace-expansion: 1.1.12 + brace-expansion: 5.0.5 minimatch@5.1.9: dependencies: - brace-expansion: 2.0.3 + brace-expansion: 5.0.5 minimatch@9.0.9: dependencies: - brace-expansion: 2.0.3 + brace-expansion: 5.0.5 minimist@1.2.8: {} @@ -7987,8 +7962,6 @@ snapshots: picocolors@1.1.1: {} - picomatch@2.3.1: {} - picomatch@4.0.4: {} pify@3.0.0: {} @@ -8812,7 +8785,7 @@ snapshots: validate-npm-package-name@7.0.2: {} - vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2): + vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3): dependencies: esbuild: 0.27.4 fdir: 6.5.0(picomatch@4.0.4) @@ -8824,12 +8797,12 @@ snapshots: '@types/node': 24.10.13 fsevents: 2.3.3 jiti: 2.6.1 - yaml: 2.8.2 + yaml: 2.8.3 - vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2)): + vitest@4.1.2(@types/node@24.10.13)(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3)): dependencies: '@vitest/expect': 4.1.2 - '@vitest/mocker': 4.1.2(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2)) + '@vitest/mocker': 4.1.2(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3)) '@vitest/pretty-format': 4.1.2 '@vitest/runner': 4.1.2 '@vitest/snapshot': 4.1.2 @@ -8846,7 +8819,7 @@ snapshots: tinyexec: 1.0.4 tinyglobby: 0.2.15 tinyrainbow: 3.1.0 - vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.2) + vite: 7.3.1(@types/node@24.10.13)(jiti@2.6.1)(yaml@2.8.3) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 24.10.13 @@ -8911,9 +8884,9 @@ snapshots: yaml-eslint-parser@2.0.0: dependencies: eslint-visitor-keys: 5.0.1 - yaml: 2.8.2 + yaml: 2.8.3 - yaml@2.8.2: {} + yaml@2.8.3: {} yargs-parser@20.2.9: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index cddc12f7..bd6c9fcf 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,10 +8,14 @@ onlyBuiltDependencies: - unrs-resolver overrides: + brace-expansion: '>=5.0.5' fast-xml-parser: '>=5.5.7' flatted: 3.4.2 + handlebars: '>=4.7.9' + picomatch: '>=4.0.4' tar@^7: '>=7.5.11' undici@^7: '>=7.24.0' + yaml: '>=2.8.3' savePrefix: '' diff --git a/src/features/agent/AGENTS.md b/src/features/agent/AGENTS.md index 1c6edd61..1cf14363 100644 --- a/src/features/agent/AGENTS.md +++ b/src/features/agent/AGENTS.md @@ -9,7 +9,7 @@ OpenCode SDK execution with GitHub context injection, multi-section prompt const | **Execution** | `execution.ts` | SDK session creation, prompt retry loop, result collection (178 L) | | **Prompting** | `prompt-sender.ts` | Prompt body construction, model resolution (73 L) | | **Retry** | `retry.ts` | Retry constants, `runPromptAttempt` with event stream (94 L) | -| **Server** | `server.ts` | SDK server bootstrap, health check (106 L) | +| **Server** | `server.ts` | SDK server bootstrap, health check, setup option wiring (110 L) | | **Polling** | `session-poll.ts` | Poll for session completion, event processor shutdown (110 L) | | **Streaming** | `streaming.ts` | Event stream processing, artifact detection (137 L) | | **Context** | `context.ts` | Gathers event data from NormalizedEvent, diff, hydrated context | @@ -83,6 +83,7 @@ gh CLI Reference (always) - **Reaction-based UX**: Non-fatal state machine (Eyes → Hooray/Confused); failures never crash execution - **Context Budgeting**: Two-tier enforcement (50 files fetched, 20 files injected into prompt) - **NormalizedEvent Intake**: `collectAgentContext` reads from `NormalizedEvent` (not raw payloads) +- **Setup Option Pass-through**: `EnsureOpenCodeOptions` includes `systematicVersion` and `systematicConfig` for setup handoff ## ANTI-PATTERNS diff --git a/src/features/agent/opencode.test.ts b/src/features/agent/opencode.test.ts index 2c2fee5e..43b38bdf 100644 --- a/src/features/agent/opencode.test.ts +++ b/src/features/agent/opencode.test.ts @@ -1054,6 +1054,7 @@ describe('ensureOpenCodeAvailable', () => { kimiForCoding: 'no', }, opencodeConfig: null, + systematicConfig: null, }) // #then @@ -1087,6 +1088,7 @@ describe('ensureOpenCodeAvailable', () => { kimiForCoding: 'no', }, opencodeConfig: null, + systematicConfig: null, }) } catch { // Expected to fail since runSetup will fail in test environment diff --git a/src/features/agent/server.ts b/src/features/agent/server.ts index 19d9a7e2..9164a4cc 100644 --- a/src/features/agent/server.ts +++ b/src/features/agent/server.ts @@ -64,14 +64,15 @@ export async function verifyOpenCodeAvailable( } export interface EnsureOpenCodeOptions { - logger: Logger - opencodeVersion: string - githubToken: string - authJson: string - omoVersion: string - systematicVersion: string - omoProviders: SetupInputs['omoProviders'] - opencodeConfig: string | null + readonly logger: Logger + readonly opencodeVersion: string + readonly githubToken: string + readonly authJson: string + readonly omoVersion: string + readonly systematicVersion: string + readonly omoProviders: SetupInputs['omoProviders'] + readonly opencodeConfig: string | null + readonly systematicConfig: string | null } export async function ensureOpenCodeAvailable(options: EnsureOpenCodeOptions): Promise { @@ -91,6 +92,7 @@ export async function ensureOpenCodeAvailable(options: EnsureOpenCodeOptions): P appId: null, privateKey: null, opencodeConfig: options.opencodeConfig, + systematicConfig: options.systematicConfig, omoConfig: null, omoVersion: options.omoVersion, systematicVersion: options.systematicVersion, diff --git a/src/harness/config/inputs.test.ts b/src/harness/config/inputs.test.ts index de0fdb52..364b1111 100644 --- a/src/harness/config/inputs.test.ts +++ b/src/harness/config/inputs.test.ts @@ -575,6 +575,42 @@ describe('parseActionInputs', () => { expect(result.success).toBe(true) expect(result.success && result.data.opencodeConfig).toBe(null) }) + + it('parses systematic-config when provided', () => { + const mockGetInput = core.getInput as ReturnType + + mockGetInput.mockImplementation((name: string) => { + const inputs: Record = { + 'github-token': 'ghp_test123', + 'auth-json': '{"anthropic":{"type":"api","key":"sk-ant-test"}}', + 'systematic-config': '{"mode":"strict"}', + } + return inputs[name] ?? '' + }) + + const result = parseActionInputs() + + expect(result.success).toBe(true) + expect(result.success && result.data.systematicConfig).toBe('{"mode":"strict"}') + }) + + it('sets systematicConfig to null when empty string', () => { + const mockGetInput = core.getInput as ReturnType + + mockGetInput.mockImplementation((name: string) => { + const inputs: Record = { + 'github-token': 'ghp_test123', + 'auth-json': '{"anthropic":{"type":"api","key":"sk-ant-test"}}', + 'systematic-config': '', + } + return inputs[name] ?? '' + }) + + const result = parseActionInputs() + + expect(result.success).toBe(true) + expect(result.success && result.data.systematicConfig).toBe(null) + }) }) }) diff --git a/src/harness/config/inputs.ts b/src/harness/config/inputs.ts index 2aa5a8fb..9ab466c7 100644 --- a/src/harness/config/inputs.ts +++ b/src/harness/config/inputs.ts @@ -200,6 +200,9 @@ export function parseActionInputs(): Result { const opencodeConfigRaw = core.getInput('opencode-config').trim() const opencodeConfig = opencodeConfigRaw.length > 0 ? opencodeConfigRaw : null + const systematicConfigRaw = core.getInput('systematic-config').trim() + const systematicConfig = systematicConfigRaw.length > 0 ? systematicConfigRaw : null + const dedupWindowRaw = core.getInput('dedup-window').trim() const dedupWindow = dedupWindowRaw.length > 0 ? parseTimeoutMs(dedupWindowRaw, 'dedup-window') : DEFAULT_DEDUP_WINDOW_MS @@ -235,6 +238,7 @@ export function parseActionInputs(): Result { systematicVersion, omoProviders, opencodeConfig, + systematicConfig, dedupWindow, }) } catch (error) { diff --git a/src/harness/phases/bootstrap.ts b/src/harness/phases/bootstrap.ts index bfc6c83f..3ceba644 100644 --- a/src/harness/phases/bootstrap.ts +++ b/src/harness/phases/bootstrap.ts @@ -43,6 +43,7 @@ export async function runBootstrap(bootstrapLogger: Logger): Promise { process.env.GITHUB_REPOSITORY = 'test-owner/test-repo' process.env.GITHUB_REF_NAME = 'main' process.env.GITHUB_RUN_ID = '12345' + process.env.GITHUB_RUN_ATTEMPT = '1' process.env.RUNNER_OS = 'Linux' }) @@ -35,6 +36,7 @@ describe('post action', () => { delete process.env.GITHUB_REPOSITORY delete process.env.GITHUB_REF_NAME delete process.env.GITHUB_RUN_ID + delete process.env.GITHUB_RUN_ATTEMPT delete process.env.RUNNER_OS }) diff --git a/src/services/setup/AGENTS.md b/src/services/setup/AGENTS.md index dbf7211a..fc43fe0a 100644 --- a/src/services/setup/AGENTS.md +++ b/src/services/setup/AGENTS.md @@ -6,30 +6,35 @@ Environment bootstrap logic: Bun runtime, OpenCode CLI, and oMo plugin installat ## WHERE TO LOOK -| Component | File | Responsibility | -| -------------- | ---------------- | ---------------------------------------------- | -| **Setup** | `setup.ts` | Orchestration entry point (runSetup) (247 L) | -| **OpenCode** | `opencode.ts` | CLI resolution & installation (168 L) | -| **Bun** | `bun.ts` | Bun runtime setup (required for oMo) (170 L) | -| **oMo** | `omo.ts` | oh-my-openagent install (graceful fail) (120 L) | -| **oMo Config** | `omo-config.ts` | Plugin configuration (97 L) | -| **GH Auth** | `gh-auth.ts` | gh CLI auth & Git user identity (101 L) | -| **Auth JSON** | `auth-json.ts` | Temporary auth.json generation (70 L) | -| **Project ID** | `project-id.ts` | Deterministic project ID generation (108 L) | -| **Cache** | `tools-cache.ts` | Low-level tool cache operations (137 L) | -| **Types** | `types.ts` | Setup-specific types & interfaces (150 L) | +| Component | File | Responsibility | +| -------------- | ---------------------- | ------------------------------------------------------- | +| **Setup** | `setup.ts` | Orchestration entry point (runSetup) (209 L) | +| **CI Config** | `ci-config.ts` | CI config assembly + Systematic plugin injection (43 L) | +| **Systematic** | `systematic-config.ts` | Systematic config writer (deep-merge) (36 L) | +| **Adapters** | `adapters.ts` | Exec/tool-cache adapter factories (20 L) | +| **OpenCode** | `opencode.ts` | CLI resolution & installation (169 L) | +| **Bun** | `bun.ts` | Bun runtime setup (required for oMo) (170 L) | +| **oMo** | `omo.ts` | oh-my-openagent install (graceful fail) (120 L) | +| **oMo Config** | `omo-config.ts` | Plugin configuration (97 L) | +| **GH Auth** | `gh-auth.ts` | gh CLI auth & Git user identity (101 L) | +| **Auth JSON** | `auth-json.ts` | Temporary auth.json generation (70 L) | +| **Project ID** | `project-id.ts` | Deterministic project ID generation (121 L) | +| **Cache** | `tools-cache.ts` | Low-level tool cache operations (142 L) | +| **Types** | `types.ts` | Setup-specific types & interfaces (152 L) | ## CODE MAP -| Symbol | Type | Location | Role | -| ------------------ | -------- | ------------------ | ----------------------------- | -| `runSetup` | Function | `setup.ts:124` | Main orchestration | -| `installOpenCode` | Function | `opencode.ts:87` | CLI install + cache | -| `installBun` | Function | `bun.ts:77` | Runtime setup | -| `installOmo` | Function | `omo.ts:56` | Plugin setup (graceful fail) | -| `configureGhAuth` | Function | `gh-auth.ts:7` | CLI authentication | -| `populateAuthJson` | Function | `auth-json.ts:41` | Secure credentials write | -| `ensureProjectId` | Function | `project-id.ts:35` | Deterministic ID for OpenCode | +| Symbol | Type | Location | Role | +| ----------------------- | -------- | ------------------------- | ----------------------------- | +| `runSetup` | Function | `setup.ts:22` | Main orchestration | +| `buildCIConfig` | Function | `ci-config.ts:8` | Build OPENCODE_CONFIG_CONTENT | +| `writeSystematicConfig` | Function | `systematic-config.ts:12` | Write merged systematic.json | +| `installOpenCode` | Function | `opencode.ts:87` | CLI install + cache | +| `installBun` | Function | `bun.ts:77` | Runtime setup | +| `installOmo` | Function | `omo.ts:56` | Plugin setup (graceful fail) | +| `configureGhAuth` | Function | `gh-auth.ts:7` | CLI authentication | +| `populateAuthJson` | Function | `auth-json.ts:41` | Secure credentials write | +| `ensureProjectId` | Function | `project-id.ts:35` | Deterministic ID for OpenCode | ## PATTERNS @@ -38,6 +43,7 @@ Environment bootstrap logic: Bun runtime, OpenCode CLI, and oMo plugin installat - **Graceful Fail**: Optional components (oMo, Bun) warn on error, don't crash. - **Dynamic Version**: Resolves 'latest' via GitHub Releases API. - **Verification**: Validates binaries (`--version`) BEFORE caching. +- **Systematic Bundling**: `buildCIConfig()` ensures `@fro.bot/systematic@` exists in OpenCode CI plugins. - `parseOmoProviders` moved to `src/harness/config/omo-providers.ts`. ## SECURITY diff --git a/src/services/setup/adapters.ts b/src/services/setup/adapters.ts new file mode 100644 index 00000000..6b1a5c80 --- /dev/null +++ b/src/services/setup/adapters.ts @@ -0,0 +1,20 @@ +import type {ExecAdapter, ToolCacheAdapter} from './types.js' +import * as exec from '@actions/exec' +import * as tc from '@actions/tool-cache' + +export function createToolCacheAdapter(): ToolCacheAdapter { + return { + find: tc.find, + downloadTool: tc.downloadTool, + extractTar: tc.extractTar, + extractZip: tc.extractZip, + cacheDir: tc.cacheDir, + } +} + +export function createExecAdapter(): ExecAdapter { + return { + exec: exec.exec, + getExecOutput: exec.getExecOutput, + } +} diff --git a/src/services/setup/ci-config.test.ts b/src/services/setup/ci-config.test.ts new file mode 100644 index 00000000..3351fabf --- /dev/null +++ b/src/services/setup/ci-config.test.ts @@ -0,0 +1,108 @@ +import type {Logger} from './types.js' +import {describe, expect, it} from 'vitest' +import {createMockLogger} from '../../shared/test-helpers.js' +import {buildCIConfig} from './ci-config.js' + +function createLogger(): Logger { + return createMockLogger() +} + +describe('buildCIConfig', () => { + it('returns autoupdate baseline with systematic plugin when no user config', () => { + // #given + const logger = createLogger() + + // #when + const result = buildCIConfig({opencodeConfig: null, systematicVersion: '2.1.0'}, logger) + + // #then + expect(result.error).toBeNull() + expect(result.config).toEqual({autoupdate: false, plugins: ['@fro.bot/systematic@2.1.0']}) + }) + + it('merges user config keys and appends systematic plugin', () => { + // #given + const logger = createLogger() + + // #when + const result = buildCIConfig( + {opencodeConfig: '{"model":"claude-opus-4-5","autoupdate":true}', systematicVersion: '2.1.0'}, + logger, + ) + + // #then + expect(result.error).toBeNull() + expect(result.config).toEqual({ + autoupdate: true, + model: 'claude-opus-4-5', + plugins: ['@fro.bot/systematic@2.1.0'], + }) + }) + + it('appends systematic plugin to existing plugins array', () => { + // #given + const logger = createLogger() + + // #when + const result = buildCIConfig( + {opencodeConfig: '{"plugins":["custom-plugin@1.0.0"]}', systematicVersion: '2.1.0'}, + logger, + ) + + // #then + expect(result.error).toBeNull() + expect(result.config).toEqual({ + autoupdate: false, + plugins: ['custom-plugin@1.0.0', '@fro.bot/systematic@2.1.0'], + }) + }) + + it('does not duplicate systematic plugin when already present', () => { + // #given + const logger = createLogger() + + // #when + const result = buildCIConfig( + { + opencodeConfig: '{"plugins":["custom-plugin@1.0.0","@fro.bot/systematic@9.9.9"]}', + systematicVersion: '2.1.0', + }, + logger, + ) + + // #then + expect(result.error).toBeNull() + expect(result.config).toEqual({ + autoupdate: false, + plugins: ['custom-plugin@1.0.0', '@fro.bot/systematic@9.9.9'], + }) + }) + + it('returns error for invalid JSON', () => { + // #given + const logger = createLogger() + + // #when + const result = buildCIConfig({opencodeConfig: '{invalid-json}', systematicVersion: '2.1.0'}, logger) + + // #then + expect(result.error).toBe('opencode-config must be valid JSON') + }) + + it('returns error for non-object JSON values', () => { + // #given + const logger = createLogger() + + // #when + const nullResult = buildCIConfig({opencodeConfig: 'null', systematicVersion: '2.1.0'}, logger) + const arrayResult = buildCIConfig({opencodeConfig: '[1,2,3]', systematicVersion: '2.1.0'}, logger) + const numberResult = buildCIConfig({opencodeConfig: '42', systematicVersion: '2.1.0'}, logger) + const stringResult = buildCIConfig({opencodeConfig: '"hello"', systematicVersion: '2.1.0'}, logger) + + // #then + expect(nullResult.error).toBe('opencode-config must be a JSON object') + expect(arrayResult.error).toBe('opencode-config must be a JSON object') + expect(numberResult.error).toBe('opencode-config must be a JSON object') + expect(stringResult.error).toBe('opencode-config must be a JSON object') + }) +}) diff --git a/src/services/setup/ci-config.ts b/src/services/setup/ci-config.ts new file mode 100644 index 00000000..a4f73f16 --- /dev/null +++ b/src/services/setup/ci-config.ts @@ -0,0 +1,43 @@ +import type {Logger, SetupInputs} from './types.js' + +export interface CIConfigResult { + readonly config: Record + readonly error: string | null +} + +export function buildCIConfig( + inputs: Pick, + logger: Logger, +): CIConfigResult { + const ciConfig: Record = {autoupdate: false} + + if (inputs.opencodeConfig != null) { + let parsed: unknown + try { + parsed = JSON.parse(inputs.opencodeConfig) + } catch { + return {config: ciConfig, error: 'opencode-config must be valid JSON'} + } + + if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed)) { + return {config: ciConfig, error: 'opencode-config must be a JSON object'} + } + Object.assign(ciConfig, parsed) + } + + const systematicPlugin = `@fro.bot/systematic@${inputs.systematicVersion}` + const rawPlugins: unknown[] = Array.isArray(ciConfig.plugins) ? (ciConfig.plugins as unknown[]) : [] + const hasSystematic = rawPlugins.some( + (plugin): plugin is string => typeof plugin === 'string' && plugin.startsWith('@fro.bot/systematic'), + ) + if (!hasSystematic) { + ciConfig.plugins = [...rawPlugins, systematicPlugin] + } + + logger.debug('Built CI OpenCode config', { + hasUserConfig: inputs.opencodeConfig != null, + pluginCount: Array.isArray(ciConfig.plugins) ? ciConfig.plugins.length : 0, + }) + + return {config: ciConfig, error: null} +} diff --git a/src/services/setup/index.ts b/src/services/setup/index.ts index 9a91d367..11c3700a 100644 --- a/src/services/setup/index.ts +++ b/src/services/setup/index.ts @@ -1,11 +1,15 @@ // Setup module public exports +export {createExecAdapter, createToolCacheAdapter} from './adapters.js' export {parseAuthJsonInput, populateAuthJson} from './auth-json.js' export {buildBunDownloadUrl, getBunPlatformInfo, installBun, isBunAvailable} from './bun.js' export type {BunInstallResult, BunPlatformInfo} from './bun.js' +export {buildCIConfig} from './ci-config.js' +export type {CIConfigResult} from './ci-config.js' export {configureGhAuth, configureGitIdentity, getBotUserId} from './gh-auth.js' export {installOmo, verifyOmoInstallation} from './omo.js' export type {OmoInstallDeps, OmoInstallOptions} from './omo.js' export {getLatestVersion, installOpenCode} from './opencode.js' +export {writeSystematicConfig} from './systematic-config.js' export {restoreToolsCache, saveToolsCache} from './tools-cache.js' export type {ToolsCacheAdapter, ToolsCacheResult} from './tools-cache.js' diff --git a/src/services/setup/setup.test.ts b/src/services/setup/setup.test.ts index 6b16c10a..179e584d 100644 --- a/src/services/setup/setup.test.ts +++ b/src/services/setup/setup.test.ts @@ -16,6 +16,7 @@ function createSetupInputs(overrides: Partial = {}): SetupInputs { appId: null, privateKey: null, opencodeConfig: null, + systematicConfig: null, omoConfig: null, omoVersion: '3.7.4', systematicVersion: '2.1.0', @@ -88,6 +89,20 @@ vi.mock('./tools-cache.js', () => ({ saveToolsCache: vi.fn(), })) +vi.mock('./adapters.js', () => ({ + createToolCacheAdapter: vi.fn(() => ({ + find: vi.mocked(tc.find), + downloadTool: vi.mocked(tc.downloadTool), + extractTar: vi.mocked(tc.extractTar), + extractZip: vi.mocked(tc.extractZip), + cacheDir: vi.mocked(tc.cacheDir), + })), + createExecAdapter: vi.fn(() => ({ + exec: vi.mocked(exec.exec), + getExecOutput: vi.mocked(exec.getExecOutput), + })), +})) + // Mock bun module vi.mock('./bun.js', () => ({ installBun: vi.fn().mockResolvedValue({path: '/cached/bun', version: '1.3.5', cached: true}), @@ -245,8 +260,8 @@ describe('setup', () => { expect(core.exportVariable).toHaveBeenCalledWith('GH_TOKEN', 'ghs_test_token') }) - it('exports OPENCODE_CONFIG_CONTENT with autoupdate:false baseline and Systematic plugin', async () => { - // #given - no opencode-config input + it('exports OPENCODE_CONFIG_CONTENT environment variable', async () => { + // #given vi.mocked(tc.find).mockReturnValue('/cached/opencode/1.0.300') vi.mocked(exec.getExecOutput).mockResolvedValue({exitCode: 0, stdout: '', stderr: ''}) vi.mocked(exec.exec).mockResolvedValue(0) @@ -258,60 +273,7 @@ describe('setup', () => { await runSetup(createSetupInputs(), 'ghs_test_token') // #then - expect(core.exportVariable).toHaveBeenCalledWith( - 'OPENCODE_CONFIG_CONTENT', - JSON.stringify({autoupdate: false, plugins: ['@fro.bot/systematic@2.1.0']}), - ) - }) - - it('merges user opencode-config input on top of OPENCODE_CONFIG_CONTENT baseline', async () => { - // #given - user supplies opencode-config with custom settings - vi.mocked(tc.find).mockReturnValue('/cached/opencode/1.0.300') - vi.mocked(exec.getExecOutput).mockResolvedValue({exitCode: 0, stdout: '', stderr: ''}) - vi.mocked(exec.exec).mockResolvedValue(0) - vi.mocked(fs.writeFile).mockResolvedValue() - vi.mocked(fs.mkdir).mockResolvedValue(undefined) - vi.mocked(fs.access).mockRejectedValue(new Error('not found')) - - // #when - await runSetup( - createSetupInputs({opencodeConfig: '{"model": "claude-opus-4-5", "autoupdate": true}'}), - 'ghs_test_token', - ) - - // #then - user config wins on conflicting keys; Systematic plugin appended - expect(core.exportVariable).toHaveBeenCalledWith( - 'OPENCODE_CONFIG_CONTENT', - JSON.stringify({autoupdate: true, model: 'claude-opus-4-5', plugins: ['@fro.bot/systematic@2.1.0']}), - ) - }) - - it('preserves user-provided Systematic plugin entry without appending a duplicate', async () => { - // #given - user already pins Systematic in opencode-config - vi.mocked(tc.find).mockReturnValue('/cached/opencode/1.0.300') - vi.mocked(exec.getExecOutput).mockResolvedValue({exitCode: 0, stdout: '', stderr: ''}) - vi.mocked(exec.exec).mockResolvedValue(0) - vi.mocked(fs.writeFile).mockResolvedValue() - vi.mocked(fs.mkdir).mockResolvedValue(undefined) - vi.mocked(fs.access).mockRejectedValue(new Error('not found')) - - // #when - await runSetup( - createSetupInputs({ - opencodeConfig: '{"plugins": ["custom-plugin@1.0.0", "@fro.bot/systematic@9.9.9"]}', - systematicVersion: '2.1.0', - }), - 'ghs_test_token', - ) - - // #then - existing Systematic entry wins and is not duplicated - expect(core.exportVariable).toHaveBeenCalledWith( - 'OPENCODE_CONFIG_CONTENT', - JSON.stringify({ - autoupdate: false, - plugins: ['custom-plugin@1.0.0', '@fro.bot/systematic@9.9.9'], - }), - ) + expect(core.exportVariable).toHaveBeenCalledWith('OPENCODE_CONFIG_CONTENT', expect.any(String)) }) it('fails when opencode-config parses to JSON null', async () => { @@ -348,27 +310,6 @@ describe('setup', () => { expect(core.setFailed).toHaveBeenCalledWith('opencode-config must be valid JSON') }) - it('treats whitespace-only opencode-config as not provided', async () => { - // #given - vi.mocked(tc.find).mockReturnValue('/cached/opencode/1.0.300') - vi.mocked(exec.getExecOutput).mockResolvedValue({exitCode: 0, stdout: '', stderr: ''}) - vi.mocked(exec.exec).mockResolvedValue(0) - vi.mocked(fs.writeFile).mockResolvedValue() - vi.mocked(fs.mkdir).mockResolvedValue(undefined) - vi.mocked(fs.access).mockRejectedValue(new Error('not found')) - - // #when - const result = await runSetup(createSetupInputs(), 'ghs_test_token') - - // #then - expect(result).not.toBeNull() - expect(core.setFailed).not.toHaveBeenCalled() - expect(core.exportVariable).toHaveBeenCalledWith( - 'OPENCODE_CONFIG_CONTENT', - JSON.stringify({autoupdate: false, plugins: ['@fro.bot/systematic@2.1.0']}), - ) - }) - it('fails when opencode-config is an array', async () => { // #given - user supplies array as opencode-config vi.mocked(tc.find).mockReturnValue('/cached/opencode/1.0.300') @@ -584,6 +525,7 @@ describe('setup', () => { expect(callArgs).toBeDefined() expect(callArgs?.toolCachePath).toContain('opencode') expect(callArgs?.omoConfigPath).toContain('opencode') + expect(callArgs?.systematicVersion).toBe('2.1.0') }) it('calls saveToolsCache after successful installs on cache miss', async () => { @@ -603,7 +545,7 @@ describe('setup', () => { // #given tools cache hit and tc.find returns a valid path vi.mocked(toolsCache.restoreToolsCache).mockResolvedValue({ hit: true, - restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5', + restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5-sys-2.1.0', }) vi.mocked(tc.find).mockReturnValue('/opt/hostedtoolcache/opencode/1.0.300/x64') @@ -621,7 +563,7 @@ describe('setup', () => { // #given tools cache hit but tc.find returns empty (version mismatch) vi.mocked(toolsCache.restoreToolsCache).mockResolvedValue({ hit: true, - restoredKey: 'opencode-tools-Linux-oc-1.0.299-omo-3.5.5', + restoredKey: 'opencode-tools-Linux-oc-1.0.299-omo-3.5.5-sys-2.1.0', }) vi.mocked(tc.find).mockReturnValue('') vi.mocked(tc.downloadTool).mockResolvedValue('/tmp/opencode.tar.gz') @@ -659,7 +601,7 @@ describe('setup', () => { // #given tools cache hit but tc.find returns empty vi.mocked(toolsCache.restoreToolsCache).mockResolvedValue({ hit: true, - restoredKey: 'opencode-tools-Linux-oc-1.0.299-omo-3.5.5', + restoredKey: 'opencode-tools-Linux-oc-1.0.299-omo-3.5.5-sys-2.1.0', }) vi.mocked(tc.find).mockReturnValue('') vi.mocked(tc.downloadTool).mockResolvedValue('/tmp/opencode.tar.gz') @@ -708,7 +650,7 @@ describe('setup', () => { // #given tools cache hit vi.mocked(toolsCache.restoreToolsCache).mockResolvedValue({ hit: true, - restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5', + restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5-sys-2.1.0', }) // #when @@ -722,7 +664,7 @@ describe('setup', () => { // #given tools cache hit vi.mocked(toolsCache.restoreToolsCache).mockResolvedValue({ hit: true, - restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5', + restoredKey: 'opencode-tools-Linux-oc-1.0.300-omo-3.5.5-sys-2.1.0', }) // #when @@ -803,6 +745,51 @@ describe('setup', () => { expect(core.setFailed).not.toHaveBeenCalled() expect(core.warning).toHaveBeenCalledWith(expect.stringContaining('omo-config')) }) + + it('writes systematic-config JSON to systematic.json before installer runs', async () => { + // #given + const systematicConfig = JSON.stringify({agents: {default: 'sisyphus'}, mode: 'strict'}) + + // #when + const result = await runSetup(createSetupInputs({systematicConfig}), 'ghs_test_token') + + // #then + expect(result).not.toBeNull() + const writeFileCalls = vi.mocked(fs.writeFile).mock.calls + const systematicConfigCall = writeFileCalls.find( + ([filePath]) => typeof filePath === 'string' && filePath.includes('systematic.json'), + ) + expect(systematicConfigCall).toBeDefined() + const written = JSON.parse(systematicConfigCall?.[1] as string) as Record + expect(written).toMatchObject({agents: {default: 'sisyphus'}, mode: 'strict'}) + }) + + it('does not write systematic.json when systematic-config is not provided', async () => { + // #given + + // #when + const result = await runSetup(createSetupInputs(), 'ghs_test_token') + + // #then + expect(result).not.toBeNull() + const writeFileCalls = vi.mocked(fs.writeFile).mock.calls + const systematicConfigCall = writeFileCalls.find( + ([filePath]) => typeof filePath === 'string' && filePath.includes('systematic.json'), + ) + expect(systematicConfigCall).toBeUndefined() + }) + + it('continues setup and warns when systematic-config JSON is invalid', async () => { + // #given + + // #when + const result = await runSetup(createSetupInputs({systematicConfig: '{invalid json}'}), 'ghs_test_token') + + // #then + expect(result).not.toBeNull() + expect(core.setFailed).not.toHaveBeenCalled() + expect(core.warning).toHaveBeenCalledWith(expect.stringContaining('systematic-config write failed')) + }) }) }) }) diff --git a/src/services/setup/setup.ts b/src/services/setup/setup.ts index 3916d34a..8c9e65e6 100644 --- a/src/services/setup/setup.ts +++ b/src/services/setup/setup.ts @@ -1,56 +1,24 @@ -import type {ExecAdapter, OpenCodeInstallResult, SetupInputs, SetupResult, ToolCacheAdapter} from './types.js' +import type {OpenCodeInstallResult, SetupInputs, SetupResult} from './types.js' import {homedir} from 'node:os' import {join} from 'node:path' import process from 'node:process' import * as core from '@actions/core' -import * as exec from '@actions/exec' import {getOctokit} from '@actions/github' -import * as tc from '@actions/tool-cache' import {DEFAULT_BUN_VERSION} from '../../shared/constants.js' import {getRunnerOS, getXdgDataHome} from '../../shared/env.js' import {toErrorMessage} from '../../shared/errors.js' import {createLogger} from '../../shared/logger.js' +import {createExecAdapter, createToolCacheAdapter} from './adapters.js' import {parseAuthJsonInput, populateAuthJson} from './auth-json.js' import {installBun} from './bun.js' +import {buildCIConfig} from './ci-config.js' import {configureGhAuth, configureGitIdentity} from './gh-auth.js' import {writeOmoConfig} from './omo-config.js' import {installOmo} from './omo.js' import {FALLBACK_VERSION, getLatestVersion, installOpenCode} from './opencode.js' +import {writeSystematicConfig} from './systematic-config.js' import {restoreToolsCache, saveToolsCache} from './tools-cache.js' -/** - * Create tool cache adapter from @actions/tool-cache - */ -function createToolCacheAdapter(): ToolCacheAdapter { - return { - find: tc.find, - downloadTool: tc.downloadTool, - extractTar: tc.extractTar, - extractZip: tc.extractZip, - cacheDir: tc.cacheDir, - } -} - -/** - * Create exec adapter from @actions/exec - */ -function createExecAdapter(): ExecAdapter { - return { - exec: exec.exec, - getExecOutput: exec.getExecOutput, - } -} - -/** - * Run the setup action. - * - * This function orchestrates: - * 1. Installing OpenCode CLI - * 2. Installing oMo plugin (graceful failure) - * 3. Configuring gh CLI authentication - * 4. Configuring git identity - * 5. Populating auth.json - */ export async function runSetup(inputs: SetupInputs, githubToken: string): Promise { const startTime = Date.now() const logger = createLogger({component: 'setup'}) @@ -83,6 +51,7 @@ export async function runSetup(inputs: SetupInputs, githubToken: string): Promis } const omoVersion = inputs.omoVersion + const systematicVersion = inputs.systematicVersion // Restore tools cache before installs const runnerToolCache = process.env.RUNNER_TOOL_CACHE ?? '/opt/hostedtoolcache' @@ -96,6 +65,7 @@ export async function runSetup(inputs: SetupInputs, githubToken: string): Promis os: runnerOS, opencodeVersion: version, omoVersion, + systematicVersion, toolCachePath, bunCachePath, omoConfigPath, @@ -154,6 +124,14 @@ export async function runSetup(inputs: SetupInputs, githubToken: string): Promis } } + if (inputs.systematicConfig != null) { + try { + await writeSystematicConfig(inputs.systematicConfig, omoConfigPath, logger) + } catch (error) { + logger.warning(`systematic-config write failed: ${toErrorMessage(error)}`) + } + } + const omoResult = await installOmo(omoVersion, {logger, execAdapter}, inputs.omoProviders) if (omoResult.installed) { logger.info('oMo installed', {version: omoResult.version}) @@ -166,39 +144,12 @@ export async function runSetup(inputs: SetupInputs, githubToken: string): Promis omoError = omoResult.error } - // Export CI-safe OpenCode config. OPENCODE_CONFIG_CONTENT has highest precedence over all - // other OpenCode config sources (project, global, etc.). User-supplied opencode-config input - // is merged on top of the baseline, so user values override the defaults. - const ciConfig: Record = {autoupdate: false} - - if (inputs.opencodeConfig != null) { - let parsed: unknown - try { - parsed = JSON.parse(inputs.opencodeConfig) - } catch { - core.setFailed('opencode-config must be valid JSON') - return null - } - - // Validate that the parsed result is a plain object (not null, array, or primitive) - if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed)) { - core.setFailed('opencode-config must be a JSON object') - return null - } - Object.assign(ciConfig, parsed) - } - - // Ensure the Systematic plugin is always registered in the plugins array. - // User-provided plugins via opencode-config are preserved; Systematic is appended - // only when no @fro.bot/systematic entry already exists (so user version pins win). - const systematicPlugin = `@fro.bot/systematic@${inputs.systematicVersion}` - const rawPlugins: unknown[] = Array.isArray(ciConfig.plugins) ? (ciConfig.plugins as unknown[]) : [] - const hasSystematic = rawPlugins.some((p: unknown) => typeof p === 'string' && p.startsWith('@fro.bot/systematic')) - if (!hasSystematic) { - ciConfig.plugins = [...rawPlugins, systematicPlugin] + const ciConfigResult = buildCIConfig({opencodeConfig: inputs.opencodeConfig, systematicVersion}, logger) + if (ciConfigResult.error != null) { + core.setFailed(ciConfigResult.error) + return null } - - core.exportVariable('OPENCODE_CONFIG_CONTENT', JSON.stringify(ciConfig)) + core.exportVariable('OPENCODE_CONFIG_CONTENT', JSON.stringify(ciConfigResult.config)) if (!toolsCacheResult.hit) { await saveToolsCache({ @@ -206,6 +157,7 @@ export async function runSetup(inputs: SetupInputs, githubToken: string): Promis os: runnerOS, opencodeVersion: version, omoVersion, + systematicVersion, toolCachePath, bunCachePath, omoConfigPath, diff --git a/src/services/setup/systematic-config.test.ts b/src/services/setup/systematic-config.test.ts new file mode 100644 index 00000000..feef147c --- /dev/null +++ b/src/services/setup/systematic-config.test.ts @@ -0,0 +1,106 @@ +import type {Logger} from './types.js' +import * as fs from 'node:fs/promises' +import * as os from 'node:os' +import * as path from 'node:path' +import {afterEach, beforeEach, describe, expect, it} from 'vitest' +import {createMockLogger} from '../../shared/test-helpers.js' +import {writeSystematicConfig} from './systematic-config.js' + +describe('writeSystematicConfig', () => { + let tmpDir: string + let logger: Logger + + beforeEach(async () => { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'systematic-config-test-')) + logger = createMockLogger() + }) + + afterEach(async () => { + await fs.rm(tmpDir, {recursive: true, force: true}) + }) + + it('creates config directory if it does not exist', async () => { + // #given + const configDir = path.join(tmpDir, 'nested', 'dir', 'opencode') + const configJson = JSON.stringify({mode: 'strict'}) + + // #when + await writeSystematicConfig(configJson, configDir, logger) + + // #then + const filePath = path.join(configDir, 'systematic.json') + const content = await fs.readFile(filePath, 'utf8') + expect(JSON.parse(content)).toEqual({mode: 'strict'}) + }) + + it('writes config to systematic.json in configDir', async () => { + // #given + const configJson = JSON.stringify({agents: {default: 'sisyphus'}, mode: 'strict'}) + + // #when + await writeSystematicConfig(configJson, tmpDir, logger) + + // #then + const filePath = path.join(tmpDir, 'systematic.json') + const content = await fs.readFile(filePath, 'utf8') + expect(JSON.parse(content)).toEqual({agents: {default: 'sisyphus'}, mode: 'strict'}) + }) + + it('deep-merges with existing config, user values win', async () => { + // #given + const existingConfig = {mode: 'permissive', agents: {default: 'oracle', fallback: 'hephaestus'}} + const filePath = path.join(tmpDir, 'systematic.json') + await fs.writeFile(filePath, JSON.stringify(existingConfig)) + const userConfig = JSON.stringify({mode: 'strict', agents: {default: 'sisyphus'}}) + + // #when + await writeSystematicConfig(userConfig, tmpDir, logger) + + // #then + const content = await fs.readFile(filePath, 'utf8') + expect(JSON.parse(content)).toEqual({ + mode: 'strict', + agents: {default: 'sisyphus', fallback: 'hephaestus'}, + }) + }) + + it('throws on invalid JSON input', async () => { + // #given + const invalidJson = '{invalid json}' + + // #when / #then + await expect(writeSystematicConfig(invalidJson, tmpDir, logger)).rejects.toThrow() + }) + + it('throws when input JSON is not an object', async () => { + // #given + const jsonNull = 'null' + const jsonArray = '[1,2,3]' + const jsonNumber = '42' + + // #when / #then + await expect(writeSystematicConfig(jsonNull, tmpDir, logger)).rejects.toThrow( + 'systematic-config must be a JSON object (non-null, non-array)', + ) + await expect(writeSystematicConfig(jsonArray, tmpDir, logger)).rejects.toThrow( + 'systematic-config must be a JSON object (non-null, non-array)', + ) + await expect(writeSystematicConfig(jsonNumber, tmpDir, logger)).rejects.toThrow( + 'systematic-config must be a JSON object (non-null, non-array)', + ) + }) + + it('overwrites existing file when existing config is invalid JSON', async () => { + // #given + const filePath = path.join(tmpDir, 'systematic.json') + await fs.writeFile(filePath, 'not valid json {{{') + const userConfig = JSON.stringify({mode: 'strict'}) + + // #when + await writeSystematicConfig(userConfig, tmpDir, logger) + + // #then + const content = await fs.readFile(filePath, 'utf8') + expect(JSON.parse(content)).toEqual({mode: 'strict'}) + }) +}) diff --git a/src/services/setup/systematic-config.ts b/src/services/setup/systematic-config.ts new file mode 100644 index 00000000..737b5fe8 --- /dev/null +++ b/src/services/setup/systematic-config.ts @@ -0,0 +1,36 @@ +import type {Logger} from './types.js' +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import {deepMerge} from './omo-config.js' + +const SYSTEMATIC_CONFIG_FILENAME = 'systematic.json' + +function isMergeableObject(value: unknown): value is Record { + return value != null && typeof value === 'object' && !Array.isArray(value) +} + +export async function writeSystematicConfig(configJson: string, configDir: string, logger: Logger): Promise { + const parsedUserConfig: unknown = JSON.parse(configJson) + if (!isMergeableObject(parsedUserConfig)) { + throw new Error('systematic-config must be a JSON object (non-null, non-array)') + } + + await fs.mkdir(configDir, {recursive: true}) + const filePath = path.join(configDir, SYSTEMATIC_CONFIG_FILENAME) + + let existingConfig: Record = {} + try { + const raw = await fs.readFile(filePath, 'utf8') + const parsed: unknown = JSON.parse(raw) + if (isMergeableObject(parsed)) { + existingConfig = parsed + } + } catch (error) { + logger.debug('Using empty base Systematic config', {path: filePath, error: String(error)}) + } + + const merged = deepMerge(existingConfig, parsedUserConfig) + await fs.writeFile(filePath, JSON.stringify(merged, null, 2)) + + logger.info('Wrote Systematic config', {path: filePath, keyCount: Object.keys(parsedUserConfig).length}) +} diff --git a/src/services/setup/tools-cache.test.ts b/src/services/setup/tools-cache.test.ts index d5ddda62..48c3e140 100644 --- a/src/services/setup/tools-cache.test.ts +++ b/src/services/setup/tools-cache.test.ts @@ -44,12 +44,13 @@ describe('buildToolsCacheKey', () => { const os = 'Linux' const opencodeVersion = '1.0.0' const omoVersion = '3.5.5' + const systematicVersion = '2.1.0' // #when building cache key - const key = buildToolsCacheKey({os, opencodeVersion, omoVersion}) + const key = buildToolsCacheKey({os, opencodeVersion, omoVersion, systematicVersion}) // #then key uses opencode-tools prefix - expect(key).toBe('opencode-tools-Linux-oc-1.0.0-omo-3.5.5') + expect(key).toBe('opencode-tools-Linux-oc-1.0.0-omo-3.5.5-sys-2.1.0') expect(key).toMatch(/^opencode-tools-/) }) @@ -58,12 +59,13 @@ describe('buildToolsCacheKey', () => { const os = 'Linux' const opencodeVersion = 'latest' const omoVersion = '3.5.5' + const systematicVersion = '2.1.0' // #when building cache key - const key = buildToolsCacheKey({os, opencodeVersion, omoVersion}) + const key = buildToolsCacheKey({os, opencodeVersion, omoVersion, systematicVersion}) // #then key includes latest - expect(key).toBe('opencode-tools-Linux-oc-latest-omo-3.5.5') + expect(key).toBe('opencode-tools-Linux-oc-latest-omo-3.5.5-sys-2.1.0') }) }) @@ -73,12 +75,13 @@ describe('buildToolsRestoreKeys', () => { const os = 'Linux' const opencodeVersion = '1.0.0' const omoVersion = '3.5.5' + const systematicVersion = '2.1.0' // #when building restore keys - const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion}) + const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion, systematicVersion}) // #then only version-specific prefix key is returned (no broad OS-only fallback) - expect(keys).toEqual(['opencode-tools-Linux-oc-1.0.0-omo-3.5.5-']) + expect(keys).toEqual(['opencode-tools-Linux-oc-1.0.0-omo-3.5.5-sys-2.1.0-']) }) it('does not include broad OS-only fallback key', () => { @@ -86,9 +89,10 @@ describe('buildToolsRestoreKeys', () => { const os = 'Linux' const opencodeVersion = '1.0.0' const omoVersion = '3.5.5' + const systematicVersion = '2.1.0' // #when building restore keys - const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion}) + const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion, systematicVersion}) // #then no OS-only key that could match stale versions const broadKeys = [...keys].filter(k => k === `opencode-tools-${os}-`) @@ -100,12 +104,13 @@ describe('buildToolsRestoreKeys', () => { const os = 'macOS' const opencodeVersion = '1.0.0' const omoVersion = '3.5.5' + const systematicVersion = '2.1.0' // #when building restore keys - const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion}) + const keys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion, systematicVersion}) // #then keys include macOS prefix - expect(keys[0]).toBe('opencode-tools-macOS-oc-1.0.0-omo-3.5.5-') + expect(keys[0]).toBe('opencode-tools-macOS-oc-1.0.0-omo-3.5.5-sys-2.1.0-') }) }) @@ -136,6 +141,7 @@ describe('restoreToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -149,7 +155,7 @@ describe('restoreToolsCache', () => { it('returns hit: true with key on cache hit', async () => { // #given a cache adapter that returns a key (hit) - const restoredKey = 'opencode-tools-Linux-oc-1.0.0-omo-3.5.5' + const restoredKey = 'opencode-tools-Linux-oc-1.0.0-omo-3.5.5-sys-2.1.0' const adapter = createMockToolsCacheAdapter({restoreResult: restoredKey}) // #when restoring cache @@ -158,6 +164,7 @@ describe('restoreToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -186,6 +193,7 @@ describe('restoreToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -211,6 +219,7 @@ describe('restoreToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -250,6 +259,7 @@ describe('saveToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -277,6 +287,7 @@ describe('saveToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -304,6 +315,7 @@ describe('saveToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -311,7 +323,7 @@ describe('saveToolsCache', () => { }) // #then uses correct key - expect(capturedKey).toBe('opencode-tools-Linux-oc-1.0.0-omo-3.5.5') + expect(capturedKey).toBe('opencode-tools-Linux-oc-1.0.0-omo-3.5.5-sys-2.1.0') }) it('handles cache already exists error', async () => { @@ -326,6 +338,7 @@ describe('saveToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, @@ -348,6 +361,7 @@ describe('saveToolsCache', () => { os: 'Linux', opencodeVersion: '1.0.0', omoVersion: '3.5.5', + systematicVersion: '2.1.0', toolCachePath, bunCachePath, omoConfigPath, diff --git a/src/services/setup/tools-cache.ts b/src/services/setup/tools-cache.ts index 621412c4..b2dcd3a2 100644 --- a/src/services/setup/tools-cache.ts +++ b/src/services/setup/tools-cache.ts @@ -7,6 +7,7 @@ export interface ToolsCacheKeyComponents { readonly os: string readonly opencodeVersion: string readonly omoVersion: string + readonly systematicVersion: string } export interface ToolsCacheAdapter { @@ -24,6 +25,7 @@ export interface RestoreToolsCacheOptions { readonly os: string readonly opencodeVersion: string readonly omoVersion: string + readonly systematicVersion: string readonly toolCachePath: string readonly bunCachePath: string readonly omoConfigPath: string @@ -35,6 +37,7 @@ export interface SaveToolsCacheOptions { readonly os: string readonly opencodeVersion: string readonly omoVersion: string + readonly systematicVersion: string readonly toolCachePath: string readonly bunCachePath: string readonly omoConfigPath: string @@ -47,14 +50,14 @@ export interface ToolsCacheResult { } export function buildToolsCacheKey(components: ToolsCacheKeyComponents): string { - const {os, opencodeVersion, omoVersion} = components - return `${TOOLS_CACHE_PREFIX}-${os}-oc-${opencodeVersion}-omo-${omoVersion}` + const {os, opencodeVersion, omoVersion, systematicVersion} = components + return `${TOOLS_CACHE_PREFIX}-${os}-oc-${opencodeVersion}-omo-${omoVersion}-sys-${systematicVersion}` } export function buildToolsRestoreKeys(components: ToolsCacheKeyComponents): readonly string[] { - const {os, opencodeVersion, omoVersion} = components + const {os, opencodeVersion, omoVersion, systematicVersion} = components - return [`${TOOLS_CACHE_PREFIX}-${os}-oc-${opencodeVersion}-omo-${omoVersion}-`] as const + return [`${TOOLS_CACHE_PREFIX}-${os}-oc-${opencodeVersion}-omo-${omoVersion}-sys-${systematicVersion}-`] as const } export async function restoreToolsCache(options: RestoreToolsCacheOptions): Promise { @@ -63,14 +66,15 @@ export async function restoreToolsCache(options: RestoreToolsCacheOptions): Prom os, opencodeVersion, omoVersion, + systematicVersion, toolCachePath, bunCachePath, omoConfigPath, cacheAdapter = defaultToolsCacheAdapter, } = options - const primaryKey = buildToolsCacheKey({os, opencodeVersion, omoVersion}) - const restoreKeys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion}) + const primaryKey = buildToolsCacheKey({os, opencodeVersion, omoVersion, systematicVersion}) + const restoreKeys = buildToolsRestoreKeys({os, opencodeVersion, omoVersion, systematicVersion}) const cachePaths = [toolCachePath, bunCachePath, omoConfigPath] logger.info('Restoring tools cache', {primaryKey, restoreKeys: [...restoreKeys], paths: cachePaths}) @@ -108,13 +112,14 @@ export async function saveToolsCache(options: SaveToolsCacheOptions): Promise