@visulima/vis 1.0.0-alpha.34 → 1.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/LICENSE.md +3244 -1611
- package/README.md +44 -0
- package/dashboard/dist/index.html +11 -11
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +74 -2
- package/dist/config/index.js +1 -1
- package/dist/generate/index.js +1 -1
- package/dist/packem_chunks/bin.js +584 -588
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/config.js +18 -16
- package/dist/packem_chunks/devtools.js +56 -57
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/fix.js +11 -11
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +5 -5
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +7 -7
- package/dist/packem_chunks/handler14.js +4 -4
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +3 -3
- package/dist/packem_chunks/handler20.js +5 -5
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -5
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -3
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -7
- package/dist/packem_chunks/handler3.js +4 -4
- package/dist/packem_chunks/handler30.js +6 -32
- package/dist/packem_chunks/handler31.js +33 -3
- package/dist/packem_chunks/handler32.js +3 -8
- package/dist/packem_chunks/handler33.js +8 -1
- package/dist/packem_chunks/handler34.js +4 -5
- package/dist/packem_chunks/handler35.js +1 -11
- package/dist/packem_chunks/handler36.js +5 -3
- package/dist/packem_chunks/handler37.js +11 -22
- package/dist/packem_chunks/handler38.js +3 -61
- package/dist/packem_chunks/handler39.js +22 -3
- package/dist/packem_chunks/handler4.js +6 -6
- package/dist/packem_chunks/handler40.js +61 -6
- package/dist/packem_chunks/handler41.js +3 -24
- package/dist/packem_chunks/handler42.js +6 -25
- package/dist/packem_chunks/handler43.js +24 -153
- package/dist/packem_chunks/handler44.js +25 -10
- package/dist/packem_chunks/handler45.js +152 -707
- package/dist/packem_chunks/handler46.js +10 -24
- package/dist/packem_chunks/handler47.js +24 -322
- package/dist/packem_chunks/handler48.js +322 -48
- package/dist/packem_chunks/handler49.js +708 -3
- package/dist/packem_chunks/handler5.js +7 -7
- package/dist/packem_chunks/handler50.js +48 -27
- package/dist/packem_chunks/handler51.js +21 -189
- package/dist/packem_chunks/handler52.js +3 -34
- package/dist/packem_chunks/handler53.js +200 -0
- package/dist/packem_chunks/handler54.js +38 -0
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +7 -7
- package/dist/packem_chunks/heal.js +11 -11
- package/dist/packem_chunks/help-command.js +30 -7
- package/dist/packem_chunks/index.js +6 -6
- package/dist/packem_chunks/keys-refresh.js +4 -4
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_shared/CONFIG_FILES-BfaR0jKT.js +1 -0
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
- package/dist/packem_shared/Table-CcVkyULl-B_ef6zfS.js +35 -0
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
- package/dist/packem_shared/advisories-DLeO5KMN.js +1 -0
- package/dist/packem_shared/affected-shas-cVnX8-zs.js +1 -0
- package/dist/packem_shared/ai-analysis-DT3bU-_M.js +68 -0
- package/dist/packem_shared/ai-fix-BkNqd5nP.js +43 -0
- package/dist/packem_shared/build-scripts-CCCi8U66.js +1 -0
- package/dist/packem_shared/cyclonedx-86-DbHtf.js +4 -0
- package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
- package/dist/packem_shared/dependency-scan-BDTH898x.js +1 -0
- package/dist/packem_shared/docker-tNrDU3oK.js +59 -0
- package/dist/packem_shared/failure-log-Dwqt6_Ga.js +2 -0
- package/dist/packem_shared/giget-DHY1sQZC.js +2 -0
- package/dist/packem_shared/glob-fqg4KepW-B7EjLRvw.js +1 -0
- package/dist/packem_shared/index-BDmTbWX1.js +19 -0
- package/dist/packem_shared/index-C0Vj3XF8.js +30 -0
- package/dist/packem_shared/index-CB4p298r.js +1 -0
- package/dist/packem_shared/index-DMefdF51.js +1 -0
- package/dist/packem_shared/license-t5KnNX6v.js +1 -0
- package/dist/packem_shared/lifecycle-4z9hHE5b.js +2 -0
- package/dist/packem_shared/lockfile-C8Q1_4KK.js +1 -0
- package/dist/packem_shared/manifests-Dj3pRKBT.js +1 -0
- package/dist/packem_shared/min-release-age-D1alDE3K.js +34 -0
- package/dist/packem_shared/missing-package-json-41VUWFBY.js +1 -0
- package/dist/packem_shared/native-config-sync-BKAZ0NIs.js +21 -0
- package/dist/packem_shared/osv-bloom-B03tUWf3.js +2 -0
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
- package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
- package/dist/packem_shared/pm-runner-pVihAfxV.js +1 -0
- package/dist/packem_shared/provenance-DMuEftgc.js +1 -0
- package/dist/packem_shared/registry-keys-Bf2zzlcZ.js +1 -0
- package/dist/packem_shared/resolve-explicit-jH0RKyMJ.js +5 -0
- package/dist/packem_shared/runtime-check-Stc9AI78.js +1 -0
- package/dist/packem_shared/s1ngularity-BkfgC6NO.js +1 -0
- package/dist/packem_shared/scan-progress-JBbd9QeT.js +2 -0
- package/dist/packem_shared/selectors-GCJIe342.js +3 -0
- package/dist/packem_shared/signatures-D1H6h6GH.js +2 -0
- package/dist/packem_shared/spinner-BXSl864p.js +1 -0
- package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
- package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
- package/dist/packem_shared/tabs-BqUepRaD.js +1 -0
- package/dist/packem_shared/toolchain-pR7AJ-tB.js +5 -0
- package/dist/packem_shared/typosquats-C8qg1neE.js +1 -0
- package/dist/packem_shared/use-measured-height-BBJ9intr.js +1 -0
- package/dist/packem_shared/utils-Cxree603.js +1 -0
- package/dist/packem_shared/verify-Du7xZ2BJ.js +1 -0
- package/dist/packem_shared/vis-update-app-CTwRkNgj.js +1 -0
- package/dist/packem_shared/watch-BvIwLG4N.js +1 -0
- package/dist/packem_shared/watch-loop-DWkvv2tK.js +11 -0
- package/index.d.ts +201 -201
- package/index.js +751 -567
- package/package.json +16 -16
- package/schemas/vis-config.schema.json +4 -0
- package/dist/packem_shared/Table-3pFgIUZ2-DABgc6rj.js +0 -12
- package/dist/packem_shared/_commonjsHelpers-CLblCigl.js +0 -1
- package/dist/packem_shared/advisories-CGKZo9Rx.js +0 -1
- package/dist/packem_shared/affected-shas-BdnlfiV1.js +0 -1
- package/dist/packem_shared/ai-analysis-3QD_RS6F.js +0 -68
- package/dist/packem_shared/ai-fix-TsjDQz_0.js +0 -43
- package/dist/packem_shared/applyDefaults-BogleaFi.js +0 -1
- package/dist/packem_shared/build-scripts-DE6U8jVq.js +0 -1
- package/dist/packem_shared/cyclonedx-zf9R2jCs.js +0 -4
- package/dist/packem_shared/definePlugin-CWm4Dv_t.js +0 -1
- package/dist/packem_shared/dependency-scan-B70azq4x.js +0 -1
- package/dist/packem_shared/docker-EJiTY0Sz.js +0 -60
- package/dist/packem_shared/failure-log-Dxafk3t4.js +0 -2
- package/dist/packem_shared/giget-CcEy_Elm.js +0 -2
- package/dist/packem_shared/glob-D_7bct6p-D8itOHsr.js +0 -1
- package/dist/packem_shared/index-BpbjpCNL.js +0 -1
- package/dist/packem_shared/index-DH-5hsrC.js +0 -1
- package/dist/packem_shared/index-di3jpyZS.js +0 -30
- package/dist/packem_shared/license-zZU7aavK.js +0 -1
- package/dist/packem_shared/lifecycle-DvVTL8nx.js +0 -2
- package/dist/packem_shared/lockfile-CedmXr44.js +0 -1
- package/dist/packem_shared/lockfile-Cu2BH6bl.js +0 -1
- package/dist/packem_shared/manifests-BzWpKW8F.js +0 -1
- package/dist/packem_shared/min-release-age-DKMW2N_v.js +0 -34
- package/dist/packem_shared/missing-package-json-DKAwoiWK.js +0 -1
- package/dist/packem_shared/native-config-sync-DBkJ-hsF.js +0 -21
- package/dist/packem_shared/osv-bloom-0Vu8YRhg.js +0 -2
- package/dist/packem_shared/otelPlugin-CJR2T_lk.js +0 -1
- package/dist/packem_shared/peer-warnings-EvSJ18gE.js +0 -1
- package/dist/packem_shared/pm-runner-DmKT2FqF.js +0 -1
- package/dist/packem_shared/provenance-Cu6VR1Hy.js +0 -1
- package/dist/packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js +0 -1
- package/dist/packem_shared/registry-keys-CuBAVdsk.js +0 -1
- package/dist/packem_shared/resolve-explicit-Xue0oq8V.js +0 -5
- package/dist/packem_shared/runtime-check-CilFOqUU.js +0 -1
- package/dist/packem_shared/s1ngularity-adnHbyTd.js +0 -1
- package/dist/packem_shared/scan-progress-lZdk5KJ-.js +0 -2
- package/dist/packem_shared/selectors-DkgYFzdq.js +0 -3
- package/dist/packem_shared/signatures-FGbYV5QE.js +0 -2
- package/dist/packem_shared/spinner-0acw5pd_.js +0 -1
- package/dist/packem_shared/spinners-f91Rbo99-Bjf3NcO0.js +0 -1
- package/dist/packem_shared/symbols-CQmER5MT.js +0 -1
- package/dist/packem_shared/tabs-zUSdR1HI.js +0 -1
- package/dist/packem_shared/toolchain-DoG6b_G_.js +0 -5
- package/dist/packem_shared/typosquats-acxQ7blw.js +0 -1
- package/dist/packem_shared/use-measured-height-DyCBfLtu.js +0 -1
- package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
- package/dist/packem_shared/verify-BYzxSKWD.js +0 -1
- package/dist/packem_shared/vis-update-app-D0QyGneK.js +0 -1
- package/dist/packem_shared/watch-DEL0yol9.js +0 -1
- package/dist/packem_shared/watch-loop-jmQQl2Qe.js +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function l(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var a=t.default;if(typeof a=="function"){var e=function o(){var r=!1;try{r=this instanceof o}catch{}return r?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};e.prototype=a.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:function(){return t[o]}})}),e}export{l as a,n as c,u as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as D}from"node:module";import{E as L}from"../packem_chunks/config.js";import{advisoriesQuery as M,NATIVE_BINDING_VERSION as f,advisoriesIngest as W,advisoriesStatus as E}from"#native";const R=D(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(s)}return R(s)},{randomUUID:I}=c("node:crypto"),{existsSync:$,createWriteStream:T}=c("node:fs"),{mkdir:O,unlink:P,stat:U}=c("node:fs/promises"),{join:g,dirname:k}=c("node:path"),{Readable:x}=c("node:stream"),{pipeline:C}=c("node:stream/promises"),w=5;if(f!==w)throw new Error(`vis native binding ABI mismatch in advisories: expected ${w}, got ${f}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const Q="https://osv-vulnerabilities.storage.googleapis.com",j=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class q extends Error{cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class A extends Error{cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const y=s=>{const e=L("vis",{create:!0,cwd:s})??g(s,"node_modules",".cache","vis");return g(e,"advisories","db.sqlite")},B=(s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...j,...e??[]]).has(t.host))throw new p(t.host);return t},J=async s=>{const e=s.dbPath??y(s.workspaceRoot);await O(k(e),{recursive:!0});const t=B(s.source,s.allowedHosts),d=new URL(`${s.ecosystem}/all.zip`,z(t.toString())),u=await V(e,s.ecosystem);let r=null;if(!s.force){const i=await b(d,{method:"HEAD"});if(i.ok&&(r=i.headers.get("etag"),r&&u&&r===u))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const n=`${e}.${s.ecosystem}.${process.pid}.${I()}.zip.tmp`,o=await b(d,{method:"GET"});if(!o.ok||!o.body)throw new A(d.toString(),o.status);r||(r=o.headers.get("etag"));const v=o.headers.get("content-length"),a=v?Number.parseInt(v,10):null;let m=0;const _=T(n),h=x.fromWeb(o.body);s.onProgress&&a&&h.on("data",i=>{m+=i.byteLength,s.onProgress?.(m,a,"download")}),await C(h,_);try{const i=await W({dbPath:e,ecosystem:s.ecosystem,manifestEtag:r??void 0,zipPath:n},(S,N)=>s.onProgress?.(S,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:e,durationMs:i.durationMs,upToDate:!1}}finally{await P(n).catch(()=>{})}},X=(s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??y(e.workspaceRoot),d=e.ecosystem??"npm";if(!$(t))throw new q(t);const u=s.map(o=>({ecosystem:d,name:o.name,version:o.version})),r=M(t,u),n=new Map;for(const[o,v]of s.entries()){const a=r[o];!a||a.vulnerabilities.length===0||n.set(v.name,a.vulnerabilities.map(m=>H(m)))}return n},Z=async(s,e)=>{const t=e??y(s);return E(t)},V=async(s,e)=>{try{await U(s)}catch{return null}return E(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},H=s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:F(s.severity),summary:s.summary}),F=s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},z=s=>s.endsWith("/")?s:`${s}/`,b=async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new A(s.toString(),t instanceof Error?t.message:String(t))}};export{q as A,Q as D,Z as g,X as q,y as r,J as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";import{f as g,v as h}from"./index-BDmTbWX1.js";const E=l(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,t]=_.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return _.getBuiltinModule(e)}return E(e)},{spawnSync:p}=d("node:child_process"),b="0000000000000000000000000000000000000000",A=e=>{if(g(e))try{const s=h(e);return JSON.parse(s)}catch{return}},I=(e,s)=>{const t=p("git",e,{cwd:s,encoding:"utf8"});if(!(t.error||typeof t.status!="number"||t.status!==0))return typeof t.stdout=="string"?t.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==b,f=(e,s,t)=>{const r=[],o=e.GITHUB_BASE_REF,i=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return r.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?t(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return r.push(`push: event.before=${u}`),{base:u,head:i,notes:r,provider:"github"}}return r.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:i,notes:r,provider:"github"}},R=(e,s)=>{const t=[],r=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return t.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:r,notes:t,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return t.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:r,notes:t,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return t.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:r,notes:t,provider:"gitlab"};const i=e.CI_DEFAULT_BRANCH??s;return t.push(`fallback: origin/${i}`),{base:`origin/${i}`,head:r,notes:t,provider:"gitlab"}},C=(e,s)=>{const t=[],r=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(t.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:r,notes:t,provider:"buildkite"}):(t.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:r,notes:t,provider:"buildkite"})},v=(e,s)=>{const t=[],r=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(t.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:r,notes:t,provider:"circleci"}):(t.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:r,notes:t,provider:"circleci"})},T=(e,s,t)=>{const r=[],o=s(["merge-base","HEAD",`origin/${e}`],t);return o&&o.length>0?(r.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:r,provider:"local"}):(r.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:r,provider:"local"})},$=e=>{const s=e?.env??process.env,t=e?.defaultBase??"main",r=e?.readEventPayload??A,o=e?.runGit??I,i=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?f(s,t,r):s.GITLAB_CI==="true"?R(s,t):s.BUILDKITE==="true"?C(s,t):s.CIRCLECI==="true"?v(s,t):T(t,o,i)};export{$ as r};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{createRequire as G}from"node:module";import{az as ee,aA as te,aB as re,h as ae,k as f,a5 as se,g as k,c as oe,aC as ne}from"../packem_chunks/bin.js";const K=G(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[a,t]=M.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return M.getBuiltinModule(e)}return K(e)},{spawn:Y,execFileSync:N,execFile:X}=A("node:child_process"),{existsSync:_}=A("node:fs"),{platform:Z,homedir:P}=A("node:os"),{join:h}=A("node:path"),{promisify:Q}=A("node:util"),ie=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,ue=5e3,ce=1e4,de=3e5,le=4096,T=Z()==="win32",q=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"];class w extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(a,t){super(a),this.name="AiRunError",this.provider=t.provider,this.exitCode=t.exitCode??null,this.durationMs=t.durationMs,this.stdout=t.stdout??"",this.stderr=t.stderr??"",this.timedOut=t.timedOut??!1,this.aborted=t.aborted??!1}}const pe={alternateCommands:[],buildArgs:(e,{dangerous:a})=>{const t=["-x",e];return a&&t.push("--dangerously-allow-all"),t},command:"amp",defaultModel:"",envVariable:"AMP_PATH",supportsMaxTokens:!1,supportsModel:!1},me={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[];return a&&r.push("--dangerously-skip-permissions"),t&&r.push("--model",t),r.push("--output-format","text","-p",e),r},command:"claude",defaultModel:"",envVariable:"CLAUDE_PATH",supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["exec"];return t&&r.push("--model",t),a&&r.push("--dangerously-bypass-approvals-and-sandbox"),r.push(e),r},command:"codex",defaultModel:"",envVariable:"CODEX_PATH",supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--allow-all-tools"),t&&r.push("--model",t),r},command:"copilot",defaultModel:"",envVariable:"COPILOT_PATH",supportsMaxTokens:!1,supportsModel:!0},fe={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=["run"];return a&&r.push("--yolo"),t&&r.push("-m",t),r.push(e),r},command:"crush",defaultModel:"",envVariable:"CRUSH_PATH",supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:["cursor"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p"];return a&&r.push("--force"),r.push("--output-format","text"),t&&r.push("--model",t),r.push(e),r},command:"agent",defaultModel:"",envVariable:"CURSOR_PATH",supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:[],buildArgs:(e,{dangerous:a,model:t})=>{const r=[e];return a&&r.push("--skip-permissions-unsafe"),r.push("-o","text"),t&&r.push("-m",t),r},command:"droid",defaultModel:"",envVariable:"DROID_PATH",supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:a,maxTokens:t,model:r})=>{const s=[];return a||s.push("--sandbox"),r&&s.push("--model",r),s.push("--max-output-tokens",String(t),"-p",e),s},command:"gemini",defaultModel:"gemini-2.5-pro",envVariable:"GEMINI_PATH",supportsMaxTokens:!0,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["--quiet","-p",e];return a&&t.push("-m",a),t},command:"kimi",defaultModel:"",envVariable:"KIMI_PATH",supportsMaxTokens:!1,supportsModel:!0},we={alternateCommands:[],buildArgs:(e,{model:a})=>{const t=["run",e];return a&&t.push("-m",a),t},command:"opencode",defaultModel:"",envVariable:"OPENCODE_PATH",supportsMaxTokens:!1,supportsModel:!0},Me={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:a,model:t})=>{const r=["-p",e];return a&&r.push("--yolo"),r.push("-o","text"),t&&r.push("-m",t),r},command:"qwen",defaultModel:"",envVariable:"QWEN_PATH",supportsMaxTokens:!1,supportsModel:!0};Q(X);const V={amp:pe,claude:me,codex:ge,copilot:he,crush:fe,cursor:ye,droid:ve,gemini:be,kimi:ke,opencode:we,qwen:Me},Ae=/\.(?:bat|cmd)$/i,D=e=>T&&Ae.test(e),L=e=>`"${e.replaceAll('"','""')}"`,O=e=>e==="~"||e.startsWith("~/")||T&&e.startsWith("~\\")?h(P(),e.slice(2)):e,Se=e=>{try{const a=N(T?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:ue}).trim().split(`
|
|
2
|
+
`)[0]?.trim();return a&&a.length>0?a:void 0}catch{return}},$e=e=>{const a=P();if(T){const t=process.env.APPDATA??"",r=process.env.LOCALAPPDATA??"",s=process.env.ProgramFiles??"";return[h(t,"npm",`${e}.cmd`),h(t,"npm",e),h(r,"Programs",e,`${e}.exe`),h(s,e,`${e}.exe`),h(a,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,h(a,".npm-global","bin",e),h(a,".local","bin",e),h(a,".cargo","bin",e)]},Te=e=>{try{const a=N(e,["--version"],{encoding:"utf8",shell:D(e),stdio:["pipe","pipe","pipe"],timeout:ce}),t=ie.exec(a);return t?t[1]:void 0}catch{return}},F=(e,a={})=>{const t=V[e],r={available:!1,name:e},s=a.version!==!1,o=i=>{if(s)return Te(i)},n=process.env[t.envVariable];if(n&&_(O(n))){const i=O(n);return{...r,available:!0,detectionMethod:"envvar",path:i,version:o(i)}}const c=[t.command,...t.alternateCommands];for(const i of c){const u=Se(i);if(u)return{...r,available:!0,detectionMethod:"which",path:u,version:o(u)}}for(const i of c)for(const u of $e(i))if(_(u))return{...r,available:!0,detectionMethod:"known-path",path:u,version:o(u)};return r},xe=(e={})=>q.map(a=>F(a,e)),Ce=(e={})=>xe(e).filter(a=>a.available),Ee=(e,a,t={})=>{const r=V[e],s=t.model??r.defaultModel,o=t.maxTokens!==void 0&&Number.isFinite(t.maxTokens)?t.maxTokens:le;return r.buildArgs(a,{dangerous:t.dangerous===!0,maxTokens:o,model:s})},Re=async(e,a,t={})=>{if(!e.available||!e.path)throw new w(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const r=Ee(e.name,a,t),s=t.timeoutMs!==void 0&&Number.isFinite(t.timeoutMs)?t.timeoutMs:de,o=e.path,n=D(o),c=Date.now();if(t.signal?.aborted)throw new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((i,u)=>{const m={cwd:t.cwd,env:{...process.env,...t.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:n,stdio:["pipe","pipe","pipe"]},l=n?r.map(d=>L(d)):r,g=Y(n?L(o):o,l,m);g.stdin?.end();let y="",v="",b=!1,E,R,S;const x=()=>{clearTimeout(R),clearTimeout(E),S&&t.signal?.removeEventListener("abort",S)},J=()=>{g.kill("SIGKILL")},I=d=>{if(b)return;b=!0,g.kill("SIGTERM"),E=setTimeout(J,5e3),x();const p=Date.now()-c,W=d?new w(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:p,provider:e.name,stderr:v,stdout:y}):new w(`${e.name} CLI timed out after ${String(s)}ms`,{durationMs:p,provider:e.name,stderr:v,stdout:y,timedOut:!0});u(W)};R=setTimeout(I,s,!1),S=()=>{I(!0)},t.signal?.addEventListener("abort",S,{once:!0}),g.stdout?.on("data",d=>{const p=d.toString("utf8");y+=p,t.onStdout?.(p)}),g.stderr?.on("data",d=>{const p=d.toString("utf8");v+=p,t.onStderr?.(p)}),g.on("close",d=>{if(b)return;b=!0,x();const p=Date.now()-c;d===0?i({durationMs:p,exitCode:d,provider:e.name,stderr:v,stdout:y}):u(new w(`${e.name} CLI exited with code ${String(d)}: ${v||y}`,{durationMs:p,exitCode:d,provider:e.name,stderr:v,stdout:y}))}),g.on("error",d=>{b||(b=!0,x(),u(new w(`Failed to spawn ${e.name} CLI: ${d.message}`,{durationMs:Date.now()-c,provider:e.name,stderr:v,stdout:y})))})})},Ie=12e4,_e=2,Le=1e3,Oe=e=>new Promise(a=>{setTimeout(a,e)}),H=async(e,a,t=_e)=>{let r;for(let s=0;s<=t;s+=1)try{return(await Re(e,a,{timeoutMs:Ie})).stdout}catch(o){if(r=o instanceof Error?o:new Error(String(o)),r.message.includes("timed out"))throw r;if(s<t){const n=Le*2**s;await Oe(n)}}throw r??new Error("AI request failed after retries")},je={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Ne=e=>{if(e?.provider){if(!q.includes(e.provider))return;const r=F(e.provider);return r.available?r:void 0}const a=Ce();if(a.length===0)return;const t={...je,...e?.priority};return a.toSorted((r,s)=>(t[s.name]??0)-(t[r.name]??0))[0]},Pe=new Set(["defer","review","skip","update"]),qe=new Set(["critical","high","low","medium"]),Ve=new Set(["high","low","medium"]),De=50,C=30,Fe=e=>e.map(a=>{const t=a.vulnerabilities&&a.vulnerabilities.length>0?` [VULNERABILITIES: ${a.vulnerabilities.map(s=>`${s.severity} ${s.id}`).join(", ")}]`:"";let r="";if(a.socketReport){const s=Math.round(a.socketReport.score.overall*100),o=[`score:${String(s)}%`];if(a.socketReport.alerts.length>0){const n={};for(const i of a.socketReport.alerts)n[i.severity]=(n[i.severity]??0)+1;const c=Object.entries(n).map(([i,u])=>`${String(u)} ${i}`).join(", ");o.push(`alerts: ${c}`)}o.push(`supply-chain:${String(Math.round(a.socketReport.score.supplyChain*100))}%`),o.push(`quality:${String(Math.round(a.socketReport.score.quality*100))}%`),r=` [SOCKET.DEV: ${o.join(", ")}]`}return`- ${a.packageName}: ${a.currentRange} → ${a.newRange} (${a.updateType})${t}${r}`}).join(`
|
|
3
|
+
`),$=`Respond ONLY with valid JSON in this exact structure:
|
|
4
|
+
{
|
|
5
|
+
"summary": "Brief overall summary",
|
|
6
|
+
"recommendations": [
|
|
7
|
+
{
|
|
8
|
+
"package": "package-name",
|
|
9
|
+
"action": "update|skip|review|defer",
|
|
10
|
+
"reason": "explanation",
|
|
11
|
+
"riskLevel": "low|medium|high|critical",
|
|
12
|
+
"breakingChanges": ["change1"],
|
|
13
|
+
"effort": "low|medium|high"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"warnings": ["warning1"]
|
|
17
|
+
}`,He={compatibility:e=>`Analyze the compatibility of these package updates:
|
|
18
|
+
|
|
19
|
+
${e}
|
|
20
|
+
|
|
21
|
+
For each package:
|
|
22
|
+
1. Check peer dependency compatibility
|
|
23
|
+
2. Identify potential conflicts with other packages in the list
|
|
24
|
+
3. Assess API compatibility between current and target versions
|
|
25
|
+
4. Check for deprecated features being removed
|
|
26
|
+
5. Evaluate Node.js version requirements
|
|
27
|
+
|
|
28
|
+
${$}`,impact:e=>`Analyze the impact of updating these npm packages:
|
|
29
|
+
|
|
30
|
+
${e}
|
|
31
|
+
|
|
32
|
+
For each package, provide:
|
|
33
|
+
1. Risk level (low/medium/high/critical)
|
|
34
|
+
2. Recommended action (update/skip/review/defer)
|
|
35
|
+
3. Reason for recommendation
|
|
36
|
+
4. Known breaking changes (if any)
|
|
37
|
+
5. Estimated migration effort (low/medium/high)
|
|
38
|
+
|
|
39
|
+
${$}`,recommend:e=>`Provide smart recommendations for updating these packages:
|
|
40
|
+
|
|
41
|
+
${e}
|
|
42
|
+
|
|
43
|
+
Consider:
|
|
44
|
+
1. Update priority based on security, features, and stability
|
|
45
|
+
2. Grouping related packages for atomic updates
|
|
46
|
+
3. Best practices for the specific package ecosystem
|
|
47
|
+
4. Risk vs. benefit analysis
|
|
48
|
+
5. Suggested update order
|
|
49
|
+
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
50
|
+
|
|
51
|
+
${$}`,security:e=>`Analyze the security implications of these package updates:
|
|
52
|
+
|
|
53
|
+
${e}
|
|
54
|
+
|
|
55
|
+
For each package:
|
|
56
|
+
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
57
|
+
2. Assess if the new version introduces security risks
|
|
58
|
+
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
59
|
+
4. Recommend urgency of the update based on vulnerability severity
|
|
60
|
+
5. Flag any packages where skipping the update poses security risk
|
|
61
|
+
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
|
+
|
|
63
|
+
${$}`},Be=new Set(["compatibility","impact","recommend","security"]),et=e=>Be.has(e)?e:"impact",B=(e,a="impact")=>{const t=Fe(e);return He[a](t)},Ue=/```(?:json)?\s*([\s\S]*?)```/,ze=/\{[\s\S]*\}/,Je=e=>{try{return JSON.parse(e)}catch{}const a=Ue.exec(e);if(a?.[1])try{return JSON.parse(a[1])}catch{}const t=ze.exec(e);if(t?.[0])try{return JSON.parse(t[0])}catch{}},We=e=>({action:Pe.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Ve.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:qe.has(e.riskLevel)?e.riskLevel:"medium"}),U=(e,a,t)=>{const r=Je(e);if(!r||typeof r!="object")return{analysisType:t,provider:a,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const s=r,o=Array.isArray(s.recommendations)?s.recommendations:[];return{analysisType:t,provider:a,recommendations:o.map(n=>We(n)),summary:typeof s.summary=="string"?s.summary:"",warnings:Array.isArray(s.warnings)?s.warnings:[]}},Ge={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ke=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),j=(e,a)=>{const t=e.map(r=>{const s=r.vulnerabilities&&r.vulnerabilities.length>0,o=Ke.has(r.packageName),n=Ge[r.packageName]??[];let c="low",i="update",u="low",m="Patch/minor update, safe to apply.";return r.updateType==="major"?(c="high",i=n.length>0?"review":"update",u="medium",m=n.length>0?`Major update with known breaking changes: ${n[0]}`:"Major version update, review changelog before applying."):r.updateType==="minor"&&(c="medium",m="Minor update, generally safe."),s&&(c="high",i="update",m="Security update — current version has known vulnerabilities."),o&&r.updateType==="major"&&(i="review",m="Security-sensitive package with major update, careful review needed.",u="high"),{action:i,breakingChanges:n,effort:u,package:r.packageName,reason:m,riskLevel:c}});return{analysisType:a,provider:"rule-engine",recommendations:t,summary:`Rule-based ${a} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},Ye=async(e,a,t)=>{const r=B(a,t),s=await H(e,r);return U(s,e.name,t)},Xe=(e,a,t)=>{const r=[],s=[],o=[];for(const n of e)r.push(...n.recommendations),s.push(...n.warnings),n.summary&&o.push(n.summary);return{analysisType:t,provider:a,recommendations:r,summary:o.length===1?o[0]??"":`Analyzed ${String(r.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(s)]}},z={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},tt=e=>{const a=`${z[e.analysisType]??e.analysisType} Analysis (${e.provider})`,t=e.recommendations.flatMap(s=>{const o=[{action:s.action,effort:s.effort,package:s.package,reason:s.reason,risk:s.riskLevel}];return s.breakingChanges.length>0&&o.push({action:"",effort:"",package:"",reason:`Breaking: ${s.breakingChanges.join("; ")}`,risk:""}),o}),r=process.stdout.columns||80;return ae(f.createElement(se,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},f.createElement(k,{bold:!0},a),f.createElement(k,null,""),f.createElement(k,null,e.summary),f.createElement(k,null,""),f.createElement(oe,{borderStyle:"none",data:t}),...e.warnings.length>0?[f.createElement(k,null,""),...e.warnings.map((s,o)=>f.createElement(k,{dimColor:!0,key:String(o)},` ${s}`))]:[]),{columns:r})},rt=async(e,a,t,r="impact")=>{const s=Ne(t);if(!s)return a.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
|
+
`),j(e,r);const o=ee(s.name,r,e),n=te(o);if(n)return a.info(`Using cached ${r} analysis from ${n.provider}.
|
|
65
|
+
`),n;const c=z[r]??r;a.info(`Running ${c.toLowerCase()} analysis with ${s.name}...
|
|
66
|
+
`);try{let i;if(e.length>De){a.info(`Splitting ${String(e.length)} packages into batches of ${String(C)}...
|
|
67
|
+
`);const u=[];for(let l=0;l<e.length;l+=C)u.push(e.slice(l,l+C));const m=[];for(let l=0;l<u.length;l+=1){a.info(` Batch ${String(l+1)}/${String(u.length)}...`);const g=u[l];g&&m.push(await Ye(s,g,r))}i=Xe(m,s.name,r)}else{const u=await H(s,B(e,r));i=U(u,s.name,r)}return re(o,i,ne(r,t?.cacheTtl)),i}catch(i){const u=i instanceof Error?i.message:String(i);return a.warn(`AI analysis failed (${u}), falling back to rule engine.
|
|
68
|
+
`),j(e,r)}};export{et as K,xe as N,Ne as R,je as S,tt as W,rt as Z,Je as b,Re as h,H as r};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{createRequire as b}from"node:module";import{readLastRunSummary as O}from"@visulima/task-runner";import{a as T}from"./failure-log-Dwqt6_Ga.js";import{a8 as w,a9 as j,aa as k,z as C,A as D,ab as P,ac as F,ad as N}from"../packem_chunks/bin.js";import{A as y,B as v,m as R,y as B}from"./index-BDmTbWX1.js";import{R as E,r as M,b as q}from"./ai-analysis-DT3bU-_M.js";const $=b(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,a]=d.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return d.getBuiltinModule(t)}return $(t)},{readFile:_,writeFile:A}=I("node:fs/promises"),H=32*1024,W=(t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
|
+
${a}`},L=async(t,e)=>e===void 0?O(t,{dataDirectory:C(t)}):D(t,e),ut=async(t,e,a={})=>{const o=a.terminalOutputLimit??H,[s,n]=await Promise.all([T(t,e),L(t,a.runId)]),i=n?w(n,e):void 0;if(!s&&!i)return;let r,c;if(n&&i){const h=await j(t,n.id),p=h?w(h,e):void 0;r=k(i.hashDetails,p?.hashDetails),c=h?.id}const u=s?.terminalOutput??"";return{command:s?.command??void 0,cwd:s?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:s?.exitCode??i?.exitCode,hash:i?.hash??s?.hash,hashDetails:i?.hashDetails,hashDiff:r,previousRunId:c,project:i?.target.project,runId:n?.id??s?.runId,status:s?.status??(i?Y(i):void 0),target:i?.target.target,taskId:e,terminalOutput:W(u,o),terminalOutputCaptured:!!s,timestamp:s?.timestamp??i?.endTime??i?.startTime}},Y=t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},J=3600*1e3,x=80,K=new Set(["high","low","medium"]),U=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
|
+
|
|
4
|
+
You will be given:
|
|
5
|
+
- The terminal output (stdout/stderr) from the failed task.
|
|
6
|
+
- Optional metadata: command, working directory, project, task hash, and a diff describing what changed in the task's hash inputs since the previous run that did not fail.
|
|
7
|
+
|
|
8
|
+
Your job:
|
|
9
|
+
1. Identify the root cause from the terminal output.
|
|
10
|
+
2. Propose a minimal set of source-file patches that fix the cause.
|
|
11
|
+
3. If you cannot determine a safe fix, set "cannotFix" with a clear, actionable explanation.
|
|
12
|
+
|
|
13
|
+
Constraints:
|
|
14
|
+
- Patches MUST be exact string replacements. The "oldString" must appear verbatim in the named file. Paths are relative to the working directory.
|
|
15
|
+
- Each "oldString" must be unique within its file. Include surrounding context so the match is unambiguous.
|
|
16
|
+
- Do NOT include unrelated cleanup, formatting changes, or speculative refactors.
|
|
17
|
+
- If the failure is environmental (missing tool, network) or requires running commands, prefer "cannotFix" over a guess.
|
|
18
|
+
- Keep "explanation" short (1-3 sentences). Reserve "reason" on each patch for why that specific edit fixes the cause.
|
|
19
|
+
|
|
20
|
+
Respond ONLY with valid JSON in this exact structure:
|
|
21
|
+
{
|
|
22
|
+
"explanation": "Brief root-cause analysis and what the fix does.",
|
|
23
|
+
"confidence": "low|medium|high",
|
|
24
|
+
"patches": [
|
|
25
|
+
{
|
|
26
|
+
"file": "path/relative/to/cwd.ts",
|
|
27
|
+
"oldString": "exact text to find",
|
|
28
|
+
"newString": "exact replacement text",
|
|
29
|
+
"reason": "why this change fixes it"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"cannotFix": "optional — set when no safe patch can be proposed"
|
|
33
|
+
}`,f=(t,e)=>{const a=[];if(e.added.length>0&&a.push(` added: ${e.added.join(", ")}`),e.changed.length>0&&a.push(` changed: ${e.changed.join(", ")}`),e.removed.length>0&&a.push(` removed: ${e.removed.join(", ")}`),a.length!==0)return`- ${t}:
|
|
34
|
+
${a.join(`
|
|
35
|
+
`)}`},z=t=>{if(!t.hashDiff)return"No hash-diff available — there is no previous run to compare against.";const e=[];t.hashDiff.commandChanged&&e.push("- command line changed since previous run");const a=f("file inputs",t.hashDiff.nodes),o=f("implicit deps",t.hashDiff.implicitDeps),s=f("runtime/env",t.hashDiff.runtime);return a&&e.push(a),o&&e.push(o),s&&e.push(s),e.length===0?"No detectable changes between this run and the previous run.":e.join(`
|
|
36
|
+
`)},G=t=>{const e=[`Task: ${t.taskId}`];return t.project&&e.push(`Project: ${t.project}`),t.target&&e.push(`Target: ${t.target}`),t.command&&e.push(`Command: ${t.command}`),t.cwd&&e.push(`CWD: ${t.cwd}`),t.exitCode!==void 0&&e.push(`Exit code: ${String(t.exitCode)}`),t.hash&&e.push(`Task hash: ${t.hash}`),e.push("","Hash-diff since previous run:",z(t),""),t.terminalOutputCaptured?e.push("Terminal output:","```",t.terminalOutput,"```"):e.push("Terminal output: <no failure log was captured for this task>",'Set "cannotFix" and tell the user to re-run with `vis run` so logs can be captured.'),e.join(`
|
|
37
|
+
`)},V=t=>`${U()}
|
|
38
|
+
|
|
39
|
+
${G(t)}`,Q=(t,e)=>{const a=Array.isArray(t.patches)?t.patches:[],o=[];for(const n of a)typeof n.file!="string"||n.file.length===0||typeof n.oldString!="string"||n.oldString.length===0||typeof n.newString=="string"&&o.push({file:n.file,newString:n.newString,oldString:n.oldString,reason:typeof n.reason=="string"&&n.reason.length>0?n.reason:void 0});const s=typeof t.cannotFix=="string"&&t.cannotFix.length>0?t.cannotFix:void 0;return{cannotFix:s,confidence:K.has(t.confidence)?t.confidence:"low",explanation:typeof t.explanation=="string"?t.explanation:"",patches:s?[]:o,provider:e}},X=(t,e)=>{const a=q(t);return!a||typeof a!="object"?{cannotFix:"AI response was not valid JSON.",confidence:"low",explanation:"Failed to parse AI response.",patches:[],provider:e}:Q(a,e)},Z=(t,e)=>N({cwd:e.cwd??null,flow:"ai-fix",hash:e.hash??null,provider:t,taskId:e.taskId,terminalOutput:e.terminalOutput,terminalOutputCaptured:e.terminalOutputCaptured}),ht=async(t,e,a={})=>{const o=E(a.config);if(!o){e.warn(`No AI provider available — install one of: claude, gemini, copilot, codex.
|
|
40
|
+
`);return}const s=a.cache!==!1,n=Z(o.name,t);if(s){const i=P(n);if(i)return e.info(`Using cached fix proposal from ${i.provider}.
|
|
41
|
+
`),i}e.info(`Generating fix proposal with ${o.name}...
|
|
42
|
+
`);try{const i=await M(o,V(t)),r=X(i,o.name);return s&&r.patches.length>0&&!r.cannotFix&&F(n,r,J),r}catch(i){const r=i instanceof Error?i.message:String(i);e.warn(`AI fix proposal failed (${r}).
|
|
43
|
+
`);return}},tt=(t,e,a)=>y(a)?v(a):v(R(e??t,a)),et=(t,e)=>{const a=B(t,e);return a===""?!0:!a.startsWith("..")&&!y(a)},at=(t,e,a)=>{const o=t.indexOf(e),s=Math.max(0,o-x),n=Math.min(t.length,o+e.length+x),i=t.slice(s,n);return{previewAfter:`${t.slice(s,o)}${a}${t.slice(o+e.length,n)}`,previewBefore:i}},dt=async(t,e,a,o={})=>{const s=o.dryRun===!0,n=new Map,i=[];for(const r of a.patches){const c=tt(t,e,r.file);if(!et(t,c)){i.push({absolutePath:c,patch:r,status:"outside-workspace"});continue}let u=n.get(c);if(u===void 0){try{u=await _(c,"utf8")}catch(l){const g=l.code;i.push({absolutePath:c,error:g==="ENOENT"?void 0:l.message,patch:r,status:g==="ENOENT"?"missing-file":"error"});continue}n.set(c,u)}const h=u.indexOf(r.oldString);if(h===-1){i.push({absolutePath:c,patch:r,status:"no-match"});continue}if(u.indexOf(r.oldString,h+r.oldString.length)!==-1){i.push({absolutePath:c,patch:r,status:"ambiguous-match"});continue}const{previewAfter:p,previewBefore:S}=at(u,r.oldString,r.newString),m=`${u.slice(0,h)}${r.newString}${u.slice(h+r.oldString.length)}`;if(!s)try{await A(c,m,"utf8")}catch(l){n.delete(c),i.push({absolutePath:c,error:l.message,patch:r,status:"error"});continue}n.set(c,m),i.push({absolutePath:c,patch:r,previewAfter:p,previewBefore:S,status:"applied"})}return i};export{ut as a,dt as b,tt as c,ht as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-BDmTbWX1.js";import{a as q}from"../packem_chunks/config.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-BDmTbWX1.js";import{r as le}from"./docker-tNrDU3oK.js";import{a as oe}from"../packem_chunks/config.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"../packem_chunks/bin.js";import{u as he}from"./pm-runner-pVihAfxV.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"<",">":">","&":"&",'"':"""},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
|
|
2
|
+
`:"";let b="";switch(W){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(j=>U({_name:f,_content:j},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),w=Y(g),O=je(g),v=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const H=w==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?H&&o:H&&c,i=a?"/":"",l=$e(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!v?`
|
|
3
|
+
${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const w={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(Y(e[u])===m.OBJECT&&(ee.forEach(v=>{const x=e[u][v];typeof x<"u"&&(O[v]=x,delete e[u][v])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const v=Object.assign({},e[u]);delete v._content,O._content=[...Oe(v),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,w)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,G,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Te=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},Se=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=me(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},we=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},xe=(e,n,t)=>{if(!(!Te(n)||!Se(t)))return Ae(e,n,t)??we(e,n,t)},De={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Ne={sha256:64,sha384:96,sha512:128},Re=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Ne[t.algorithm]&&(n.hash={alg:De[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ce=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ee=e=>{for(const{file:n,type:t}of Ce){let s;try{s=ue(E(e,n))}catch{continue}const r=new Map;for(const p of de(s,t))r.set(`${p.name}@${p.version}`,Re(p));return{packages:r,type:t}}},Me=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Me(n);if(r!==n&&s.has(r))return r;const p=[...s];return he.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Be="1.7",Le="CycloneDX",Ie="http://cyclonedx.org/schema/bom-1.7.schema.json",Ue="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Fe=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Je=e=>{if(e)return typeof e=="string"?e:e.url},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=Je(e.repository);t&&n.push({type:"vcs",url:t});const s=qe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},Xe=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Fe(n.author);t&&(e.author=t);const s=fe(n);s&&(e.licenses=s);const r=Pe(n);r&&(e.externalReferences=r)},nn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...le(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:Xe(o.projectType),version:i};K(d,a),B.push(d)}const G=Ee(y),D=new Map,k=new Map;if(G)for(const c of G.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const W=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,j]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const A=V(S,j,k);A&&(i.add(C(S,A)),d.push(`${S}@${A}`))}};for(const d of a)l(W,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const j of S)if(j)for(const[A,I]of Object.entries(j))for(const q of I){const z=V(A,q,k);z&&(T.add(C(A,z)),a.push(`${A}@${z}`))}if(d.optionalDependencies)for(const[j,A]of Object.entries(d.optionalDependencies))for(const I of A){const q=V(j,I,k);q&&(T.add(C(j,q)),L.push(`${j}@${q}`))}T.size>0&&b.set(i,T)}};f(W,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,xe(y,o.name,o.version)),u.push(i)}const w=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();w.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];w.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}w.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),v=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=v["bom-ref"],H=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ie,bomFormat:Le,components:[...H,...u],dependencies:w,metadata:{component:v,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ue,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${pe()}`,specVersion:Be,version:1}},tn=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
|
+
`},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{nn as b,tn as s,C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=e=>e;export{n as definePlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as u,m as l,f as g}from"./index-BDmTbWX1.js";import{D as d,l as D,s as v}from"../packem_chunks/bin.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},O=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},$=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},A=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,A as a,$ as f,O as l,m as r};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import{createRequire as Qo}from"node:module";import{m as Ie,f as ia,y as oa,H as jn,T as fi,a as aa}from"./index-BDmTbWX1.js";import{by as sa,bz as ua}from"../packem_chunks/bin.js";import{a as ro}from"../packem_chunks/config.js";const ea=Qo(import.meta.url),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ta=l=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[d,A]=zt.versions.node.split(".").map(Number);if(d>22||d===22&&A>=3||d===20&&A>=16)return zt.getBuiltinModule(l)}return ea(l)},{rmSync:_n,existsSync:eo,readFileSync:li,cpSync:to,lstatSync:ra,readdirSync:na}=ta("node:fs");class et extends Error{constructor(d){super(d),this.name="LockfilePruneError"}}const no=l=>{let d=l.startsWith("/")?l.slice(1):l;const A=d.indexOf("(");return A!==-1&&(d=d.slice(0,A)),d},ca=(l,d)=>{if(!(d.startsWith("link:")||d.startsWith("file:")||d.startsWith("workspace:")))return`${l}@${d}`},la=l=>{const d=[];for(const A of[l.dependencies,l.devDependencies,l.optionalDependencies])if(A)for(const[o,h]of Object.entries(A))h?.version&&d.push({name:o,version:h.version});return d},pi=l=>{const d=[];for(const A of[l.dependencies,l.optionalDependencies])if(A)for(const[o,h]of Object.entries(A))typeof h=="string"&&d.push({name:o,version:h});return d},hi=l=>{const d=new Map;if(!l)return d;for(const A of Object.keys(l)){const o=no(A),h=d.get(o);h?h.push(A):d.set(o,[A])}return d},io=l=>{const d=l.displayName??"pnpm-lock.yaml",A=typeof l.lockfileContent=="string"?l.lockfileContent:l.lockfileContent.toString("utf8");let o;try{o=sa(A)}catch(Z){throw new et(`${d}: parse failed — ${Z.message}`)}const h=Z=>Z.packages?Object.keys(Z.packages).length:0;let e;for(const Z of o){const[te]=Z.errors;if(te)throw new et(`${d}: parse failed — ${te.message}`);const q=Z.toJS();if(!q||typeof q!="object")continue;const ue=q;(e===void 0||h(ue)>h(e))&&(e=ue)}if(e===void 0)throw new et(`${d}: top-level value is not an object`);const g=e.importers??{},C=hi(e.packages),m=hi(e.snapshots),S=new Set(["."]);for(const Z of l.closure)S.add(Z.relativeRoot===""?".":Z.relativeRoot);const E={};for(const[Z,te]of Object.entries(g))S.has(Z)&&(E[Z]=te);const Y=new Set,y=new Set,b=[];for(const Z of Object.values(E))for(const te of la(Z))b.push(te);for(;b.length>0;){const{name:Z,version:te}=b.shift(),q=ca(Z,te);if(!q)continue;const ue=no(q),Ce=m.get(ue)??m.get(q)??[];for(const Ae of Ce){if(y.has(Ae))continue;y.add(Ae);const Ee=e.snapshots?.[Ae];if(Ee)for(const Oe of pi(Ee))b.push(Oe)}const ge=C.get(ue)??C.get(q)??[];for(const Ae of ge){if(Y.has(Ae))continue;Y.add(Ae);const Ee=e.packages?.[Ae];if(Ee&&!e.snapshots)for(const Oe of pi(Ee))b.push(Oe)}}const v={lockfileVersion:e.lockfileVersion};for(const Z of["settings","overrides","patchedDependencies","catalogs"])e[Z]!==void 0&&(v[Z]=e[Z]);if(v.importers=E,e.packages){const Z={};for(const te of Object.keys(e.packages))Y.has(te)&&(Z[te]=e.packages[te]);v.packages=Z}if(e.snapshots){const Z={};for(const te of Object.keys(e.snapshots))y.has(te)&&(Z[te]=e.snapshots[te]);v.snapshots=Z}const M=Object.keys(e.packages??{}).length,re=Object.keys(v.packages??{}).length,ae=M-re,x=Object.keys(g).length-Object.keys(E).length;return{content:ua(v,{lineWidth:0}),message:`${d}: kept ${re}/${M} packages and ${Object.keys(E).length} importers (dropped ${ae} packages, ${x} importers)`,status:"pruned"}},fa=l=>io({...l,displayName:l.displayName??"aube-lock.yaml"}),pa=l=>{let d="",A=!1,o=!1,h=!1;for(let e=0;e<l.length;e+=1){const g=l[e],C=l[e+1];if(o){g===`
|
|
2
|
+
`&&(o=!1,d+=g);continue}if(h){g==="*"&&C==="/"&&(h=!1,e+=1);continue}if(A){if(g==="\\"){d+=g,C!==void 0&&(d+=C,e+=1);continue}g==='"'&&(A=!1),d+=g;continue}if(g==='"'){A=!0,d+=g;continue}if(g==="/"&&C==="/"){o=!0,e+=1;continue}if(g==="/"&&C==="*"){h=!0,e+=1;continue}d+=g}return d},ha=l=>{const d=[];for(const A of[l.dependencies,l.devDependencies,l.optionalDependencies,l.peerDependencies])if(A)for(const[o,h]of Object.entries(A))typeof h=="string"&&d.push({name:o,spec:h});return d},da=l=>{for(const d of l)if(typeof d=="object"&&!Array.isArray(d))return d},ga=l=>{if(!l)return[];const d=[];for(const A of["dependencies","optionalDependencies","peerDependencies"]){const o=l[A];o!==null&&typeof o=="object"&&!Array.isArray(o)&&d.push(...Object.keys(o))}return d},ma=l=>{if(Buffer.isBuffer(l.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const d=pa(l.lockfileContent);let A;try{A=JSON.parse(d)}catch(M){throw new et(`bun.lock: parse failed — ${M.message}`)}if(!A||typeof A!="object")throw new et("bun.lock: top-level value is not an object");const o=A.workspaces??{},h=A.packages??{},e=new Set([""]);for(const M of l.closure)e.add(M.relativeRoot===""?"":M.relativeRoot);const g={},C=[];for(const[M,re]of Object.entries(o))e.has(M)&&(g[M]=re,C.push(...ha(re)));const m=new Set;for(const{name:M}of C)m.add(M);const S=[...m];for(;S.length>0;){const M=S.shift();for(const re of Object.keys(h)){if(re.split("/")[0]!==M&&re!==M)continue;const ae=da(h[re]);for(const x of ga(ae))m.has(x)||(m.add(x),S.push(x))}}const E={};for(const[M,re]of Object.entries(h)){const ae=M.split("/")[0];(m.has(ae)||m.has(M))&&(E[M]=re)}const Y={...A,packages:E,workspaces:g},y=Object.keys(h).length,b=Object.keys(E).length,v=y-b;return{content:`${JSON.stringify(Y,null,2)}
|
|
3
|
+
`,message:`bun.lock: kept ${b}/${y} packages (dropped ${v})`,status:"pruned"}},Vr="node_modules/",ya=(l,d,A)=>{let o=d;for(;;){const h=o===""?`${Vr}${A}`:`${o}/${Vr}${A}`;if(l[h]!==void 0)return h;if(o==="")return;const e=o.lastIndexOf(`/${Vr.slice(0,-1)}/`);o=e===-1?"":o.slice(0,e)}},va=l=>{const d=[];for(const A of[l.dependencies,l.devDependencies,l.optionalDependencies,l.peerDependencies])if(A)for(const o of Object.keys(A))d.push(o);return d},Aa=l=>{const d=l.displayName??"package-lock.json",A=typeof l.lockfileContent=="string"?l.lockfileContent:l.lockfileContent.toString("utf8");let o;try{o=JSON.parse(A)}catch(v){throw new et(`${d}: parse failed — ${v.message}`)}if(!o||typeof o!="object")throw new et(`${d}: top-level value is not an object`);const h=o.packages??{},e=new Set([""]);for(const v of l.closure)v.relativeRoot!==""&&e.add(v.relativeRoot);const g=new Set,C=[];for(const v of Object.keys(h))e.has(v)&&(g.add(v),C.push(v));for(const[v,M]of Object.entries(h))M.link===!0&&typeof M.resolved=="string"&&e.has(M.resolved)&&g.add(v);for(;C.length>0;){const v=C.shift(),M=h[v];if(M)for(const re of va(M)){const ae=ya(h,v,re);if(!ae||g.has(ae))continue;g.add(ae);const x=h[ae];x.link===!0&&typeof x.resolved=="string"&&h[x.resolved]!==void 0&&!g.has(x.resolved)?(g.add(x.resolved),C.push(x.resolved)):C.push(ae)}}const m={};for(const v of Object.keys(h))g.has(v)&&(m[v]=h[v]);const S=m[""];S&&Array.isArray(S.workspaces)&&(S.workspaces=S.workspaces.filter(v=>{if(typeof v!="string")return!1;const M=v.replace(/\/?\*+$/,"").replace(/\/$/,"");if(M===""||M==="*")return!0;for(const re of e)if(re===v||re===M||re.startsWith(`${M}/`))return!0;return!1}));const E={...o,packages:m};delete E.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,b=Y-y;return{content:`${JSON.stringify(E,null,2)}
|
|
4
|
+
`,message:`${d}: kept ${y}/${Y} entries (dropped ${b})`,status:"pruned"}};var Kr={},xe={},Zr,di;function ba(){if(di)return Zr;di=1;function l(o,h){function e(){this.constructor=o}e.prototype=h.prototype,o.prototype=new e}function d(o,h,e,g){this.message=o,this.expected=h,this.found=e,this.location=g,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,d)}l(d,Error),d.buildMessage=function(o,h){var e={literal:function(y){return'"'+C(y.text)+'"'},class:function(y){var b="",v;for(v=0;v<y.parts.length;v++)b+=y.parts[v]instanceof Array?m(y.parts[v][0])+"-"+m(y.parts[v][1]):m(y.parts[v]);return"["+(y.inverted?"^":"")+b+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function g(y){return y.charCodeAt(0).toString(16).toUpperCase()}function C(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function S(y){return e[y.type](y)}function E(y){var b=new Array(y.length),v,M;for(v=0;v<y.length;v++)b[v]=S(y[v]);if(b.sort(),b.length>0){for(v=1,M=1;v<b.length;v++)b[v-1]!==b[v]&&(b[M]=b[v],M++);b.length=M}switch(b.length){case 1:return b[0];case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}function Y(y){return y?'"'+C(y)+'"':"end of input"}return"Expected "+E(o)+" but "+Y(h)+" found."};function A(o,h){h=h!==void 0?h:{};var e={},g={Start:Jn},C=Jn,m=function(t){return t||[]},S=function(t,i,a){return[{command:t,type:i}].concat(a||[])},E=function(t,i){return[{command:t,type:i||";"}]},Y=function(t){return t},y=";",b=ce(";",!1),v="&",M=ce("&",!1),re=function(t,i){return i?{chain:t,then:i}:{chain:t}},ae=function(t,i){return{type:t,line:i}},x="&&",Z=ce("&&",!1),te="||",q=ce("||",!1),ue=function(t,i){return i?{...t,then:i}:t},Ce=function(t,i){return{type:t,chain:i}},ge="|&",Ae=ce("|&",!1),Ee="|",Oe=ce("|",!1),Fe="=",Ue=ce("=",!1),ye=function(t,i){return{name:t,args:[i]}},Me=function(t){return{name:t,args:[]}},Ze="(",$e=ce("(",!1),ee=")",Ne=ce(")",!1),De=function(t,i){return{type:"subshell",subshell:t,args:i}},Re="{",qe=ce("{",!1),we="}",W=ce("}",!1),U=function(t,i){return{type:"group",group:t,args:i}},ie=function(t,i){return{type:"command",args:i,envs:t}},ve=function(t){return{type:"envs",envs:t}},Je=function(t){return t},ze=function(t){return t},Pe=/^[0-9]/,Ye=We([["0","9"]],!1,!1),tt=function(t,i,a){return{type:"redirection",subtype:i,fd:t!==null?parseInt(t):null,args:[a]}},rt=">>",Ct=ce(">>",!1),st=">&",ut=ce(">&",!1),wt=">",He=ce(">",!1),ht="<<<",Xe=ce("<<<",!1),Ve="<&",dt=ce("<&",!1),St="<",gt=ce("<",!1),r=function(t){return{type:"argument",segments:[].concat(...t)}},$=function(t){return t},j="$'",K=ce("$'",!1),P="'",u=ce("'",!1),w=function(t){return[{type:"text",text:t}]},O='""',R=ce('""',!1),N=function(){return{type:"text",text:""}},H='"',T=ce('"',!1),z=function(t){return t},G=function(t){return{type:"arithmetic",arithmetic:t,quoted:!0}},ne=function(t){return{type:"shell",shell:t,quoted:!0}},de=function(t){return{type:"variable",...t,quoted:!0}},le=function(t){return{type:"text",text:t}},_e=function(t){return{type:"arithmetic",arithmetic:t,quoted:!1}},kr=function(t){return{type:"shell",shell:t,quoted:!1}},Er=function(t){return{type:"variable",...t,quoted:!1}},nr=function(t){return{type:"glob",pattern:t}},Tt=/^[^']/,Lt=We(["'"],!0,!1),mt=function(t){return t.join("")},ir=/^[^$"]/,or=We(["$",'"'],!0,!1),Ht=`\\
|
|
5
|
+
`,_r=ce(`\\
|
|
6
|
+
`,!1),$r=function(){return""},yt="\\",vt=ce("\\",!1),jr=/^[\\$"`]/,ar=We(["\\","$",'"',"`"],!1,!1),Qe=function(t){return t},Bt="\\a",Or=ce("\\a",!1),xr=function(){return"a"},sr="\\b",Rr=ce("\\b",!1),Tr=function(){return"\b"},f=/^[Ee]/,he=We(["E","e"],!1,!1),Ft=function(){return"\x1B"},Be="\\f",Wt=ce("\\f",!1),Q=function(){return"\f"},kt="\\n",ur=ce("\\n",!1),be=function(){return`
|
|
7
|
+
`},nt="\\r",Lr=ce("\\r",!1),Fr=function(){return"\r"},Et="\\t",cr=ce("\\t",!1),lr=function(){return" "},oe="\\v",Ir=ce("\\v",!1),fr=function(){return"\v"},Nr=/^[\\'"?]/,pr=We(["\\","'",'"',"?"],!1,!1),It=function(t){return String.fromCharCode(parseInt(t,16))},Gt="\\x",Nt=ce("\\x",!1),At="\\u",Mr=ce("\\u",!1),Jt="\\U",hr=ce("\\U",!1),qr=function(t){return String.fromCodePoint(parseInt(t,16))},_t=/^[0-7]/,Pr=We([["0","7"]],!1,!1),Dr=/^[0-9a-fA-f]/,dr=We([["0","9"],["a","f"],["A","f"]],!1,!1),it=To(),$t="{}",gr=ce("{}",!1),jt=function(){return"{}"},Mt="-",Ot=ce("-",!1),ct="+",Se=ce("+",!1),lt=".",ft=ce(".",!1),mr=function(t,i,a){return{type:"number",value:(t==="-"?-1:1)*parseFloat(i.join("")+"."+a.join(""))}},qt=function(t,i){return{type:"number",value:(t==="-"?-1:1)*parseInt(i.join(""))}},s=function(t){return{type:"variable",...t}},p=function(t){return{type:"variable",name:t}},_=function(t){return t},B="*",D=ce("*",!1),X="/",fe=ce("/",!1),me=function(t,i,a){return{type:i==="*"?"multiplication":"division",right:a}},pt=function(t,i){return i.reduce((a,c)=>({left:a,...c}),t)},On=function(t,i,a){return{type:i==="+"?"addition":"subtraction",right:a}},xn="$((",co=ce("$((",!1),Rn="))",lo=ce("))",!1),fo=function(t){return t},Tn="$(",po=ce("$(",!1),ho=function(t){return t},ot="${",Vt=ce("${",!1),Ln=":-",go=ce(":-",!1),mo=function(t,i){return{name:t,defaultValue:i}},Fn=":-}",yo=ce(":-}",!1),vo=function(t){return{name:t,defaultValue:[]}},In=":+",Ao=ce(":+",!1),bo=function(t,i){return{name:t,alternativeValue:i}},Nn=":+}",Co=ce(":+}",!1),wo=function(t){return{name:t,alternativeValue:[]}},Mn=function(t){return{name:t}},So="$",ko=ce("$",!1),Eo=function(t){return h.isGlobPattern(t)},_o=function(t){return t},qn=/^[a-zA-Z0-9_]/,Pn=We([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Dn=function(){return Ro()},Yn=/^[$@*?#a-zA-Z0-9_\-]/,Un=We(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),$o=/^[()}<>$|&; \t"']/,jo=We(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Oo=/^[<>&; \t"']/,xo=We(["<",">","&",";"," "," ",'"',"'"],!1,!1),Hn=/^[ \t]/,Bn=We([" "," "],!1,!1),n=0,V=0,yr=[{line:1,column:1}],at=0,Yr=[],L=0,vr;if("startRule"in h){if(!(h.startRule in g))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');C=g[h.startRule]}function Ro(){return o.substring(V,n)}function ce(t,i){return{type:"literal",text:t,ignoreCase:i}}function We(t,i,a){return{type:"class",parts:t,inverted:i,ignoreCase:a}}function To(){return{type:"any"}}function Lo(){return{type:"end"}}function Wn(t){var i=yr[t],a;if(i)return i;for(a=t-1;!yr[a];)a--;for(i=yr[a],i={line:i.line,column:i.column};a<t;)o.charCodeAt(a)===10?(i.line++,i.column=1):i.column++,a++;return yr[t]=i,i}function Gn(t,i){var a=Wn(t),c=Wn(i);return{start:{offset:t,line:a.line,column:a.column},end:{offset:i,line:c.line,column:c.column}}}function I(t){n<at||(n>at&&(at=n,Yr=[]),Yr.push(t))}function Fo(t,i,a){return new d(d.buildMessage(t,i),t,i,a)}function Jn(){var t,i,a;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();return i!==e?(a=Kt(),a===e&&(a=null),a!==e?(V=t,i=m(a),t=i):(n=t,t=e)):(n=t,t=e),t}function Kt(){var t,i,a,c,k;if(t=n,i=Ur(),i!==e){for(a=[],c=J();c!==e;)a.push(c),c=J();a!==e?(c=Vn(),c!==e?(k=Io(),k===e&&(k=null),k!==e?(V=t,i=S(i,c,k),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;if(t===e)if(t=n,i=Ur(),i!==e){for(a=[],c=J();c!==e;)a.push(c),c=J();a!==e?(c=Vn(),c===e&&(c=null),c!==e?(V=t,i=E(i,c),t=i):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function Io(){var t,i,a,c,k;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e)if(a=Kt(),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();c!==e?(V=t,i=Y(a),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e;return t}function Vn(){var t;return o.charCodeAt(n)===59?(t=y,n++):(t=e,L===0&&I(b)),t===e&&(o.charCodeAt(n)===38?(t=v,n++):(t=e,L===0&&I(M))),t}function Ur(){var t,i,a;return t=n,i=Kn(),i!==e?(a=No(),a===e&&(a=null),a!==e?(V=t,i=re(i,a),t=i):(n=t,t=e)):(n=t,t=e),t}function No(){var t,i,a,c,k,F,se;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e)if(a=Mo(),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();if(c!==e)if(k=Ur(),k!==e){for(F=[],se=J();se!==e;)F.push(se),se=J();F!==e?(V=t,i=ae(a,k),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e;return t}function Mo(){var t;return o.substr(n,2)===x?(t=x,n+=2):(t=e,L===0&&I(Z)),t===e&&(o.substr(n,2)===te?(t=te,n+=2):(t=e,L===0&&I(q))),t}function Kn(){var t,i,a;return t=n,i=Do(),i!==e?(a=qo(),a===e&&(a=null),a!==e?(V=t,i=ue(i,a),t=i):(n=t,t=e)):(n=t,t=e),t}function qo(){var t,i,a,c,k,F,se;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e)if(a=Po(),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();if(c!==e)if(k=Kn(),k!==e){for(F=[],se=J();se!==e;)F.push(se),se=J();F!==e?(V=t,i=Ce(a,k),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e;return t}function Po(){var t;return o.substr(n,2)===ge?(t=ge,n+=2):(t=e,L===0&&I(Ae)),t===e&&(o.charCodeAt(n)===124?(t=Ee,n++):(t=e,L===0&&I(Oe))),t}function Ar(){var t,i,a,c,k,F;if(t=n,i=si(),i!==e)if(o.charCodeAt(n)===61?(a=Fe,n++):(a=e,L===0&&I(Ue)),a!==e)if(c=Xn(),c!==e){for(k=[],F=J();F!==e;)k.push(F),F=J();k!==e?(V=t,i=ye(i,c),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e;else n=t,t=e;if(t===e)if(t=n,i=si(),i!==e)if(o.charCodeAt(n)===61?(a=Fe,n++):(a=e,L===0&&I(Ue)),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();c!==e?(V=t,i=Me(i),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e;return t}function Do(){var t,i,a,c,k,F,se,pe,je,Te,Ke;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e)if(o.charCodeAt(n)===40?(a=Ze,n++):(a=e,L===0&&I($e)),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();if(c!==e)if(k=Kt(),k!==e){for(F=[],se=J();se!==e;)F.push(se),se=J();if(F!==e)if(o.charCodeAt(n)===41?(se=ee,n++):(se=e,L===0&&I(Ne)),se!==e){for(pe=[],je=J();je!==e;)pe.push(je),je=J();if(pe!==e){for(je=[],Te=Zt();Te!==e;)je.push(Te),Te=Zt();if(je!==e){for(Te=[],Ke=J();Ke!==e;)Te.push(Ke),Ke=J();Te!==e?(V=t,i=De(k,je),t=i):(n=t,t=e)}else n=t,t=e}else n=t,t=e}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e;if(t===e){for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e)if(o.charCodeAt(n)===123?(a=Re,n++):(a=e,L===0&&I(qe)),a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();if(c!==e)if(k=Kt(),k!==e){for(F=[],se=J();se!==e;)F.push(se),se=J();if(F!==e)if(o.charCodeAt(n)===125?(se=we,n++):(se=e,L===0&&I(W)),se!==e){for(pe=[],je=J();je!==e;)pe.push(je),je=J();if(pe!==e){for(je=[],Te=Zt();Te!==e;)je.push(Te),Te=Zt();if(je!==e){for(Te=[],Ke=J();Ke!==e;)Te.push(Ke),Ke=J();Te!==e?(V=t,i=U(k,je),t=i):(n=t,t=e)}else n=t,t=e}else n=t,t=e}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e}else n=t,t=e;else n=t,t=e;if(t===e){for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e){for(a=[],c=Ar();c!==e;)a.push(c),c=Ar();if(a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();if(c!==e){if(k=[],F=zn(),F!==e)for(;F!==e;)k.push(F),F=zn();else k=e;if(k!==e){for(F=[],se=J();se!==e;)F.push(se),se=J();F!==e?(V=t,i=ie(a,k),t=i):(n=t,t=e)}else n=t,t=e}else n=t,t=e}else n=t,t=e}else n=t,t=e;if(t===e){for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e){if(a=[],c=Ar(),c!==e)for(;c!==e;)a.push(c),c=Ar();else a=e;if(a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();c!==e?(V=t,i=ve(a),t=i):(n=t,t=e)}else n=t,t=e}else n=t,t=e}}}return t}function Zn(){var t,i,a,c,k;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e){if(a=[],c=br(),c!==e)for(;c!==e;)a.push(c),c=br();else a=e;if(a!==e){for(c=[],k=J();k!==e;)c.push(k),k=J();c!==e?(V=t,i=Je(a),t=i):(n=t,t=e)}else n=t,t=e}else n=t,t=e;return t}function zn(){var t,i,a;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();if(i!==e?(a=Zt(),a!==e?(V=t,i=ze(a),t=i):(n=t,t=e)):(n=t,t=e),t===e){for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();i!==e?(a=br(),a!==e?(V=t,i=ze(a),t=i):(n=t,t=e)):(n=t,t=e)}return t}function Zt(){var t,i,a,c,k;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();return i!==e?(Pe.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Ye)),a===e&&(a=null),a!==e?(c=Yo(),c!==e?(k=br(),k!==e?(V=t,i=tt(a,c,k),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Yo(){var t;return o.substr(n,2)===rt?(t=rt,n+=2):(t=e,L===0&&I(Ct)),t===e&&(o.substr(n,2)===st?(t=st,n+=2):(t=e,L===0&&I(ut)),t===e&&(o.charCodeAt(n)===62?(t=wt,n++):(t=e,L===0&&I(He)),t===e&&(o.substr(n,3)===ht?(t=ht,n+=3):(t=e,L===0&&I(Xe)),t===e&&(o.substr(n,2)===Ve?(t=Ve,n+=2):(t=e,L===0&&I(dt)),t===e&&(o.charCodeAt(n)===60?(t=St,n++):(t=e,L===0&&I(gt))))))),t}function br(){var t,i,a;for(t=n,i=[],a=J();a!==e;)i.push(a),a=J();return i!==e?(a=Xn(),a!==e?(V=t,i=ze(a),t=i):(n=t,t=e)):(n=t,t=e),t}function Xn(){var t,i,a;if(t=n,i=[],a=Qn(),a!==e)for(;a!==e;)i.push(a),a=Qn();else i=e;return i!==e&&(V=t,i=r(i)),t=i,t}function Qn(){var t,i;return t=n,i=Uo(),i!==e&&(V=t,i=$(i)),t=i,t===e&&(t=n,i=Ho(),i!==e&&(V=t,i=$(i)),t=i,t===e&&(t=n,i=Bo(),i!==e&&(V=t,i=$(i)),t=i,t===e&&(t=n,i=Wo(),i!==e&&(V=t,i=$(i)),t=i))),t}function Uo(){var t,i,a,c;return t=n,o.substr(n,2)===j?(i=j,n+=2):(i=e,L===0&&I(K)),i!==e?(a=Vo(),a!==e?(o.charCodeAt(n)===39?(c=P,n++):(c=e,L===0&&I(u)),c!==e?(V=t,i=w(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Ho(){var t,i,a,c;return t=n,o.charCodeAt(n)===39?(i=P,n++):(i=e,L===0&&I(u)),i!==e?(a=Go(),a!==e?(o.charCodeAt(n)===39?(c=P,n++):(c=e,L===0&&I(u)),c!==e?(V=t,i=w(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Bo(){var t,i,a,c;if(t=n,o.substr(n,2)===O?(i=O,n+=2):(i=e,L===0&&I(R)),i!==e&&(V=t,i=N()),t=i,t===e)if(t=n,o.charCodeAt(n)===34?(i=H,n++):(i=e,L===0&&I(T)),i!==e){for(a=[],c=ei();c!==e;)a.push(c),c=ei();a!==e?(o.charCodeAt(n)===34?(c=H,n++):(c=e,L===0&&I(T)),c!==e?(V=t,i=z(a),t=i):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function Wo(){var t,i,a;if(t=n,i=[],a=ti(),a!==e)for(;a!==e;)i.push(a),a=ti();else i=e;return i!==e&&(V=t,i=z(i)),t=i,t}function ei(){var t,i;return t=n,i=oi(),i!==e&&(V=t,i=G(i)),t=i,t===e&&(t=n,i=ai(),i!==e&&(V=t,i=ne(i)),t=i,t===e&&(t=n,i=Gr(),i!==e&&(V=t,i=de(i)),t=i,t===e&&(t=n,i=Jo(),i!==e&&(V=t,i=le(i)),t=i))),t}function ti(){var t,i;return t=n,i=oi(),i!==e&&(V=t,i=_e(i)),t=i,t===e&&(t=n,i=ai(),i!==e&&(V=t,i=kr(i)),t=i,t===e&&(t=n,i=Gr(),i!==e&&(V=t,i=Er(i)),t=i,t===e&&(t=n,i=zo(),i!==e&&(V=t,i=nr(i)),t=i,t===e&&(t=n,i=Zo(),i!==e&&(V=t,i=le(i)),t=i)))),t}function Go(){var t,i,a;for(t=n,i=[],Tt.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Lt));a!==e;)i.push(a),Tt.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Lt));return i!==e&&(V=t,i=mt(i)),t=i,t}function Jo(){var t,i,a;if(t=n,i=[],a=ri(),a===e&&(ir.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(or))),a!==e)for(;a!==e;)i.push(a),a=ri(),a===e&&(ir.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(or)));else i=e;return i!==e&&(V=t,i=mt(i)),t=i,t}function ri(){var t,i,a;return t=n,o.substr(n,2)===Ht?(i=Ht,n+=2):(i=e,L===0&&I(_r)),i!==e&&(V=t,i=$r()),t=i,t===e&&(t=n,o.charCodeAt(n)===92?(i=yt,n++):(i=e,L===0&&I(vt)),i!==e?(jr.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(ar)),a!==e?(V=t,i=Qe(a),t=i):(n=t,t=e)):(n=t,t=e)),t}function Vo(){var t,i,a;for(t=n,i=[],a=ni(),a===e&&(Tt.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Lt)));a!==e;)i.push(a),a=ni(),a===e&&(Tt.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Lt)));return i!==e&&(V=t,i=mt(i)),t=i,t}function ni(){var t,i,a;return t=n,o.substr(n,2)===Bt?(i=Bt,n+=2):(i=e,L===0&&I(Or)),i!==e&&(V=t,i=xr()),t=i,t===e&&(t=n,o.substr(n,2)===sr?(i=sr,n+=2):(i=e,L===0&&I(Rr)),i!==e&&(V=t,i=Tr()),t=i,t===e&&(t=n,o.charCodeAt(n)===92?(i=yt,n++):(i=e,L===0&&I(vt)),i!==e?(f.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(he)),a!==e?(V=t,i=Ft(),t=i):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===Be?(i=Be,n+=2):(i=e,L===0&&I(Wt)),i!==e&&(V=t,i=Q()),t=i,t===e&&(t=n,o.substr(n,2)===kt?(i=kt,n+=2):(i=e,L===0&&I(ur)),i!==e&&(V=t,i=be()),t=i,t===e&&(t=n,o.substr(n,2)===nt?(i=nt,n+=2):(i=e,L===0&&I(Lr)),i!==e&&(V=t,i=Fr()),t=i,t===e&&(t=n,o.substr(n,2)===Et?(i=Et,n+=2):(i=e,L===0&&I(cr)),i!==e&&(V=t,i=lr()),t=i,t===e&&(t=n,o.substr(n,2)===oe?(i=oe,n+=2):(i=e,L===0&&I(Ir)),i!==e&&(V=t,i=fr()),t=i,t===e&&(t=n,o.charCodeAt(n)===92?(i=yt,n++):(i=e,L===0&&I(vt)),i!==e?(Nr.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(pr)),a!==e?(V=t,i=Qe(a),t=i):(n=t,t=e)):(n=t,t=e),t===e&&(t=Ko()))))))))),t}function Ko(){var t,i,a,c,k,F,se,pe,je,Te,Ke,Jr;return t=n,o.charCodeAt(n)===92?(i=yt,n++):(i=e,L===0&&I(vt)),i!==e?(a=Hr(),a!==e?(V=t,i=It(a),t=i):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===Gt?(i=Gt,n+=2):(i=e,L===0&&I(Nt)),i!==e?(a=n,c=n,k=Hr(),k!==e?(F=Ge(),F!==e?(k=[k,F],c=k):(n=c,c=e)):(n=c,c=e),c===e&&(c=Hr()),c!==e?a=o.substring(a,n):a=c,a!==e?(V=t,i=It(a),t=i):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===At?(i=At,n+=2):(i=e,L===0&&I(Mr)),i!==e?(a=n,c=n,k=Ge(),k!==e?(F=Ge(),F!==e?(se=Ge(),se!==e?(pe=Ge(),pe!==e?(k=[k,F,se,pe],c=k):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e),c!==e?a=o.substring(a,n):a=c,a!==e?(V=t,i=It(a),t=i):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===Jt?(i=Jt,n+=2):(i=e,L===0&&I(hr)),i!==e?(a=n,c=n,k=Ge(),k!==e?(F=Ge(),F!==e?(se=Ge(),se!==e?(pe=Ge(),pe!==e?(je=Ge(),je!==e?(Te=Ge(),Te!==e?(Ke=Ge(),Ke!==e?(Jr=Ge(),Jr!==e?(k=[k,F,se,pe,je,Te,Ke,Jr],c=k):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e)):(n=c,c=e),c!==e?a=o.substring(a,n):a=c,a!==e?(V=t,i=qr(a),t=i):(n=t,t=e)):(n=t,t=e)))),t}function Hr(){var t;return _t.test(o.charAt(n))?(t=o.charAt(n),n++):(t=e,L===0&&I(Pr)),t}function Ge(){var t;return Dr.test(o.charAt(n))?(t=o.charAt(n),n++):(t=e,L===0&&I(dr)),t}function Zo(){var t,i,a,c,k;if(t=n,i=[],a=n,o.charCodeAt(n)===92?(c=yt,n++):(c=e,L===0&&I(vt)),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e),a===e&&(a=n,o.substr(n,2)===$t?(c=$t,n+=2):(c=e,L===0&&I(gr)),c!==e&&(V=a,c=jt()),a=c,a===e&&(a=n,c=n,L++,k=ui(),L--,k===e?c=void 0:(n=c,c=e),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e))),a!==e)for(;a!==e;)i.push(a),a=n,o.charCodeAt(n)===92?(c=yt,n++):(c=e,L===0&&I(vt)),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e),a===e&&(a=n,o.substr(n,2)===$t?(c=$t,n+=2):(c=e,L===0&&I(gr)),c!==e&&(V=a,c=jt()),a=c,a===e&&(a=n,c=n,L++,k=ui(),L--,k===e?c=void 0:(n=c,c=e),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e)));else i=e;return i!==e&&(V=t,i=mt(i)),t=i,t}function Br(){var t,i,a,c,k,F;if(t=n,o.charCodeAt(n)===45?(i=Mt,n++):(i=e,L===0&&I(Ot)),i===e&&(o.charCodeAt(n)===43?(i=ct,n++):(i=e,L===0&&I(Se))),i===e&&(i=null),i!==e){if(a=[],Pe.test(o.charAt(n))?(c=o.charAt(n),n++):(c=e,L===0&&I(Ye)),c!==e)for(;c!==e;)a.push(c),Pe.test(o.charAt(n))?(c=o.charAt(n),n++):(c=e,L===0&&I(Ye));else a=e;if(a!==e)if(o.charCodeAt(n)===46?(c=lt,n++):(c=e,L===0&&I(ft)),c!==e){if(k=[],Pe.test(o.charAt(n))?(F=o.charAt(n),n++):(F=e,L===0&&I(Ye)),F!==e)for(;F!==e;)k.push(F),Pe.test(o.charAt(n))?(F=o.charAt(n),n++):(F=e,L===0&&I(Ye));else k=e;k!==e?(V=t,i=mr(i,a,k),t=i):(n=t,t=e)}else n=t,t=e;else n=t,t=e}else n=t,t=e;if(t===e){if(t=n,o.charCodeAt(n)===45?(i=Mt,n++):(i=e,L===0&&I(Ot)),i===e&&(o.charCodeAt(n)===43?(i=ct,n++):(i=e,L===0&&I(Se))),i===e&&(i=null),i!==e){if(a=[],Pe.test(o.charAt(n))?(c=o.charAt(n),n++):(c=e,L===0&&I(Ye)),c!==e)for(;c!==e;)a.push(c),Pe.test(o.charAt(n))?(c=o.charAt(n),n++):(c=e,L===0&&I(Ye));else a=e;a!==e?(V=t,i=qt(i,a),t=i):(n=t,t=e)}else n=t,t=e;if(t===e&&(t=n,i=Gr(),i!==e&&(V=t,i=s(i)),t=i,t===e&&(t=n,i=xt(),i!==e&&(V=t,i=p(i)),t=i,t===e)))if(t=n,o.charCodeAt(n)===40?(i=Ze,n++):(i=e,L===0&&I($e)),i!==e){for(a=[],c=J();c!==e;)a.push(c),c=J();if(a!==e)if(c=ii(),c!==e){for(k=[],F=J();F!==e;)k.push(F),F=J();k!==e?(o.charCodeAt(n)===41?(F=ee,n++):(F=e,L===0&&I(Ne)),F!==e?(V=t,i=_(c),t=i):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;else n=t,t=e}else n=t,t=e}return t}function Wr(){var t,i,a,c,k,F,se,pe;if(t=n,i=Br(),i!==e){for(a=[],c=n,k=[],F=J();F!==e;)k.push(F),F=J();if(k!==e)if(o.charCodeAt(n)===42?(F=B,n++):(F=e,L===0&&I(D)),F===e&&(o.charCodeAt(n)===47?(F=X,n++):(F=e,L===0&&I(fe))),F!==e){for(se=[],pe=J();pe!==e;)se.push(pe),pe=J();se!==e?(pe=Br(),pe!==e?(V=c,k=me(i,F,pe),c=k):(n=c,c=e)):(n=c,c=e)}else n=c,c=e;else n=c,c=e;for(;c!==e;){for(a.push(c),c=n,k=[],F=J();F!==e;)k.push(F),F=J();if(k!==e)if(o.charCodeAt(n)===42?(F=B,n++):(F=e,L===0&&I(D)),F===e&&(o.charCodeAt(n)===47?(F=X,n++):(F=e,L===0&&I(fe))),F!==e){for(se=[],pe=J();pe!==e;)se.push(pe),pe=J();se!==e?(pe=Br(),pe!==e?(V=c,k=me(i,F,pe),c=k):(n=c,c=e)):(n=c,c=e)}else n=c,c=e;else n=c,c=e}a!==e?(V=t,i=pt(i,a),t=i):(n=t,t=e)}else n=t,t=e;return t}function ii(){var t,i,a,c,k,F,se,pe;if(t=n,i=Wr(),i!==e){for(a=[],c=n,k=[],F=J();F!==e;)k.push(F),F=J();if(k!==e)if(o.charCodeAt(n)===43?(F=ct,n++):(F=e,L===0&&I(Se)),F===e&&(o.charCodeAt(n)===45?(F=Mt,n++):(F=e,L===0&&I(Ot))),F!==e){for(se=[],pe=J();pe!==e;)se.push(pe),pe=J();se!==e?(pe=Wr(),pe!==e?(V=c,k=On(i,F,pe),c=k):(n=c,c=e)):(n=c,c=e)}else n=c,c=e;else n=c,c=e;for(;c!==e;){for(a.push(c),c=n,k=[],F=J();F!==e;)k.push(F),F=J();if(k!==e)if(o.charCodeAt(n)===43?(F=ct,n++):(F=e,L===0&&I(Se)),F===e&&(o.charCodeAt(n)===45?(F=Mt,n++):(F=e,L===0&&I(Ot))),F!==e){for(se=[],pe=J();pe!==e;)se.push(pe),pe=J();se!==e?(pe=Wr(),pe!==e?(V=c,k=On(i,F,pe),c=k):(n=c,c=e)):(n=c,c=e)}else n=c,c=e;else n=c,c=e}a!==e?(V=t,i=pt(i,a),t=i):(n=t,t=e)}else n=t,t=e;return t}function oi(){var t,i,a,c,k,F;if(t=n,o.substr(n,3)===xn?(i=xn,n+=3):(i=e,L===0&&I(co)),i!==e){for(a=[],c=J();c!==e;)a.push(c),c=J();if(a!==e)if(c=ii(),c!==e){for(k=[],F=J();F!==e;)k.push(F),F=J();k!==e?(o.substr(n,2)===Rn?(F=Rn,n+=2):(F=e,L===0&&I(lo)),F!==e?(V=t,i=fo(c),t=i):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;else n=t,t=e}else n=t,t=e;return t}function ai(){var t,i,a,c;return t=n,o.substr(n,2)===Tn?(i=Tn,n+=2):(i=e,L===0&&I(po)),i!==e?(a=Kt(),a!==e?(o.charCodeAt(n)===41?(c=ee,n++):(c=e,L===0&&I(Ne)),c!==e?(V=t,i=ho(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Gr(){var t,i,a,c,k,F;return t=n,o.substr(n,2)===ot?(i=ot,n+=2):(i=e,L===0&&I(Vt)),i!==e?(a=xt(),a!==e?(o.substr(n,2)===Ln?(c=Ln,n+=2):(c=e,L===0&&I(go)),c!==e?(k=Zn(),k!==e?(o.charCodeAt(n)===125?(F=we,n++):(F=e,L===0&&I(W)),F!==e?(V=t,i=mo(a,k),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===ot?(i=ot,n+=2):(i=e,L===0&&I(Vt)),i!==e?(a=xt(),a!==e?(o.substr(n,3)===Fn?(c=Fn,n+=3):(c=e,L===0&&I(yo)),c!==e?(V=t,i=vo(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===ot?(i=ot,n+=2):(i=e,L===0&&I(Vt)),i!==e?(a=xt(),a!==e?(o.substr(n,2)===In?(c=In,n+=2):(c=e,L===0&&I(Ao)),c!==e?(k=Zn(),k!==e?(o.charCodeAt(n)===125?(F=we,n++):(F=e,L===0&&I(W)),F!==e?(V=t,i=bo(a,k),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===ot?(i=ot,n+=2):(i=e,L===0&&I(Vt)),i!==e?(a=xt(),a!==e?(o.substr(n,3)===Nn?(c=Nn,n+=3):(c=e,L===0&&I(Co)),c!==e?(V=t,i=wo(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.substr(n,2)===ot?(i=ot,n+=2):(i=e,L===0&&I(Vt)),i!==e?(a=xt(),a!==e?(o.charCodeAt(n)===125?(c=we,n++):(c=e,L===0&&I(W)),c!==e?(V=t,i=Mn(a),t=i):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,o.charCodeAt(n)===36?(i=So,n++):(i=e,L===0&&I(ko)),i!==e?(a=xt(),a!==e?(V=t,i=Mn(a),t=i):(n=t,t=e)):(n=t,t=e)))))),t}function zo(){var t,i,a;return t=n,i=Xo(),i!==e?(V=n,a=Eo(i),a?a=void 0:a=e,a!==e?(V=t,i=_o(i),t=i):(n=t,t=e)):(n=t,t=e),t}function Xo(){var t,i,a,c,k;if(t=n,i=[],a=n,c=n,L++,k=ci(),L--,k===e?c=void 0:(n=c,c=e),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e),a!==e)for(;a!==e;)i.push(a),a=n,c=n,L++,k=ci(),L--,k===e?c=void 0:(n=c,c=e),c!==e?(o.length>n?(k=o.charAt(n),n++):(k=e,L===0&&I(it)),k!==e?(V=a,c=Qe(k),a=c):(n=a,a=e)):(n=a,a=e);else i=e;return i!==e&&(V=t,i=mt(i)),t=i,t}function si(){var t,i,a;if(t=n,i=[],qn.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Pn)),a!==e)for(;a!==e;)i.push(a),qn.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Pn));else i=e;return i!==e&&(V=t,i=Dn()),t=i,t}function xt(){var t,i,a;if(t=n,i=[],Yn.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Un)),a!==e)for(;a!==e;)i.push(a),Yn.test(o.charAt(n))?(a=o.charAt(n),n++):(a=e,L===0&&I(Un));else i=e;return i!==e&&(V=t,i=Dn()),t=i,t}function ui(){var t;return $o.test(o.charAt(n))?(t=o.charAt(n),n++):(t=e,L===0&&I(jo)),t}function ci(){var t;return Oo.test(o.charAt(n))?(t=o.charAt(n),n++):(t=e,L===0&&I(xo)),t}function J(){var t,i;if(t=[],Hn.test(o.charAt(n))?(i=o.charAt(n),n++):(i=e,L===0&&I(Bn)),i!==e)for(;i!==e;)t.push(i),Hn.test(o.charAt(n))?(i=o.charAt(n),n++):(i=e,L===0&&I(Bn));else t=e;return t}if(vr=C(),vr!==e&&n===o.length)return vr;throw vr!==e&&n<o.length&&I(Lo()),Fo(Yr,at<o.length?o.charAt(at):null,at<o.length?Gn(at,at+1):Gn(at,at))}return Zr={SyntaxError:d,parse:A},Zr}var gi;function Ca(){if(gi)return xe;gi=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.parseShell=d,xe.stringifyShellLine=A,xe.stringifyShell=A,xe.stringifyCommandLine=o,xe.stringifyCommandLineThen=h,xe.stringifyCommandChain=e,xe.stringifyCommandChainThen=g,xe.stringifyCommand=C,xe.stringifyEnvSegment=m,xe.stringifyArgument=S,xe.stringifyRedirectArgument=E,xe.stringifyValueArgument=Y,xe.stringifyArgumentSegment=re,xe.stringifyArithmeticExpression=ae,xe.stringifyShellLine=A,xe.stringifyShell=A;const l=ba();function d(x,Z={isGlobPattern:()=>!1}){try{return(0,l.parse)(x,Z)}catch(te){throw te.location&&(te.message=te.message.replace(/(\.)?$/,` (line ${te.location.start.line}, column ${te.location.start.column})$1`)),te}}function A(x,{endSemicolon:Z=!1}={}){return x.map(({command:te,type:q},ue)=>`${o(te)}${q===";"?ue!==x.length-1||Z?";":"":" &"}`).join(" ")}function o(x){return`${e(x.chain)}${x.then?` ${h(x.then)}`:""}`}function h(x){return`${x.type} ${o(x.line)}`}function e(x){return`${C(x)}${x.then?` ${g(x.then)}`:""}`}function g(x){return`${x.type} ${e(x.chain)}`}function C(x){switch(x.type){case"command":return`${x.envs.length>0?`${x.envs.map(Z=>m(Z)).join(" ")} `:""}${x.args.map(Z=>S(Z)).join(" ")}`;case"subshell":return`(${A(x.subshell)})${x.args.length>0?` ${x.args.map(Z=>E(Z)).join(" ")}`:""}`;case"group":return`{ ${A(x.group,{endSemicolon:!0})} }${x.args.length>0?` ${x.args.map(Z=>E(Z)).join(" ")}`:""}`;case"envs":return x.envs.map(Z=>m(Z)).join(" ");default:throw new Error(`Unsupported command type: "${x.type}"`)}}function m(x){return`${x.name}=${x.args[0]?Y(x.args[0]):""}`}function S(x){switch(x.type){case"redirection":return E(x);case"argument":return Y(x);default:throw new Error(`Unsupported argument type: "${x.type}"`)}}function E(x){return`${x.subtype} ${x.args.map(Z=>Y(Z)).join(" ")}`}function Y(x){return x.segments.map(Z=>re(Z)).join("")}const y=new Map([["\f","\\f"],[`
|
|
8
|
+
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),b=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(y,([x,Z])=>[x,`"$'${Z}'"`])]),v=x=>y.get(x)??`\\x${x.charCodeAt(0).toString(16).padStart(2,"0")}`,M=x=>b.get(x)??`"$'${v(x)}'"`;function re(x){const Z=(q,ue)=>ue?`"${q}"`:q,te=q=>q===""?"''":q.match(/[()}<>$|&;"'\n\t ]/)?q.match(/['\t\p{C}]/u)?q.match(/'/)?`"${q.replace(/["$\t\p{C}]/u,M)}"`:`$'${q.replace(/[\t\p{C}]/u,v)}'`:`'${q}'`:q;switch(x.type){case"text":return te(x.text);case"glob":return x.pattern;case"shell":return Z(`$(${A(x.shell)})`,x.quoted);case"variable":return Z(typeof x.defaultValue>"u"?typeof x.alternativeValue>"u"?`\${${x.name}}`:x.alternativeValue.length===0?`\${${x.name}:+}`:`\${${x.name}:+${x.alternativeValue.map(q=>Y(q)).join(" ")}}`:x.defaultValue.length===0?`\${${x.name}:-}`:`\${${x.name}:-${x.defaultValue.map(q=>Y(q)).join(" ")}}`,x.quoted);case"arithmetic":return`$(( ${ae(x.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: "${x.type}"`)}}function ae(x){const Z=ue=>{switch(ue){case"addition":return"+";case"subtraction":return"-";case"multiplication":return"*";case"division":return"/";default:throw new Error(`Can't extract operator from arithmetic expression of type "${ue}"`)}},te=(ue,Ce)=>Ce?`( ${ue} )`:ue,q=ue=>te(ae(ue),!["number","variable"].includes(ue.type));switch(x.type){case"number":return String(x.value);case"variable":return x.name;default:return`${q(x.left)} ${Z(x.type)} ${q(x.right)}`}}return xe}var Xt={},zr,mi;function wa(){if(mi)return zr;mi=1;function l(o,h){function e(){this.constructor=o}e.prototype=h.prototype,o.prototype=new e}function d(o,h,e,g){this.message=o,this.expected=h,this.found=e,this.location=g,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,d)}l(d,Error),d.buildMessage=function(o,h){var e={literal:function(y){return'"'+C(y.text)+'"'},class:function(y){var b="",v;for(v=0;v<y.parts.length;v++)b+=y.parts[v]instanceof Array?m(y.parts[v][0])+"-"+m(y.parts[v][1]):m(y.parts[v]);return"["+(y.inverted?"^":"")+b+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function g(y){return y.charCodeAt(0).toString(16).toUpperCase()}function C(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function S(y){return e[y.type](y)}function E(y){var b=new Array(y.length),v,M;for(v=0;v<y.length;v++)b[v]=S(y[v]);if(b.sort(),b.length>0){for(v=1,M=1;v<b.length;v++)b[v-1]!==b[v]&&(b[M]=b[v],M++);b.length=M}switch(b.length){case 1:return b[0];case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}function Y(y){return y?'"'+C(y)+'"':"end of input"}return"Expected "+E(o)+" but "+Y(h)+" found."};function A(o,h){h=h!==void 0?h:{};var e={},g={resolution:Ne},C=Ne,m="/",S=Fe("/",!1),E=function(W,U){return{from:W,descriptor:U}},Y=function(W){return{descriptor:W}},y="@",b=Fe("@",!1),v=function(W,U){return{fullName:W,description:U}},M=function(W){return{fullName:W}},re=function(){return Oe()},ae=/^[^\/@]/,x=Ue(["/","@"],!0,!1),Z=/^[^\/]/,te=Ue(["/"],!0,!1),q=0,ue=0,Ce=[{line:1,column:1}],ge=0,Ae=[],Ee;if("startRule"in h){if(!(h.startRule in g))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');C=g[h.startRule]}function Oe(){return o.substring(ue,q)}function Fe(W,U){return{type:"literal",text:W,ignoreCase:U}}function Ue(W,U,ie){return{type:"class",parts:W,inverted:U,ignoreCase:ie}}function ye(){return{type:"end"}}function Me(W){var U=Ce[W],ie;if(U)return U;for(ie=W-1;!Ce[ie];)ie--;for(U=Ce[ie],U={line:U.line,column:U.column};ie<W;)o.charCodeAt(ie)===10?(U.line++,U.column=1):U.column++,ie++;return Ce[W]=U,U}function Ze(W,U){var ie=Me(W),ve=Me(U);return{start:{offset:W,line:ie.line,column:ie.column},end:{offset:U,line:ve.line,column:ve.column}}}function $e(W){q<ge||(q>ge&&(ge=q,Ae=[]),Ae.push(W))}function ee(W,U,ie){return new d(d.buildMessage(W,U),W,U,ie)}function Ne(){var W,U,ie,ve;return W=q,U=De(),U!==e?(o.charCodeAt(q)===47?(ie=m,q++):(ie=e,$e(S)),ie!==e?(ve=De(),ve!==e?(ue=W,U=E(U,ve),W=U):(q=W,W=e)):(q=W,W=e)):(q=W,W=e),W===e&&(W=q,U=De(),U!==e&&(ue=W,U=Y(U)),W=U),W}function De(){var W,U,ie,ve;return W=q,U=Re(),U!==e?(o.charCodeAt(q)===64?(ie=y,q++):(ie=e,$e(b)),ie!==e?(ve=we(),ve!==e?(ue=W,U=v(U,ve),W=U):(q=W,W=e)):(q=W,W=e)):(q=W,W=e),W===e&&(W=q,U=Re(),U!==e&&(ue=W,U=M(U)),W=U),W}function Re(){var W,U,ie,ve,Je;return W=q,o.charCodeAt(q)===64?(U=y,q++):(U=e,$e(b)),U!==e?(ie=qe(),ie!==e?(o.charCodeAt(q)===47?(ve=m,q++):(ve=e,$e(S)),ve!==e?(Je=qe(),Je!==e?(ue=W,U=re(),W=U):(q=W,W=e)):(q=W,W=e)):(q=W,W=e)):(q=W,W=e),W===e&&(W=q,U=qe(),U!==e&&(ue=W,U=re()),W=U),W}function qe(){var W,U,ie;if(W=q,U=[],ae.test(o.charAt(q))?(ie=o.charAt(q),q++):(ie=e,$e(x)),ie!==e)for(;ie!==e;)U.push(ie),ae.test(o.charAt(q))?(ie=o.charAt(q),q++):(ie=e,$e(x));else U=e;return U!==e&&(ue=W,U=re()),W=U,W}function we(){var W,U,ie;if(W=q,U=[],Z.test(o.charAt(q))?(ie=o.charAt(q),q++):(ie=e,$e(te)),ie!==e)for(;ie!==e;)U.push(ie),Z.test(o.charAt(q))?(ie=o.charAt(q),q++):(ie=e,$e(te));else U=e;return U!==e&&(ue=W,U=re()),W=U,W}if(Ee=C(),Ee!==e&&q===o.length)return Ee;throw Ee!==e&&q<o.length&&$e(ye()),ee(Ae,ge<o.length?o.charAt(ge):null,ge<o.length?Ze(ge,ge+1):Ze(ge,ge))}return zr={SyntaxError:d,parse:A},zr}var yi;function Sa(){if(yi)return Xt;yi=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.parseResolution=d,Xt.stringifyResolution=A;const l=wa();function d(o){const h=o.match(/^\*{1,2}\/(.*)/);if(h)throw new Error(`The override for '${o}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${h[1]}' instead.`);try{return(0,l.parse)(o)}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function A(o){let h="";return o.from&&(h+=o.from.fullName,o.from.description&&(h+=`@${o.from.description}`),h+="/"),h+=o.descriptor.fullName,o.descriptor.description&&(h+=`@${o.descriptor.description}`),h}return Xt}var Rt={},ke={},Pt={},bt={},vi;function Yt(){if(vi)return bt;vi=1;function l(g){return typeof g>"u"||g===null}function d(g){return typeof g=="object"&&g!==null}function A(g){return Array.isArray(g)?g:l(g)?[]:[g]}function o(g,C){var m,S,E,Y;if(C)for(Y=Object.keys(C),m=0,S=Y.length;m<S;m+=1)E=Y[m],g[E]=C[E];return g}function h(g,C){var m="",S;for(S=0;S<C;S+=1)m+=g;return m}function e(g){return g===0&&Number.NEGATIVE_INFINITY===1/g}return bt.isNothing=l,bt.isObject=d,bt.toArray=A,bt.repeat=h,bt.isNegativeZero=e,bt.extend=o,bt}var Xr,Ai;function rr(){if(Ai)return Xr;Ai=1;function l(d,A){Error.call(this),this.name="YAMLException",this.reason=d,this.mark=A,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return l.prototype=Object.create(Error.prototype),l.prototype.constructor=l,l.prototype.toString=function(d){var A=this.name+": ";return A+=this.reason||"(unknown reason)",!d&&this.mark&&(A+=" "+this.mark.toString()),A},Xr=l,Xr}var Qr,bi;function ka(){if(bi)return Qr;bi=1;var l=Yt();function d(A,o,h,e,g){this.name=A,this.buffer=o,this.position=h,this.line=e,this.column=g}return d.prototype.getSnippet=function(A,o){var h,e,g,C,m;if(!this.buffer)return null;for(A=A||4,o=o||75,h="",e=this.position;e>0&&`\0\r
|
|
9
|
+
\u2028\u2029`.indexOf(this.buffer.charAt(e-1))===-1;)if(e-=1,this.position-e>o/2-1){h=" ... ",e+=5;break}for(g="",C=this.position;C<this.buffer.length&&`\0\r
|
|
10
|
+
\u2028\u2029`.indexOf(this.buffer.charAt(C))===-1;)if(C+=1,C-this.position>o/2-1){g=" ... ",C-=5;break}return m=this.buffer.slice(e,C),l.repeat(" ",A)+h+m+g+`
|
|
11
|
+
`+l.repeat(" ",A+this.position-e+h.length)+"^"},d.prototype.toString=function(A){var o,h="";return this.name&&(h+='in "'+this.name+'" '),h+="at line "+(this.line+1)+", column "+(this.column+1),A||(o=this.getSnippet(),o&&(h+=`:
|
|
12
|
+
`+o)),h},Qr=d,Qr}var en,Ci;function Le(){if(Ci)return en;Ci=1;var l=rr(),d=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],A=["scalar","sequence","mapping"];function o(e){var g={};return e!==null&&Object.keys(e).forEach(function(C){e[C].forEach(function(m){g[String(m)]=C})}),g}function h(e,g){if(g=g||{},Object.keys(g).forEach(function(C){if(d.indexOf(C)===-1)throw new l('Unknown option "'+C+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=g.kind||null,this.resolve=g.resolve||function(){return!0},this.construct=g.construct||function(C){return C},this.instanceOf=g.instanceOf||null,this.predicate=g.predicate||null,this.represent=g.represent||null,this.defaultStyle=g.defaultStyle||null,this.styleAliases=o(g.styleAliases||null),A.indexOf(this.kind)===-1)throw new l('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}return en=h,en}var tn,wi;function Ut(){if(wi)return tn;wi=1;var l=Yt(),d=rr(),A=Le();function o(g,C,m){var S=[];return g.include.forEach(function(E){m=o(E,C,m)}),g[C].forEach(function(E){m.forEach(function(Y,y){Y.tag===E.tag&&Y.kind===E.kind&&S.push(y)}),m.push(E)}),m.filter(function(E,Y){return S.indexOf(Y)===-1})}function h(){var g={scalar:{},sequence:{},mapping:{},fallback:{}},C,m;function S(E){g[E.kind][E.tag]=g.fallback[E.tag]=E}for(C=0,m=arguments.length;C<m;C+=1)arguments[C].forEach(S);return g}function e(g){this.include=g.include||[],this.implicit=g.implicit||[],this.explicit=g.explicit||[],this.implicit.forEach(function(C){if(C.loadKind&&C.loadKind!=="scalar")throw new d("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=o(this,"implicit",[]),this.compiledExplicit=o(this,"explicit",[]),this.compiledTypeMap=h(this.compiledImplicit,this.compiledExplicit)}return e.DEFAULT=null,e.create=function(){var g,C;switch(arguments.length){case 1:g=e.DEFAULT,C=arguments[0];break;case 2:g=arguments[0],C=arguments[1];break;default:throw new d("Wrong number of arguments for Schema.create function")}if(g=l.toArray(g),C=l.toArray(C),!g.every(function(m){return m instanceof e}))throw new d("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!C.every(function(m){return m instanceof A}))throw new d("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new e({include:g,explicit:C})},tn=e,tn}var rn,Si;function Ea(){if(Si)return rn;Si=1;var l=Le();return rn=new l("tag:yaml.org,2002:str",{kind:"scalar",construct:function(d){return d!==null?d:""}}),rn}var nn,ki;function _a(){if(ki)return nn;ki=1;var l=Le();return nn=new l("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(d){return d!==null?d:[]}}),nn}var on,Ei;function $a(){if(Ei)return on;Ei=1;var l=Le();return on=new l("tag:yaml.org,2002:map",{kind:"mapping",construct:function(d){return d!==null?d:{}}}),on}var an,_i;function $n(){if(_i)return an;_i=1;var l=Ut();return an=new l({explicit:[Ea(),_a(),$a()]}),an}var sn,$i;function ja(){if($i)return sn;$i=1;var l=Le();function d(h){if(h===null)return!0;var e=h.length;return e===1&&h==="~"||e===4&&(h==="null"||h==="Null"||h==="NULL")}function A(){return null}function o(h){return h===null}return sn=new l("tag:yaml.org,2002:null",{kind:"scalar",resolve:d,construct:A,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),sn}var un,ji;function Oa(){if(ji)return un;ji=1;var l=Le();function d(h){if(h===null)return!1;var e=h.length;return e===4&&(h==="true"||h==="True"||h==="TRUE")||e===5&&(h==="false"||h==="False"||h==="FALSE")}function A(h){return h==="true"||h==="True"||h==="TRUE"}function o(h){return Object.prototype.toString.call(h)==="[object Boolean]"}return un=new l("tag:yaml.org,2002:bool",{kind:"scalar",resolve:d,construct:A,predicate:o,represent:{lowercase:function(h){return h?"true":"false"},uppercase:function(h){return h?"TRUE":"FALSE"},camelcase:function(h){return h?"True":"False"}},defaultStyle:"lowercase"}),un}var cn,Oi;function xa(){if(Oi)return cn;Oi=1;var l=Yt(),d=Le();function A(m){return 48<=m&&m<=57||65<=m&&m<=70||97<=m&&m<=102}function o(m){return 48<=m&&m<=55}function h(m){return 48<=m&&m<=57}function e(m){if(m===null)return!1;var S=m.length,E=0,Y=!1,y;if(!S)return!1;if(y=m[E],(y==="-"||y==="+")&&(y=m[++E]),y==="0"){if(E+1===S)return!0;if(y=m[++E],y==="b"){for(E++;E<S;E++)if(y=m[E],y!=="_"){if(y!=="0"&&y!=="1")return!1;Y=!0}return Y&&y!=="_"}if(y==="x"){for(E++;E<S;E++)if(y=m[E],y!=="_"){if(!A(m.charCodeAt(E)))return!1;Y=!0}return Y&&y!=="_"}for(;E<S;E++)if(y=m[E],y!=="_"){if(!o(m.charCodeAt(E)))return!1;Y=!0}return Y&&y!=="_"}if(y==="_")return!1;for(;E<S;E++)if(y=m[E],y!=="_"){if(y===":")break;if(!h(m.charCodeAt(E)))return!1;Y=!0}return!Y||y==="_"?!1:y!==":"?!0:/^(:[0-5]?[0-9])+$/.test(m.slice(E))}function g(m){var S=m,E=1,Y,y,b=[];return S.indexOf("_")!==-1&&(S=S.replace(/_/g,"")),Y=S[0],(Y==="-"||Y==="+")&&(Y==="-"&&(E=-1),S=S.slice(1),Y=S[0]),S==="0"?0:Y==="0"?S[1]==="b"?E*parseInt(S.slice(2),2):S[1]==="x"?E*parseInt(S,16):E*parseInt(S,8):S.indexOf(":")!==-1?(S.split(":").forEach(function(v){b.unshift(parseInt(v,10))}),S=0,y=1,b.forEach(function(v){S+=v*y,y*=60}),E*S):E*parseInt(S,10)}function C(m){return Object.prototype.toString.call(m)==="[object Number]"&&m%1===0&&!l.isNegativeZero(m)}return cn=new d("tag:yaml.org,2002:int",{kind:"scalar",resolve:e,construct:g,predicate:C,represent:{binary:function(m){return m>=0?"0b"+m.toString(2):"-0b"+m.toString(2).slice(1)},octal:function(m){return m>=0?"0"+m.toString(8):"-0"+m.toString(8).slice(1)},decimal:function(m){return m.toString(10)},hexadecimal:function(m){return m>=0?"0x"+m.toString(16).toUpperCase():"-0x"+m.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),cn}var ln,xi;function Ra(){if(xi)return ln;xi=1;var l=Yt(),d=Le(),A=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(m){return!(m===null||!A.test(m)||m[m.length-1]==="_")}function h(m){var S,E,Y,y;return S=m.replace(/_/g,"").toLowerCase(),E=S[0]==="-"?-1:1,y=[],"+-".indexOf(S[0])>=0&&(S=S.slice(1)),S===".inf"?E===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:S===".nan"?NaN:S.indexOf(":")>=0?(S.split(":").forEach(function(b){y.unshift(parseFloat(b,10))}),S=0,Y=1,y.forEach(function(b){S+=b*Y,Y*=60}),E*S):E*parseFloat(S,10)}var e=/^[-+]?[0-9]+e/;function g(m,S){var E;if(isNaN(m))switch(S){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===m)switch(S){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===m)switch(S){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(l.isNegativeZero(m))return"-0.0";return E=m.toString(10),e.test(E)?E.replace("e",".e"):E}function C(m){return Object.prototype.toString.call(m)==="[object Number]"&&(m%1!==0||l.isNegativeZero(m))}return ln=new d("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:h,predicate:C,represent:g,defaultStyle:"lowercase"}),ln}var fn,Ri;function oo(){if(Ri)return fn;Ri=1;var l=Ut();return fn=new l({include:[$n()],implicit:[ja(),Oa(),xa(),Ra()]}),fn}var pn,Ti;function ao(){if(Ti)return pn;Ti=1;var l=Ut();return pn=new l({include:[oo()]}),pn}var hn,Li;function Ta(){if(Li)return hn;Li=1;var l=Le(),d=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),A=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function o(g){return g===null?!1:d.exec(g)!==null||A.exec(g)!==null}function h(g){var C,m,S,E,Y,y,b,v=0,M=null,re,ae,x;if(C=d.exec(g),C===null&&(C=A.exec(g)),C===null)throw new Error("Date resolve error");if(m=+C[1],S=+C[2]-1,E=+C[3],!C[4])return new Date(Date.UTC(m,S,E));if(Y=+C[4],y=+C[5],b=+C[6],C[7]){for(v=C[7].slice(0,3);v.length<3;)v+="0";v=+v}return C[9]&&(re=+C[10],ae=+(C[11]||0),M=(re*60+ae)*6e4,C[9]==="-"&&(M=-M)),x=new Date(Date.UTC(m,S,E,Y,y,b,v)),M&&x.setTime(x.getTime()-M),x}function e(g){return g.toISOString()}return hn=new l("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:h,instanceOf:Date,represent:e}),hn}var dn,Fi;function La(){if(Fi)return dn;Fi=1;var l=Le();function d(A){return A==="<<"||A===null}return dn=new l("tag:yaml.org,2002:merge",{kind:"scalar",resolve:d}),dn}function so(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gn,Ii;function Fa(){if(Ii)return gn;Ii=1;var l;try{var d=so;l=d("buffer").Buffer}catch{}var A=Le(),o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
13
|
+
\r`;function h(m){if(m===null)return!1;var S,E,Y=0,y=m.length,b=o;for(E=0;E<y;E++)if(S=b.indexOf(m.charAt(E)),!(S>64)){if(S<0)return!1;Y+=6}return Y%8===0}function e(m){var S,E,Y=m.replace(/[\r\n=]/g,""),y=Y.length,b=o,v=0,M=[];for(S=0;S<y;S++)S%4===0&&S&&(M.push(v>>16&255),M.push(v>>8&255),M.push(v&255)),v=v<<6|b.indexOf(Y.charAt(S));return E=y%4*6,E===0?(M.push(v>>16&255),M.push(v>>8&255),M.push(v&255)):E===18?(M.push(v>>10&255),M.push(v>>2&255)):E===12&&M.push(v>>4&255),l?l.from?l.from(M):new l(M):M}function g(m){var S="",E=0,Y,y,b=m.length,v=o;for(Y=0;Y<b;Y++)Y%3===0&&Y&&(S+=v[E>>18&63],S+=v[E>>12&63],S+=v[E>>6&63],S+=v[E&63]),E=(E<<8)+m[Y];return y=b%3,y===0?(S+=v[E>>18&63],S+=v[E>>12&63],S+=v[E>>6&63],S+=v[E&63]):y===2?(S+=v[E>>10&63],S+=v[E>>4&63],S+=v[E<<2&63],S+=v[64]):y===1&&(S+=v[E>>2&63],S+=v[E<<4&63],S+=v[64],S+=v[64]),S}function C(m){return l&&l.isBuffer(m)}return gn=new A("tag:yaml.org,2002:binary",{kind:"scalar",resolve:h,construct:e,predicate:C,represent:g}),gn}var mn,Ni;function Ia(){if(Ni)return mn;Ni=1;var l=Le(),d=Object.prototype.hasOwnProperty,A=Object.prototype.toString;function o(e){if(e===null)return!0;var g=[],C,m,S,E,Y,y=e;for(C=0,m=y.length;C<m;C+=1){if(S=y[C],Y=!1,A.call(S)!=="[object Object]")return!1;for(E in S)if(d.call(S,E))if(!Y)Y=!0;else return!1;if(!Y)return!1;if(g.indexOf(E)===-1)g.push(E);else return!1}return!0}function h(e){return e!==null?e:[]}return mn=new l("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:h}),mn}var yn,Mi;function Na(){if(Mi)return yn;Mi=1;var l=Le(),d=Object.prototype.toString;function A(h){if(h===null)return!0;var e,g,C,m,S,E=h;for(S=new Array(E.length),e=0,g=E.length;e<g;e+=1){if(C=E[e],d.call(C)!=="[object Object]"||(m=Object.keys(C),m.length!==1))return!1;S[e]=[m[0],C[m[0]]]}return!0}function o(h){if(h===null)return[];var e,g,C,m,S,E=h;for(S=new Array(E.length),e=0,g=E.length;e<g;e+=1)C=E[e],m=Object.keys(C),S[e]=[m[0],C[m[0]]];return S}return yn=new l("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:A,construct:o}),yn}var vn,qi;function Ma(){if(qi)return vn;qi=1;var l=Le(),d=Object.prototype.hasOwnProperty;function A(h){if(h===null)return!0;var e,g=h;for(e in g)if(d.call(g,e)&&g[e]!==null)return!1;return!0}function o(h){return h!==null?h:{}}return vn=new l("tag:yaml.org,2002:set",{kind:"mapping",resolve:A,construct:o}),vn}var An,Pi;function tr(){if(Pi)return An;Pi=1;var l=Ut();return An=new l({include:[ao()],implicit:[Ta(),La()],explicit:[Fa(),Ia(),Na(),Ma()]}),An}var bn,Di;function qa(){if(Di)return bn;Di=1;var l=Le();function d(){return!0}function A(){}function o(){return""}function h(e){return typeof e>"u"}return bn=new l("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:d,construct:A,predicate:h,represent:o}),bn}var Cn,Yi;function Pa(){if(Yi)return Cn;Yi=1;var l=Le();function d(e){if(e===null||e.length===0)return!1;var g=e,C=/\/([gim]*)$/.exec(e),m="";return!(g[0]==="/"&&(C&&(m=C[1]),m.length>3||g[g.length-m.length-1]!=="/"))}function A(e){var g=e,C=/\/([gim]*)$/.exec(e),m="";return g[0]==="/"&&(C&&(m=C[1]),g=g.slice(1,g.length-m.length-1)),new RegExp(g,m)}function o(e){var g="/"+e.source+"/";return e.global&&(g+="g"),e.multiline&&(g+="m"),e.ignoreCase&&(g+="i"),g}function h(e){return Object.prototype.toString.call(e)==="[object RegExp]"}return Cn=new l("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:d,construct:A,predicate:h,represent:o}),Cn}var wn,Ui;function Da(){if(Ui)return wn;Ui=1;var l;try{var d=so;l=d("esprima")}catch{typeof window<"u"&&(l=window.esprima)}var A=Le();function o(C){if(C===null)return!1;try{var m="("+C+")",S=l.parse(m,{range:!0});return!(S.type!=="Program"||S.body.length!==1||S.body[0].type!=="ExpressionStatement"||S.body[0].expression.type!=="ArrowFunctionExpression"&&S.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function h(C){var m="("+C+")",S=l.parse(m,{range:!0}),E=[],Y;if(S.type!=="Program"||S.body.length!==1||S.body[0].type!=="ExpressionStatement"||S.body[0].expression.type!=="ArrowFunctionExpression"&&S.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return S.body[0].expression.params.forEach(function(y){E.push(y.name)}),Y=S.body[0].expression.body.range,S.body[0].expression.body.type==="BlockStatement"?new Function(E,m.slice(Y[0]+1,Y[1]-1)):new Function(E,"return "+m.slice(Y[0],Y[1]))}function e(C){return C.toString()}function g(C){return Object.prototype.toString.call(C)==="[object Function]"}return wn=new A("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:o,construct:h,predicate:g,represent:e}),wn}var Sn,Hi;function Sr(){if(Hi)return Sn;Hi=1;var l=Ut();return Sn=l.DEFAULT=new l({include:[tr()],explicit:[qa(),Pa(),Da()]}),Sn}var Bi;function Ya(){if(Bi)return Pt;Bi=1;var l=Yt(),d=rr(),A=ka(),o=tr(),h=Sr(),e=Object.prototype.hasOwnProperty,g=1,C=2,m=3,S=4,E=1,Y=2,y=3,b=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,M=/[,\[\]\{\}]/,re=/^(?:!|!!|![a-z\-]+!)$/i,ae=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function x(r){return Object.prototype.toString.call(r)}function Z(r){return r===10||r===13}function te(r){return r===9||r===32}function q(r){return r===9||r===32||r===10||r===13}function ue(r){return r===44||r===91||r===93||r===123||r===125}function Ce(r){var $;return 48<=r&&r<=57?r-48:($=r|32,97<=$&&$<=102?$-97+10:-1)}function ge(r){return r===120?2:r===117?4:r===85?8:0}function Ae(r){return 48<=r&&r<=57?r-48:-1}function Ee(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?`
|
|
14
|
+
`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"
":r===95?" ":r===76?"\u2028":r===80?"\u2029":""}function Oe(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}function Fe(r,$,j){$==="__proto__"?Object.defineProperty(r,$,{configurable:!0,enumerable:!0,writable:!0,value:j}):r[$]=j}for(var Ue=new Array(256),ye=new Array(256),Me=0;Me<256;Me++)Ue[Me]=Ee(Me)?1:0,ye[Me]=Ee(Me);function Ze(r,$){this.input=r,this.filename=$.filename||null,this.schema=$.schema||h,this.onWarning=$.onWarning||null,this.legacy=$.legacy||!1,this.json=$.json||!1,this.listener=$.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function $e(r,$){return new d($,new A(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function ee(r,$){throw $e(r,$)}function Ne(r,$){r.onWarning&&r.onWarning.call(null,$e(r,$))}var De={YAML:function(r,$,j){var K,P,u;r.version!==null&&ee(r,"duplication of %YAML directive"),j.length!==1&&ee(r,"YAML directive accepts exactly one argument"),K=/^([0-9]+)\.([0-9]+)$/.exec(j[0]),K===null&&ee(r,"ill-formed argument of the YAML directive"),P=parseInt(K[1],10),u=parseInt(K[2],10),P!==1&&ee(r,"unacceptable YAML version of the document"),r.version=j[0],r.checkLineBreaks=u<2,u!==1&&u!==2&&Ne(r,"unsupported YAML version of the document")},TAG:function(r,$,j){var K,P;j.length!==2&&ee(r,"TAG directive accepts exactly two arguments"),K=j[0],P=j[1],re.test(K)||ee(r,"ill-formed tag handle (first argument) of the TAG directive"),e.call(r.tagMap,K)&&ee(r,'there is a previously declared suffix for "'+K+'" tag handle'),ae.test(P)||ee(r,"ill-formed tag prefix (second argument) of the TAG directive"),r.tagMap[K]=P}};function Re(r,$,j,K){var P,u,w,O;if($<j){if(O=r.input.slice($,j),K)for(P=0,u=O.length;P<u;P+=1)w=O.charCodeAt(P),w===9||32<=w&&w<=1114111||ee(r,"expected valid JSON character");else b.test(O)&&ee(r,"the stream contains non-printable characters");r.result+=O}}function qe(r,$,j,K){var P,u,w,O;for(l.isObject(j)||ee(r,"cannot merge mappings; the provided source object is unacceptable"),P=Object.keys(j),w=0,O=P.length;w<O;w+=1)u=P[w],e.call($,u)||(Fe($,u,j[u]),K[u]=!0)}function we(r,$,j,K,P,u,w,O){var R,N;if(Array.isArray(P))for(P=Array.prototype.slice.call(P),R=0,N=P.length;R<N;R+=1)Array.isArray(P[R])&&ee(r,"nested arrays are not supported inside keys"),typeof P=="object"&&x(P[R])==="[object Object]"&&(P[R]="[object Object]");if(typeof P=="object"&&x(P)==="[object Object]"&&(P="[object Object]"),P=String(P),$===null&&($={}),K==="tag:yaml.org,2002:merge")if(Array.isArray(u))for(R=0,N=u.length;R<N;R+=1)qe(r,$,u[R],j);else qe(r,$,u,j);else!r.json&&!e.call(j,P)&&e.call($,P)&&(r.line=w||r.line,r.position=O||r.position,ee(r,"duplicated mapping key")),Fe($,P,u),delete j[P];return $}function W(r){var $;$=r.input.charCodeAt(r.position),$===10?r.position++:$===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):ee(r,"a line break is expected"),r.line+=1,r.lineStart=r.position}function U(r,$,j){for(var K=0,P=r.input.charCodeAt(r.position);P!==0;){for(;te(P);)P=r.input.charCodeAt(++r.position);if($&&P===35)do P=r.input.charCodeAt(++r.position);while(P!==10&&P!==13&&P!==0);if(Z(P))for(W(r),P=r.input.charCodeAt(r.position),K++,r.lineIndent=0;P===32;)r.lineIndent++,P=r.input.charCodeAt(++r.position);else break}return j!==-1&&K!==0&&r.lineIndent<j&&Ne(r,"deficient indentation"),K}function ie(r){var $=r.position,j;return j=r.input.charCodeAt($),!!((j===45||j===46)&&j===r.input.charCodeAt($+1)&&j===r.input.charCodeAt($+2)&&($+=3,j=r.input.charCodeAt($),j===0||q(j)))}function ve(r,$){$===1?r.result+=" ":$>1&&(r.result+=l.repeat(`
|
|
15
|
+
`,$-1))}function Je(r,$,j){var K,P,u,w,O,R,N,H,T=r.kind,z=r.result,G;if(G=r.input.charCodeAt(r.position),q(G)||ue(G)||G===35||G===38||G===42||G===33||G===124||G===62||G===39||G===34||G===37||G===64||G===96||(G===63||G===45)&&(P=r.input.charCodeAt(r.position+1),q(P)||j&&ue(P)))return!1;for(r.kind="scalar",r.result="",u=w=r.position,O=!1;G!==0;){if(G===58){if(P=r.input.charCodeAt(r.position+1),q(P)||j&&ue(P))break}else if(G===35){if(K=r.input.charCodeAt(r.position-1),q(K))break}else{if(r.position===r.lineStart&&ie(r)||j&&ue(G))break;if(Z(G))if(R=r.line,N=r.lineStart,H=r.lineIndent,U(r,!1,-1),r.lineIndent>=$){O=!0,G=r.input.charCodeAt(r.position);continue}else{r.position=w,r.line=R,r.lineStart=N,r.lineIndent=H;break}}O&&(Re(r,u,w,!1),ve(r,r.line-R),u=w=r.position,O=!1),te(G)||(w=r.position+1),G=r.input.charCodeAt(++r.position)}return Re(r,u,w,!1),r.result?!0:(r.kind=T,r.result=z,!1)}function ze(r,$){var j,K,P;if(j=r.input.charCodeAt(r.position),j!==39)return!1;for(r.kind="scalar",r.result="",r.position++,K=P=r.position;(j=r.input.charCodeAt(r.position))!==0;)if(j===39)if(Re(r,K,r.position,!0),j=r.input.charCodeAt(++r.position),j===39)K=r.position,r.position++,P=r.position;else return!0;else Z(j)?(Re(r,K,P,!0),ve(r,U(r,!1,$)),K=P=r.position):r.position===r.lineStart&&ie(r)?ee(r,"unexpected end of the document within a single quoted scalar"):(r.position++,P=r.position);ee(r,"unexpected end of the stream within a single quoted scalar")}function Pe(r,$){var j,K,P,u,w,O;if(O=r.input.charCodeAt(r.position),O!==34)return!1;for(r.kind="scalar",r.result="",r.position++,j=K=r.position;(O=r.input.charCodeAt(r.position))!==0;){if(O===34)return Re(r,j,r.position,!0),r.position++,!0;if(O===92){if(Re(r,j,r.position,!0),O=r.input.charCodeAt(++r.position),Z(O))U(r,!1,$);else if(O<256&&Ue[O])r.result+=ye[O],r.position++;else if((w=ge(O))>0){for(P=w,u=0;P>0;P--)O=r.input.charCodeAt(++r.position),(w=Ce(O))>=0?u=(u<<4)+w:ee(r,"expected hexadecimal character");r.result+=Oe(u),r.position++}else ee(r,"unknown escape sequence");j=K=r.position}else Z(O)?(Re(r,j,K,!0),ve(r,U(r,!1,$)),j=K=r.position):r.position===r.lineStart&&ie(r)?ee(r,"unexpected end of the document within a double quoted scalar"):(r.position++,K=r.position)}ee(r,"unexpected end of the stream within a double quoted scalar")}function Ye(r,$){var j=!0,K,P=r.tag,u,w=r.anchor,O,R,N,H,T,z={},G,ne,de,le;if(le=r.input.charCodeAt(r.position),le===91)R=93,T=!1,u=[];else if(le===123)R=125,T=!0,u={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=u),le=r.input.charCodeAt(++r.position);le!==0;){if(U(r,!0,$),le=r.input.charCodeAt(r.position),le===R)return r.position++,r.tag=P,r.anchor=w,r.kind=T?"mapping":"sequence",r.result=u,!0;j||ee(r,"missed comma between flow collection entries"),ne=G=de=null,N=H=!1,le===63&&(O=r.input.charCodeAt(r.position+1),q(O)&&(N=H=!0,r.position++,U(r,!0,$))),K=r.line,He(r,$,g,!1,!0),ne=r.tag,G=r.result,U(r,!0,$),le=r.input.charCodeAt(r.position),(H||r.line===K)&&le===58&&(N=!0,le=r.input.charCodeAt(++r.position),U(r,!0,$),He(r,$,g,!1,!0),de=r.result),T?we(r,u,z,ne,G,de):N?u.push(we(r,null,z,ne,G,de)):u.push(G),U(r,!0,$),le=r.input.charCodeAt(r.position),le===44?(j=!0,le=r.input.charCodeAt(++r.position)):j=!1}ee(r,"unexpected end of the stream within a flow collection")}function tt(r,$){var j,K,P=E,u=!1,w=!1,O=$,R=0,N=!1,H,T;if(T=r.input.charCodeAt(r.position),T===124)K=!1;else if(T===62)K=!0;else return!1;for(r.kind="scalar",r.result="";T!==0;)if(T=r.input.charCodeAt(++r.position),T===43||T===45)E===P?P=T===43?y:Y:ee(r,"repeat of a chomping mode identifier");else if((H=Ae(T))>=0)H===0?ee(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):w?ee(r,"repeat of an indentation width identifier"):(O=$+H-1,w=!0);else break;if(te(T)){do T=r.input.charCodeAt(++r.position);while(te(T));if(T===35)do T=r.input.charCodeAt(++r.position);while(!Z(T)&&T!==0)}for(;T!==0;){for(W(r),r.lineIndent=0,T=r.input.charCodeAt(r.position);(!w||r.lineIndent<O)&&T===32;)r.lineIndent++,T=r.input.charCodeAt(++r.position);if(!w&&r.lineIndent>O&&(O=r.lineIndent),Z(T)){R++;continue}if(r.lineIndent<O){P===y?r.result+=l.repeat(`
|
|
16
|
+
`,u?1+R:R):P===E&&u&&(r.result+=`
|
|
17
|
+
`);break}for(K?te(T)?(N=!0,r.result+=l.repeat(`
|
|
18
|
+
`,u?1+R:R)):N?(N=!1,r.result+=l.repeat(`
|
|
19
|
+
`,R+1)):R===0?u&&(r.result+=" "):r.result+=l.repeat(`
|
|
20
|
+
`,R):r.result+=l.repeat(`
|
|
21
|
+
`,u?1+R:R),u=!0,w=!0,R=0,j=r.position;!Z(T)&&T!==0;)T=r.input.charCodeAt(++r.position);Re(r,j,r.position,!1)}return!0}function rt(r,$){var j,K=r.tag,P=r.anchor,u=[],w,O=!1,R;for(r.anchor!==null&&(r.anchorMap[r.anchor]=u),R=r.input.charCodeAt(r.position);R!==0&&!(R!==45||(w=r.input.charCodeAt(r.position+1),!q(w)));){if(O=!0,r.position++,U(r,!0,-1)&&r.lineIndent<=$){u.push(null),R=r.input.charCodeAt(r.position);continue}if(j=r.line,He(r,$,m,!1,!0),u.push(r.result),U(r,!0,-1),R=r.input.charCodeAt(r.position),(r.line===j||r.lineIndent>$)&&R!==0)ee(r,"bad indentation of a sequence entry");else if(r.lineIndent<$)break}return O?(r.tag=K,r.anchor=P,r.kind="sequence",r.result=u,!0):!1}function Ct(r,$,j){var K,P,u,w,O=r.tag,R=r.anchor,N={},H={},T=null,z=null,G=null,ne=!1,de=!1,le;for(r.anchor!==null&&(r.anchorMap[r.anchor]=N),le=r.input.charCodeAt(r.position);le!==0;){if(K=r.input.charCodeAt(r.position+1),u=r.line,w=r.position,(le===63||le===58)&&q(K))le===63?(ne&&(we(r,N,H,T,z,null),T=z=G=null),de=!0,ne=!0,P=!0):ne?(ne=!1,P=!0):ee(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,le=K;else if(He(r,j,C,!1,!0))if(r.line===u){for(le=r.input.charCodeAt(r.position);te(le);)le=r.input.charCodeAt(++r.position);if(le===58)le=r.input.charCodeAt(++r.position),q(le)||ee(r,"a whitespace character is expected after the key-value separator within a block mapping"),ne&&(we(r,N,H,T,z,null),T=z=G=null),de=!0,ne=!1,P=!1,T=r.tag,z=r.result;else if(de)ee(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=O,r.anchor=R,!0}else if(de)ee(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=O,r.anchor=R,!0;else break;if((r.line===u||r.lineIndent>$)&&(He(r,$,S,!0,P)&&(ne?z=r.result:G=r.result),ne||(we(r,N,H,T,z,G,u,w),T=z=G=null),U(r,!0,-1),le=r.input.charCodeAt(r.position)),r.lineIndent>$&&le!==0)ee(r,"bad indentation of a mapping entry");else if(r.lineIndent<$)break}return ne&&we(r,N,H,T,z,null),de&&(r.tag=O,r.anchor=R,r.kind="mapping",r.result=N),de}function st(r){var $,j=!1,K=!1,P,u,w;if(w=r.input.charCodeAt(r.position),w!==33)return!1;if(r.tag!==null&&ee(r,"duplication of a tag property"),w=r.input.charCodeAt(++r.position),w===60?(j=!0,w=r.input.charCodeAt(++r.position)):w===33?(K=!0,P="!!",w=r.input.charCodeAt(++r.position)):P="!",$=r.position,j){do w=r.input.charCodeAt(++r.position);while(w!==0&&w!==62);r.position<r.length?(u=r.input.slice($,r.position),w=r.input.charCodeAt(++r.position)):ee(r,"unexpected end of the stream within a verbatim tag")}else{for(;w!==0&&!q(w);)w===33&&(K?ee(r,"tag suffix cannot contain exclamation marks"):(P=r.input.slice($-1,r.position+1),re.test(P)||ee(r,"named tag handle cannot contain such characters"),K=!0,$=r.position+1)),w=r.input.charCodeAt(++r.position);u=r.input.slice($,r.position),M.test(u)&&ee(r,"tag suffix cannot contain flow indicator characters")}return u&&!ae.test(u)&&ee(r,"tag name cannot contain such characters: "+u),j?r.tag=u:e.call(r.tagMap,P)?r.tag=r.tagMap[P]+u:P==="!"?r.tag="!"+u:P==="!!"?r.tag="tag:yaml.org,2002:"+u:ee(r,'undeclared tag handle "'+P+'"'),!0}function ut(r){var $,j;if(j=r.input.charCodeAt(r.position),j!==38)return!1;for(r.anchor!==null&&ee(r,"duplication of an anchor property"),j=r.input.charCodeAt(++r.position),$=r.position;j!==0&&!q(j)&&!ue(j);)j=r.input.charCodeAt(++r.position);return r.position===$&&ee(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice($,r.position),!0}function wt(r){var $,j,K;if(K=r.input.charCodeAt(r.position),K!==42)return!1;for(K=r.input.charCodeAt(++r.position),$=r.position;K!==0&&!q(K)&&!ue(K);)K=r.input.charCodeAt(++r.position);return r.position===$&&ee(r,"name of an alias node must contain at least one character"),j=r.input.slice($,r.position),e.call(r.anchorMap,j)||ee(r,'unidentified alias "'+j+'"'),r.result=r.anchorMap[j],U(r,!0,-1),!0}function He(r,$,j,K,P){var u,w,O,R=1,N=!1,H=!1,T,z,G,ne,de;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,u=w=O=S===j||m===j,K&&U(r,!0,-1)&&(N=!0,r.lineIndent>$?R=1:r.lineIndent===$?R=0:r.lineIndent<$&&(R=-1)),R===1)for(;st(r)||ut(r);)U(r,!0,-1)?(N=!0,O=u,r.lineIndent>$?R=1:r.lineIndent===$?R=0:r.lineIndent<$&&(R=-1)):O=!1;if(O&&(O=N||P),(R===1||S===j)&&(g===j||C===j?ne=$:ne=$+1,de=r.position-r.lineStart,R===1?O&&(rt(r,de)||Ct(r,de,ne))||Ye(r,ne)?H=!0:(w&&tt(r,ne)||ze(r,ne)||Pe(r,ne)?H=!0:wt(r)?(H=!0,(r.tag!==null||r.anchor!==null)&&ee(r,"alias node should not have any properties")):Je(r,ne,g===j)&&(H=!0,r.tag===null&&(r.tag="?")),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):R===0&&(H=O&&rt(r,de))),r.tag!==null&&r.tag!=="!")if(r.tag==="?"){for(r.result!==null&&r.kind!=="scalar"&&ee(r,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+r.kind+'"'),T=0,z=r.implicitTypes.length;T<z;T+=1)if(G=r.implicitTypes[T],G.resolve(r.result)){r.result=G.construct(r.result),r.tag=G.tag,r.anchor!==null&&(r.anchorMap[r.anchor]=r.result);break}}else e.call(r.typeMap[r.kind||"fallback"],r.tag)?(G=r.typeMap[r.kind||"fallback"][r.tag],r.result!==null&&G.kind!==r.kind&&ee(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+G.kind+'", not "'+r.kind+'"'),G.resolve(r.result)?(r.result=G.construct(r.result),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):ee(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")):ee(r,"unknown tag !<"+r.tag+">");return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||H}function ht(r){var $=r.position,j,K,P,u=!1,w;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap={},r.anchorMap={};(w=r.input.charCodeAt(r.position))!==0&&(U(r,!0,-1),w=r.input.charCodeAt(r.position),!(r.lineIndent>0||w!==37));){for(u=!0,w=r.input.charCodeAt(++r.position),j=r.position;w!==0&&!q(w);)w=r.input.charCodeAt(++r.position);for(K=r.input.slice(j,r.position),P=[],K.length<1&&ee(r,"directive name must not be less than one character in length");w!==0;){for(;te(w);)w=r.input.charCodeAt(++r.position);if(w===35){do w=r.input.charCodeAt(++r.position);while(w!==0&&!Z(w));break}if(Z(w))break;for(j=r.position;w!==0&&!q(w);)w=r.input.charCodeAt(++r.position);P.push(r.input.slice(j,r.position))}w!==0&&W(r),e.call(De,K)?De[K](r,K,P):Ne(r,'unknown document directive "'+K+'"')}if(U(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,U(r,!0,-1)):u&&ee(r,"directives end mark is expected"),He(r,r.lineIndent-1,S,!1,!0),U(r,!0,-1),r.checkLineBreaks&&v.test(r.input.slice($,r.position))&&Ne(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&ie(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,U(r,!0,-1));return}if(r.position<r.length-1)ee(r,"end of the stream or a document separator is expected");else return}function Xe(r,$){r=String(r),$=$||{},r.length!==0&&(r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
|
|
22
|
+
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));var j=new Ze(r,$),K=r.indexOf("\0");for(K!==-1&&(j.position=K,ee(j,"null byte is not allowed in input")),j.input+="\0";j.input.charCodeAt(j.position)===32;)j.lineIndent+=1,j.position+=1;for(;j.position<j.length-1;)ht(j);return j.documents}function Ve(r,$,j){$!==null&&typeof $=="object"&&typeof j>"u"&&(j=$,$=null);var K=Xe(r,j);if(typeof $!="function")return K;for(var P=0,u=K.length;P<u;P+=1)$(K[P])}function dt(r,$){var j=Xe(r,$);if(j.length!==0){if(j.length===1)return j[0];throw new d("expected a single document in the stream, but found more")}}function St(r,$,j){return typeof $=="object"&&$!==null&&typeof j>"u"&&(j=$,$=null),Ve(r,$,l.extend({schema:o},j))}function gt(r,$){return dt(r,l.extend({schema:o},$))}return Pt.loadAll=Ve,Pt.load=dt,Pt.safeLoadAll=St,Pt.safeLoad=gt,Pt}var Cr={},Wi;function Ua(){if(Wi)return Cr;Wi=1;var l=Yt(),d=rr(),A=Sr(),o=tr(),h=Object.prototype.toString,e=Object.prototype.hasOwnProperty,g=9,C=10,m=13,S=32,E=33,Y=34,y=35,b=37,v=38,M=39,re=42,ae=44,x=45,Z=58,te=61,q=62,ue=63,Ce=64,ge=91,Ae=93,Ee=96,Oe=123,Fe=124,Ue=125,ye={};ye[0]="\\0",ye[7]="\\a",ye[8]="\\b",ye[9]="\\t",ye[10]="\\n",ye[11]="\\v",ye[12]="\\f",ye[13]="\\r",ye[27]="\\e",ye[34]='\\"',ye[92]="\\\\",ye[133]="\\N",ye[160]="\\_",ye[8232]="\\L",ye[8233]="\\P";var Me=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Ze(u,w){var O,R,N,H,T,z,G;if(w===null)return{};for(O={},R=Object.keys(w),N=0,H=R.length;N<H;N+=1)T=R[N],z=String(w[T]),T.slice(0,2)==="!!"&&(T="tag:yaml.org,2002:"+T.slice(2)),G=u.compiledTypeMap.fallback[T],G&&e.call(G.styleAliases,z)&&(z=G.styleAliases[z]),O[T]=z;return O}function $e(u){var w,O,R;if(w=u.toString(16).toUpperCase(),u<=255)O="x",R=2;else if(u<=65535)O="u",R=4;else if(u<=4294967295)O="U",R=8;else throw new d("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+O+l.repeat("0",R-w.length)+w}function ee(u){this.schema=u.schema||A,this.indent=Math.max(1,u.indent||2),this.noArrayIndent=u.noArrayIndent||!1,this.skipInvalid=u.skipInvalid||!1,this.flowLevel=l.isNothing(u.flowLevel)?-1:u.flowLevel,this.styleMap=Ze(this.schema,u.styles||null),this.sortKeys=u.sortKeys||!1,this.lineWidth=u.lineWidth||80,this.noRefs=u.noRefs||!1,this.noCompatMode=u.noCompatMode||!1,this.condenseFlow=u.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ne(u,w){for(var O=l.repeat(" ",w),R=0,N=-1,H="",T,z=u.length;R<z;)N=u.indexOf(`
|
|
23
|
+
`,R),N===-1?(T=u.slice(R),R=z):(T=u.slice(R,N+1),R=N+1),T.length&&T!==`
|
|
24
|
+
`&&(H+=O),H+=T;return H}function De(u,w){return`
|
|
25
|
+
`+l.repeat(" ",u.indent*w)}function Re(u,w){var O,R,N;for(O=0,R=u.implicitTypes.length;O<R;O+=1)if(N=u.implicitTypes[O],N.resolve(w))return!0;return!1}function qe(u){return u===S||u===g}function we(u){return 32<=u&&u<=126||161<=u&&u<=55295&&u!==8232&&u!==8233||57344<=u&&u<=65533&&u!==65279||65536<=u&&u<=1114111}function W(u){return we(u)&&!qe(u)&&u!==65279&&u!==m&&u!==C}function U(u,w){return we(u)&&u!==65279&&u!==ae&&u!==ge&&u!==Ae&&u!==Oe&&u!==Ue&&u!==Z&&(u!==y||w&&W(w))}function ie(u){return we(u)&&u!==65279&&!qe(u)&&u!==x&&u!==ue&&u!==Z&&u!==ae&&u!==ge&&u!==Ae&&u!==Oe&&u!==Ue&&u!==y&&u!==v&&u!==re&&u!==E&&u!==Fe&&u!==te&&u!==q&&u!==M&&u!==Y&&u!==b&&u!==Ce&&u!==Ee}function ve(u){var w=/^\n* /;return w.test(u)}var Je=1,ze=2,Pe=3,Ye=4,tt=5;function rt(u,w,O,R,N){var H,T,z,G=!1,ne=!1,de=R!==-1,le=-1,_e=ie(u.charCodeAt(0))&&!qe(u.charCodeAt(u.length-1));if(w)for(H=0;H<u.length;H++){if(T=u.charCodeAt(H),!we(T))return tt;z=H>0?u.charCodeAt(H-1):null,_e=_e&&U(T,z)}else{for(H=0;H<u.length;H++){if(T=u.charCodeAt(H),T===C)G=!0,de&&(ne=ne||H-le-1>R&&u[le+1]!==" ",le=H);else if(!we(T))return tt;z=H>0?u.charCodeAt(H-1):null,_e=_e&&U(T,z)}ne=ne||de&&H-le-1>R&&u[le+1]!==" "}return!G&&!ne?_e&&!N(u)?Je:ze:O>9&&ve(u)?tt:ne?Ye:Pe}function Ct(u,w,O,R){u.dump=(function(){if(w.length===0)return"''";if(!u.noCompatMode&&Me.indexOf(w)!==-1)return"'"+w+"'";var N=u.indent*Math.max(1,O),H=u.lineWidth===-1?-1:Math.max(Math.min(u.lineWidth,40),u.lineWidth-N),T=R||u.flowLevel>-1&&O>=u.flowLevel;function z(G){return Re(u,G)}switch(rt(w,T,u.indent,H,z)){case Je:return w;case ze:return"'"+w.replace(/'/g,"''")+"'";case Pe:return"|"+st(w,u.indent)+ut(Ne(w,N));case Ye:return">"+st(w,u.indent)+ut(Ne(wt(w,H),N));case tt:return'"'+ht(w)+'"';default:throw new d("impossible error: invalid scalar style")}})()}function st(u,w){var O=ve(u)?String(w):"",R=u[u.length-1]===`
|
|
26
|
+
`,N=R&&(u[u.length-2]===`
|
|
27
|
+
`||u===`
|
|
28
|
+
`),H=N?"+":R?"":"-";return O+H+`
|
|
29
|
+
`}function ut(u){return u[u.length-1]===`
|
|
30
|
+
`?u.slice(0,-1):u}function wt(u,w){for(var O=/(\n+)([^\n]*)/g,R=(function(){var ne=u.indexOf(`
|
|
31
|
+
`);return ne=ne!==-1?ne:u.length,O.lastIndex=ne,He(u.slice(0,ne),w)})(),N=u[0]===`
|
|
32
|
+
`||u[0]===" ",H,T;T=O.exec(u);){var z=T[1],G=T[2];H=G[0]===" ",R+=z+(!N&&!H&&G!==""?`
|
|
33
|
+
`:"")+He(G,w),N=H}return R}function He(u,w){if(u===""||u[0]===" ")return u;for(var O=/ [^ ]/g,R,N=0,H,T=0,z=0,G="";R=O.exec(u);)z=R.index,z-N>w&&(H=T>N?T:z,G+=`
|
|
34
|
+
`+u.slice(N,H),N=H+1),T=z;return G+=`
|
|
35
|
+
`,u.length-N>w&&T>N?G+=u.slice(N,T)+`
|
|
36
|
+
`+u.slice(T+1):G+=u.slice(N),G.slice(1)}function ht(u){for(var w="",O,R,N,H=0;H<u.length;H++){if(O=u.charCodeAt(H),O>=55296&&O<=56319&&(R=u.charCodeAt(H+1),R>=56320&&R<=57343)){w+=$e((O-55296)*1024+R-56320+65536),H++;continue}N=ye[O],w+=!N&&we(O)?u[H]:N||$e(O)}return w}function Xe(u,w,O){var R="",N=u.tag,H,T;for(H=0,T=O.length;H<T;H+=1)r(u,w,O[H],!1,!1)&&(H!==0&&(R+=","+(u.condenseFlow?"":" ")),R+=u.dump);u.tag=N,u.dump="["+R+"]"}function Ve(u,w,O,R){var N="",H=u.tag,T,z;for(T=0,z=O.length;T<z;T+=1)r(u,w+1,O[T],!0,!0)&&((!R||T!==0)&&(N+=De(u,w)),u.dump&&C===u.dump.charCodeAt(0)?N+="-":N+="- ",N+=u.dump);u.tag=H,u.dump=N||"[]"}function dt(u,w,O){var R="",N=u.tag,H=Object.keys(O),T,z,G,ne,de;for(T=0,z=H.length;T<z;T+=1)de="",T!==0&&(de+=", "),u.condenseFlow&&(de+='"'),G=H[T],ne=O[G],r(u,w,G,!1,!1)&&(u.dump.length>1024&&(de+="? "),de+=u.dump+(u.condenseFlow?'"':"")+":"+(u.condenseFlow?"":" "),r(u,w,ne,!1,!1)&&(de+=u.dump,R+=de));u.tag=N,u.dump="{"+R+"}"}function St(u,w,O,R){var N="",H=u.tag,T=Object.keys(O),z,G,ne,de,le,_e;if(u.sortKeys===!0)T.sort();else if(typeof u.sortKeys=="function")T.sort(u.sortKeys);else if(u.sortKeys)throw new d("sortKeys must be a boolean or a function");for(z=0,G=T.length;z<G;z+=1)_e="",(!R||z!==0)&&(_e+=De(u,w)),ne=T[z],de=O[ne],r(u,w+1,ne,!0,!0,!0)&&(le=u.tag!==null&&u.tag!=="?"||u.dump&&u.dump.length>1024,le&&(u.dump&&C===u.dump.charCodeAt(0)?_e+="?":_e+="? "),_e+=u.dump,le&&(_e+=De(u,w)),r(u,w+1,de,!0,le)&&(u.dump&&C===u.dump.charCodeAt(0)?_e+=":":_e+=": ",_e+=u.dump,N+=_e));u.tag=H,u.dump=N||"{}"}function gt(u,w,O){var R,N,H,T,z,G;for(N=O?u.explicitTypes:u.implicitTypes,H=0,T=N.length;H<T;H+=1)if(z=N[H],(z.instanceOf||z.predicate)&&(!z.instanceOf||typeof w=="object"&&w instanceof z.instanceOf)&&(!z.predicate||z.predicate(w))){if(u.tag=O?z.tag:"?",z.represent){if(G=u.styleMap[z.tag]||z.defaultStyle,h.call(z.represent)==="[object Function]")R=z.represent(w,G);else if(e.call(z.represent,G))R=z.represent[G](w,G);else throw new d("!<"+z.tag+'> tag resolver accepts not "'+G+'" style');u.dump=R}return!0}return!1}function r(u,w,O,R,N,H){u.tag=null,u.dump=O,gt(u,O,!1)||gt(u,O,!0);var T=h.call(u.dump);R&&(R=u.flowLevel<0||u.flowLevel>w);var z=T==="[object Object]"||T==="[object Array]",G,ne;if(z&&(G=u.duplicates.indexOf(O),ne=G!==-1),(u.tag!==null&&u.tag!=="?"||ne||u.indent!==2&&w>0)&&(N=!1),ne&&u.usedDuplicates[G])u.dump="*ref_"+G;else{if(z&&ne&&!u.usedDuplicates[G]&&(u.usedDuplicates[G]=!0),T==="[object Object]")R&&Object.keys(u.dump).length!==0?(St(u,w,u.dump,N),ne&&(u.dump="&ref_"+G+u.dump)):(dt(u,w,u.dump),ne&&(u.dump="&ref_"+G+" "+u.dump));else if(T==="[object Array]"){var de=u.noArrayIndent&&w>0?w-1:w;R&&u.dump.length!==0?(Ve(u,de,u.dump,N),ne&&(u.dump="&ref_"+G+u.dump)):(Xe(u,de,u.dump),ne&&(u.dump="&ref_"+G+" "+u.dump))}else if(T==="[object String]")u.tag!=="?"&&Ct(u,u.dump,w,H);else{if(u.skipInvalid)return!1;throw new d("unacceptable kind of an object to dump "+T)}u.tag!==null&&u.tag!=="?"&&(u.dump="!<"+u.tag+"> "+u.dump)}return!0}function $(u,w){var O=[],R=[],N,H;for(j(u,O,R),N=0,H=R.length;N<H;N+=1)w.duplicates.push(O[R[N]]);w.usedDuplicates=new Array(H)}function j(u,w,O){var R,N,H;if(u!==null&&typeof u=="object")if(N=w.indexOf(u),N!==-1)O.indexOf(N)===-1&&O.push(N);else if(w.push(u),Array.isArray(u))for(N=0,H=u.length;N<H;N+=1)j(u[N],w,O);else for(R=Object.keys(u),N=0,H=R.length;N<H;N+=1)j(u[R[N]],w,O)}function K(u,w){w=w||{};var O=new ee(w);return O.noRefs||$(u,O),r(O,0,u,!0,!0)?O.dump+`
|
|
37
|
+
`:""}function P(u,w){return K(u,l.extend({schema:o},w))}return Cr.dump=K,Cr.safeDump=P,Cr}var Gi;function Ha(){if(Gi)return ke;Gi=1;var l=Ya(),d=Ua();function A(o){return function(){throw new Error("Function "+o+" is deprecated and cannot be used.")}}return ke.Type=Le(),ke.Schema=Ut(),ke.FAILSAFE_SCHEMA=$n(),ke.JSON_SCHEMA=oo(),ke.CORE_SCHEMA=ao(),ke.DEFAULT_SAFE_SCHEMA=tr(),ke.DEFAULT_FULL_SCHEMA=Sr(),ke.load=l.load,ke.loadAll=l.loadAll,ke.safeLoad=l.safeLoad,ke.safeLoadAll=l.safeLoadAll,ke.dump=d.dump,ke.safeDump=d.safeDump,ke.YAMLException=rr(),ke.MINIMAL_SCHEMA=$n(),ke.SAFE_SCHEMA=tr(),ke.DEFAULT_SCHEMA=Sr(),ke.scan=A("scan"),ke.parse=A("parse"),ke.compose=A("compose"),ke.addConstructor=A("addConstructor"),ke}var kn,Ji;function Ba(){if(Ji)return kn;Ji=1;var l=Ha();return kn=l,kn}var En,Vi;function Wa(){if(Vi)return En;Vi=1;function l(o,h){function e(){this.constructor=o}e.prototype=h.prototype,o.prototype=new e}function d(o,h,e,g){this.message=o,this.expected=h,this.found=e,this.location=g,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,d)}l(d,Error),d.buildMessage=function(o,h){var e={literal:function(y){return'"'+C(y.text)+'"'},class:function(y){var b="",v;for(v=0;v<y.parts.length;v++)b+=y.parts[v]instanceof Array?m(y.parts[v][0])+"-"+m(y.parts[v][1]):m(y.parts[v]);return"["+(y.inverted?"^":"")+b+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function g(y){return y.charCodeAt(0).toString(16).toUpperCase()}function C(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+g(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+g(b)})}function S(y){return e[y.type](y)}function E(y){var b=new Array(y.length),v,M;for(v=0;v<y.length;v++)b[v]=S(y[v]);if(b.sort(),b.length>0){for(v=1,M=1;v<b.length;v++)b[v-1]!==b[v]&&(b[M]=b[v],M++);b.length=M}switch(b.length){case 1:return b[0];case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}function Y(y){return y?'"'+C(y)+'"':"end of input"}return"Expected "+E(o)+" but "+Y(h)+" found."};function A(o,h){h=h!==void 0?h:{};var e={},g={Start:fr},C=fr,m=function(s){return[].concat(...s)},S="-",E=be("-",!1),Y=function(s){return s},y=function(s){return Object.assign({},...s)},b="#",v=be("#",!1),M=Lr(),re=function(){return{}},ae=":",x=be(":",!1),Z=function(s,p){return{[s]:p}},te=",",q=be(",",!1),ue=function(s,p){return p},Ce=function(s,p,_){return Object.assign({},...[s].concat(p).map(B=>({[B]:_})))},ge=function(s){return s},Ae=function(s){return s},Ee=Et("correct indentation"),Oe=" ",Fe=be(" ",!1),Ue=function(s){return s.length===qt*mr},ye=function(s){return s.length===(qt+1)*mr},Me=function(){return qt++,!0},Ze=function(){return qt--,!0},$e=function(){return ur()},ee=Et("pseudostring"),Ne=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,De=nt(["\r",`
|
|
38
|
+
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Re=/^[^\r\n\t ,\][{}:#"']/,qe=nt(["\r",`
|
|
39
|
+
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),we=function(){return ur().replace(/^ *| *$/g,"")},W="--",U=be("--",!1),ie=/^[a-zA-Z\/0-9]/,ve=nt([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Je=/^[^\r\n\t :,]/,ze=nt(["\r",`
|
|
40
|
+
`," "," ",":",","],!0,!1),Pe="null",Ye=be("null",!1),tt=function(){return null},rt="true",Ct=be("true",!1),st=function(){return!0},ut="false",wt=be("false",!1),He=function(){return!1},ht=Et("string"),Xe='"',Ve=be('"',!1),dt=function(){return""},St=function(s){return s},gt=function(s){return s.join("")},r=/^[^"\\\0-\x1F\x7F]/,$=nt(['"',"\\",["\0",""],""],!0,!1),j='\\"',K=be('\\"',!1),P=function(){return'"'},u="\\\\",w=be("\\\\",!1),O=function(){return"\\"},R="\\/",N=be("\\/",!1),H=function(){return"/"},T="\\b",z=be("\\b",!1),G=function(){return"\b"},ne="\\f",de=be("\\f",!1),le=function(){return"\f"},_e="\\n",kr=be("\\n",!1),Er=function(){return`
|
|
41
|
+
`},nr="\\r",Tt=be("\\r",!1),Lt=function(){return"\r"},mt="\\t",ir=be("\\t",!1),or=function(){return" "},Ht="\\u",_r=be("\\u",!1),$r=function(s,p,_,B){return String.fromCharCode(parseInt(`0x${s}${p}${_}${B}`))},yt=/^[0-9a-fA-F]/,vt=nt([["0","9"],["a","f"],["A","F"]],!1,!1),jr=Et("blank space"),ar=/^[ \t]/,Qe=nt([" "," "],!1,!1),Bt=`\r
|
|
42
|
+
`,Or=be(`\r
|
|
43
|
+
`,!1),xr=`
|
|
44
|
+
`,sr=be(`
|
|
45
|
+
`,!1),Rr="\r",Tr=be("\r",!1),f=0,he=0,Ft=[{line:1,column:1}],Be=0,Wt=[],Q=0,kt;if("startRule"in h){if(!(h.startRule in g))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');C=g[h.startRule]}function ur(){return o.substring(he,f)}function be(s,p){return{type:"literal",text:s,ignoreCase:p}}function nt(s,p,_){return{type:"class",parts:s,inverted:p,ignoreCase:_}}function Lr(){return{type:"any"}}function Fr(){return{type:"end"}}function Et(s){return{type:"other",description:s}}function cr(s){var p=Ft[s],_;if(p)return p;for(_=s-1;!Ft[_];)_--;for(p=Ft[_],p={line:p.line,column:p.column};_<s;)o.charCodeAt(_)===10?(p.line++,p.column=1):p.column++,_++;return Ft[s]=p,p}function lr(s,p){var _=cr(s),B=cr(p);return{start:{offset:s,line:_.line,column:_.column},end:{offset:p,line:B.line,column:B.column}}}function oe(s){f<Be||(f>Be&&(Be=f,Wt=[]),Wt.push(s))}function Ir(s,p,_){return new d(d.buildMessage(s,p),s,p,_)}function fr(){var s;return s=It(),s}function Nr(){var s,p,_;for(s=f,p=[],_=pr();_!==e;)p.push(_),_=pr();return p!==e&&(he=s,p=m(p)),s=p,s}function pr(){var s,p,_,B,D;return s=f,p=At(),p!==e?(o.charCodeAt(f)===45?(_=S,f++):(_=e,Q===0&&oe(E)),_!==e?(B=Se(),B!==e?(D=Nt(),D!==e?(he=s,p=Y(D),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e),s}function It(){var s,p,_;for(s=f,p=[],_=Gt();_!==e;)p.push(_),_=Gt();return p!==e&&(he=s,p=y(p)),s=p,s}function Gt(){var s,p,_,B,D,X,fe,me,pt;if(s=f,p=Se(),p===e&&(p=null),p!==e){if(_=f,o.charCodeAt(f)===35?(B=b,f++):(B=e,Q===0&&oe(v)),B!==e){if(D=[],X=f,fe=f,Q++,me=ft(),Q--,me===e?fe=void 0:(f=fe,fe=e),fe!==e?(o.length>f?(me=o.charAt(f),f++):(me=e,Q===0&&oe(M)),me!==e?(fe=[fe,me],X=fe):(f=X,X=e)):(f=X,X=e),X!==e)for(;X!==e;)D.push(X),X=f,fe=f,Q++,me=ft(),Q--,me===e?fe=void 0:(f=fe,fe=e),fe!==e?(o.length>f?(me=o.charAt(f),f++):(me=e,Q===0&&oe(M)),me!==e?(fe=[fe,me],X=fe):(f=X,X=e)):(f=X,X=e);else D=e;D!==e?(B=[B,D],_=B):(f=_,_=e)}else f=_,_=e;if(_===e&&(_=null),_!==e){if(B=[],D=lt(),D!==e)for(;D!==e;)B.push(D),D=lt();else B=e;B!==e?(he=s,p=re(),s=p):(f=s,s=e)}else f=s,s=e}else f=s,s=e;if(s===e&&(s=f,p=At(),p!==e?(_=qr(),_!==e?(B=Se(),B===e&&(B=null),B!==e?(o.charCodeAt(f)===58?(D=ae,f++):(D=e,Q===0&&oe(x)),D!==e?(X=Se(),X===e&&(X=null),X!==e?(fe=Nt(),fe!==e?(he=s,p=Z(_,fe),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e),s===e&&(s=f,p=At(),p!==e?(_=_t(),_!==e?(B=Se(),B===e&&(B=null),B!==e?(o.charCodeAt(f)===58?(D=ae,f++):(D=e,Q===0&&oe(x)),D!==e?(X=Se(),X===e&&(X=null),X!==e?(fe=Nt(),fe!==e?(he=s,p=Z(_,fe),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e),s===e))){if(s=f,p=At(),p!==e)if(_=_t(),_!==e)if(B=Se(),B!==e)if(D=Dr(),D!==e){if(X=[],fe=lt(),fe!==e)for(;fe!==e;)X.push(fe),fe=lt();else X=e;X!==e?(he=s,p=Z(_,D),s=p):(f=s,s=e)}else f=s,s=e;else f=s,s=e;else f=s,s=e;else f=s,s=e;if(s===e)if(s=f,p=At(),p!==e)if(_=_t(),_!==e){if(B=[],D=f,X=Se(),X===e&&(X=null),X!==e?(o.charCodeAt(f)===44?(fe=te,f++):(fe=e,Q===0&&oe(q)),fe!==e?(me=Se(),me===e&&(me=null),me!==e?(pt=_t(),pt!==e?(he=D,X=ue(_,pt),D=X):(f=D,D=e)):(f=D,D=e)):(f=D,D=e)):(f=D,D=e),D!==e)for(;D!==e;)B.push(D),D=f,X=Se(),X===e&&(X=null),X!==e?(o.charCodeAt(f)===44?(fe=te,f++):(fe=e,Q===0&&oe(q)),fe!==e?(me=Se(),me===e&&(me=null),me!==e?(pt=_t(),pt!==e?(he=D,X=ue(_,pt),D=X):(f=D,D=e)):(f=D,D=e)):(f=D,D=e)):(f=D,D=e);else B=e;B!==e?(D=Se(),D===e&&(D=null),D!==e?(o.charCodeAt(f)===58?(X=ae,f++):(X=e,Q===0&&oe(x)),X!==e?(fe=Se(),fe===e&&(fe=null),fe!==e?(me=Nt(),me!==e?(he=s,p=Ce(_,B,me),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)}else f=s,s=e;else f=s,s=e}return s}function Nt(){var s,p,_,B,D,X,fe;if(s=f,p=f,Q++,_=f,B=ft(),B!==e?(D=Mr(),D!==e?(o.charCodeAt(f)===45?(X=S,f++):(X=e,Q===0&&oe(E)),X!==e?(fe=Se(),fe!==e?(B=[B,D,X,fe],_=B):(f=_,_=e)):(f=_,_=e)):(f=_,_=e)):(f=_,_=e),Q--,_!==e?(f=p,p=void 0):p=e,p!==e?(_=lt(),_!==e?(B=Jt(),B!==e?(D=Nr(),D!==e?(X=hr(),X!==e?(he=s,p=ge(D),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e),s===e&&(s=f,p=ft(),p!==e?(_=Jt(),_!==e?(B=It(),B!==e?(D=hr(),D!==e?(he=s,p=ge(B),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e),s===e))if(s=f,p=Pr(),p!==e){if(_=[],B=lt(),B!==e)for(;B!==e;)_.push(B),B=lt();else _=e;_!==e?(he=s,p=Ae(p),s=p):(f=s,s=e)}else f=s,s=e;return s}function At(){var s,p,_;for(Q++,s=f,p=[],o.charCodeAt(f)===32?(_=Oe,f++):(_=e,Q===0&&oe(Fe));_!==e;)p.push(_),o.charCodeAt(f)===32?(_=Oe,f++):(_=e,Q===0&&oe(Fe));return p!==e?(he=f,_=Ue(p),_?_=void 0:_=e,_!==e?(p=[p,_],s=p):(f=s,s=e)):(f=s,s=e),Q--,s===e&&(p=e,Q===0&&oe(Ee)),s}function Mr(){var s,p,_;for(s=f,p=[],o.charCodeAt(f)===32?(_=Oe,f++):(_=e,Q===0&&oe(Fe));_!==e;)p.push(_),o.charCodeAt(f)===32?(_=Oe,f++):(_=e,Q===0&&oe(Fe));return p!==e?(he=f,_=ye(p),_?_=void 0:_=e,_!==e?(p=[p,_],s=p):(f=s,s=e)):(f=s,s=e),s}function Jt(){var s;return he=f,s=Me(),s?s=void 0:s=e,s}function hr(){var s;return he=f,s=Ze(),s?s=void 0:s=e,s}function qr(){var s;return s=jt(),s===e&&(s=dr()),s}function _t(){var s,p,_;if(s=jt(),s===e){if(s=f,p=[],_=it(),_!==e)for(;_!==e;)p.push(_),_=it();else p=e;p!==e&&(he=s,p=$e()),s=p}return s}function Pr(){var s;return s=$t(),s===e&&(s=gr(),s===e&&(s=jt(),s===e&&(s=dr()))),s}function Dr(){var s;return s=$t(),s===e&&(s=jt(),s===e&&(s=it())),s}function dr(){var s,p,_,B,D,X;if(Q++,s=f,Ne.test(o.charAt(f))?(p=o.charAt(f),f++):(p=e,Q===0&&oe(De)),p!==e){for(_=[],B=f,D=Se(),D===e&&(D=null),D!==e?(Re.test(o.charAt(f))?(X=o.charAt(f),f++):(X=e,Q===0&&oe(qe)),X!==e?(D=[D,X],B=D):(f=B,B=e)):(f=B,B=e);B!==e;)_.push(B),B=f,D=Se(),D===e&&(D=null),D!==e?(Re.test(o.charAt(f))?(X=o.charAt(f),f++):(X=e,Q===0&&oe(qe)),X!==e?(D=[D,X],B=D):(f=B,B=e)):(f=B,B=e);_!==e?(he=s,p=we(),s=p):(f=s,s=e)}else f=s,s=e;return Q--,s===e&&(p=e,Q===0&&oe(ee)),s}function it(){var s,p,_,B,D;if(s=f,o.substr(f,2)===W?(p=W,f+=2):(p=e,Q===0&&oe(U)),p===e&&(p=null),p!==e)if(ie.test(o.charAt(f))?(_=o.charAt(f),f++):(_=e,Q===0&&oe(ve)),_!==e){for(B=[],Je.test(o.charAt(f))?(D=o.charAt(f),f++):(D=e,Q===0&&oe(ze));D!==e;)B.push(D),Je.test(o.charAt(f))?(D=o.charAt(f),f++):(D=e,Q===0&&oe(ze));B!==e?(he=s,p=we(),s=p):(f=s,s=e)}else f=s,s=e;else f=s,s=e;return s}function $t(){var s,p;return s=f,o.substr(f,4)===Pe?(p=Pe,f+=4):(p=e,Q===0&&oe(Ye)),p!==e&&(he=s,p=tt()),s=p,s}function gr(){var s,p;return s=f,o.substr(f,4)===rt?(p=rt,f+=4):(p=e,Q===0&&oe(Ct)),p!==e&&(he=s,p=st()),s=p,s===e&&(s=f,o.substr(f,5)===ut?(p=ut,f+=5):(p=e,Q===0&&oe(wt)),p!==e&&(he=s,p=He()),s=p),s}function jt(){var s,p,_,B;return Q++,s=f,o.charCodeAt(f)===34?(p=Xe,f++):(p=e,Q===0&&oe(Ve)),p!==e?(o.charCodeAt(f)===34?(_=Xe,f++):(_=e,Q===0&&oe(Ve)),_!==e?(he=s,p=dt(),s=p):(f=s,s=e)):(f=s,s=e),s===e&&(s=f,o.charCodeAt(f)===34?(p=Xe,f++):(p=e,Q===0&&oe(Ve)),p!==e?(_=Mt(),_!==e?(o.charCodeAt(f)===34?(B=Xe,f++):(B=e,Q===0&&oe(Ve)),B!==e?(he=s,p=St(_),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)),Q--,s===e&&(p=e,Q===0&&oe(ht)),s}function Mt(){var s,p,_;if(s=f,p=[],_=Ot(),_!==e)for(;_!==e;)p.push(_),_=Ot();else p=e;return p!==e&&(he=s,p=gt(p)),s=p,s}function Ot(){var s,p,_,B,D,X;return r.test(o.charAt(f))?(s=o.charAt(f),f++):(s=e,Q===0&&oe($)),s===e&&(s=f,o.substr(f,2)===j?(p=j,f+=2):(p=e,Q===0&&oe(K)),p!==e&&(he=s,p=P()),s=p,s===e&&(s=f,o.substr(f,2)===u?(p=u,f+=2):(p=e,Q===0&&oe(w)),p!==e&&(he=s,p=O()),s=p,s===e&&(s=f,o.substr(f,2)===R?(p=R,f+=2):(p=e,Q===0&&oe(N)),p!==e&&(he=s,p=H()),s=p,s===e&&(s=f,o.substr(f,2)===T?(p=T,f+=2):(p=e,Q===0&&oe(z)),p!==e&&(he=s,p=G()),s=p,s===e&&(s=f,o.substr(f,2)===ne?(p=ne,f+=2):(p=e,Q===0&&oe(de)),p!==e&&(he=s,p=le()),s=p,s===e&&(s=f,o.substr(f,2)===_e?(p=_e,f+=2):(p=e,Q===0&&oe(kr)),p!==e&&(he=s,p=Er()),s=p,s===e&&(s=f,o.substr(f,2)===nr?(p=nr,f+=2):(p=e,Q===0&&oe(Tt)),p!==e&&(he=s,p=Lt()),s=p,s===e&&(s=f,o.substr(f,2)===mt?(p=mt,f+=2):(p=e,Q===0&&oe(ir)),p!==e&&(he=s,p=or()),s=p,s===e&&(s=f,o.substr(f,2)===Ht?(p=Ht,f+=2):(p=e,Q===0&&oe(_r)),p!==e?(_=ct(),_!==e?(B=ct(),B!==e?(D=ct(),D!==e?(X=ct(),X!==e?(he=s,p=$r(_,B,D,X),s=p):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)):(f=s,s=e)))))))))),s}function ct(){var s;return yt.test(o.charAt(f))?(s=o.charAt(f),f++):(s=e,Q===0&&oe(vt)),s}function Se(){var s,p;if(Q++,s=[],ar.test(o.charAt(f))?(p=o.charAt(f),f++):(p=e,Q===0&&oe(Qe)),p!==e)for(;p!==e;)s.push(p),ar.test(o.charAt(f))?(p=o.charAt(f),f++):(p=e,Q===0&&oe(Qe));else s=e;return Q--,s===e&&(p=e,Q===0&&oe(jr)),s}function lt(){var s,p,_,B,D,X;if(s=f,p=ft(),p!==e){for(_=[],B=f,D=Se(),D===e&&(D=null),D!==e?(X=ft(),X!==e?(D=[D,X],B=D):(f=B,B=e)):(f=B,B=e);B!==e;)_.push(B),B=f,D=Se(),D===e&&(D=null),D!==e?(X=ft(),X!==e?(D=[D,X],B=D):(f=B,B=e)):(f=B,B=e);_!==e?(p=[p,_],s=p):(f=s,s=e)}else f=s,s=e;return s}function ft(){var s;return o.substr(f,2)===Bt?(s=Bt,f+=2):(s=e,Q===0&&oe(Or)),s===e&&(o.charCodeAt(f)===10?(s=xr,f++):(s=e,Q===0&&oe(sr)),s===e&&(o.charCodeAt(f)===13?(s=Rr,f++):(s=e,Q===0&&oe(Tr)))),s}const mr=2;let qt=0;if(kt=C(),kt!==e&&f===o.length)return kt;throw kt!==e&&f<o.length&&oe(Fr()),Ir(Wt,Be<o.length?o.charAt(Be):null,Be<o.length?lr(Be,Be+1):lr(Be,Be))}return En={SyntaxError:d,parse:A},En}var Ki;function Ga(){if(Ki)return Rt;Ki=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.PreserveOrdering=void 0,Rt.stringifySyml=m,Rt.parseSyml=y;const l=Ba(),d=Wa(),A=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,o=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"];class h{constructor(v){this.data=v}}Rt.PreserveOrdering=h;function e(b){return b.match(A)?b:JSON.stringify(b)}function g(b){return typeof b>"u"?!0:typeof b=="object"&&b!==null&&!Array.isArray(b)?Object.keys(b).every(v=>g(b[v])):!1}function C(b,v,M){if(b===null)return`null
|
|
46
|
+
`;if(typeof b=="number"||typeof b=="boolean")return`${b.toString()}
|
|
47
|
+
`;if(typeof b=="string")return`${e(b)}
|
|
48
|
+
`;if(Array.isArray(b)){if(b.length===0)return`[]
|
|
49
|
+
`;const re=" ".repeat(v);return`
|
|
50
|
+
${b.map(ae=>`${re}- ${C(ae,v+1,!1)}`).join("")}`}if(typeof b=="object"&&b){const[re,ae]=b instanceof h?[b.data,!1]:[b,!0],x=" ".repeat(v),Z=Object.keys(re);ae&&Z.sort((q,ue)=>{const Ce=o.indexOf(q),ge=o.indexOf(ue);return Ce===-1&&ge===-1?q<ue?-1:q>ue?1:0:Ce!==-1&&ge===-1?-1:Ce===-1&&ge!==-1?1:Ce-ge});const te=Z.filter(q=>!g(re[q])).map((q,ue)=>{const Ce=re[q],ge=e(q),Ae=C(Ce,v+1,!0),Ee=ue>0||M?x:"",Oe=ge.length>1024?`? ${ge}
|
|
51
|
+
${Ee}:`:`${ge}:`,Fe=Ae.startsWith(`
|
|
52
|
+
`)?Ae:` ${Ae}`;return`${Ee}${Oe}${Fe}`}).join(v===0?`
|
|
53
|
+
`:"")||`
|
|
54
|
+
`;return M?`
|
|
55
|
+
${te}`:`${te}`}throw new Error(`Unsupported value type (${b})`)}function m(b){try{const v=C(b,0,!1);return v!==`
|
|
56
|
+
`?v:""}catch(v){throw v.location&&(v.message=v.message.replace(/(\.)?$/,` (line ${v.location.start.line}, column ${v.location.start.column})$1`)),v}}m.PreserveOrdering=h;function S(b){return b.endsWith(`
|
|
57
|
+
`)||(b+=`
|
|
58
|
+
`),(0,d.parse)(b)}const E=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Y(b){if(E.test(b))return S(b);const v=(0,l.safeLoad)(b,{schema:l.FAILSAFE_SCHEMA,json:!0});if(v==null)return{};if(typeof v!="object")throw new Error(`Expected an indexed object, got a ${typeof v} instead. Does your file follow Yaml's rules?`);if(Array.isArray(v))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return v}function y(b){return Y(b)}return Rt}var Zi;function Ja(){return Zi||(Zi=1,(function(l){Object.defineProperty(l,"__esModule",{value:!0}),l.stringifySyml=l.parseSyml=l.stringifyResolution=l.parseResolution=l.stringifyValueArgument=l.stringifyShellLine=l.stringifyRedirectArgument=l.stringifyEnvSegment=l.stringifyCommandLineThen=l.stringifyCommandLine=l.stringifyCommandChainThen=l.stringifyCommandChain=l.stringifyCommand=l.stringifyArithmeticExpression=l.stringifyArgumentSegment=l.stringifyArgument=l.stringifyShell=l.parseShell=void 0;var d=Ca();Object.defineProperty(l,"parseShell",{enumerable:!0,get:function(){return d.parseShell}}),Object.defineProperty(l,"stringifyShell",{enumerable:!0,get:function(){return d.stringifyShell}}),Object.defineProperty(l,"stringifyArgument",{enumerable:!0,get:function(){return d.stringifyArgument}}),Object.defineProperty(l,"stringifyArgumentSegment",{enumerable:!0,get:function(){return d.stringifyArgumentSegment}}),Object.defineProperty(l,"stringifyArithmeticExpression",{enumerable:!0,get:function(){return d.stringifyArithmeticExpression}}),Object.defineProperty(l,"stringifyCommand",{enumerable:!0,get:function(){return d.stringifyCommand}}),Object.defineProperty(l,"stringifyCommandChain",{enumerable:!0,get:function(){return d.stringifyCommandChain}}),Object.defineProperty(l,"stringifyCommandChainThen",{enumerable:!0,get:function(){return d.stringifyCommandChainThen}}),Object.defineProperty(l,"stringifyCommandLine",{enumerable:!0,get:function(){return d.stringifyCommandLine}}),Object.defineProperty(l,"stringifyCommandLineThen",{enumerable:!0,get:function(){return d.stringifyCommandLineThen}}),Object.defineProperty(l,"stringifyEnvSegment",{enumerable:!0,get:function(){return d.stringifyEnvSegment}}),Object.defineProperty(l,"stringifyRedirectArgument",{enumerable:!0,get:function(){return d.stringifyRedirectArgument}}),Object.defineProperty(l,"stringifyShellLine",{enumerable:!0,get:function(){return d.stringifyShellLine}}),Object.defineProperty(l,"stringifyValueArgument",{enumerable:!0,get:function(){return d.stringifyValueArgument}});var A=Sa();Object.defineProperty(l,"parseResolution",{enumerable:!0,get:function(){return A.parseResolution}}),Object.defineProperty(l,"stringifyResolution",{enumerable:!0,get:function(){return A.stringifyResolution}});var o=Ga();Object.defineProperty(l,"parseSyml",{enumerable:!0,get:function(){return o.parseSyml}}),Object.defineProperty(l,"stringifySyml",{enumerable:!0,get:function(){return o.stringifySyml}})})(Kr)),Kr}var zi=Ja();const Qt="__metadata",Va=l=>{const d=l.trim();if(d==="")return;const A=d.startsWith("@")?1:0,o=d.indexOf("@",A);if(o!==-1)return{name:d.slice(0,o),spec:d.slice(o+1)}},Ka=l=>l.split(",").map(d=>Va(d)).filter(d=>d!==void 0),Za=l=>{const d=new Map;for(const A of Object.keys(l)){if(A==="__metadata")continue;const o=Ka(A),h=new Map;for(const{name:e,spec:g}of o){const C=h.get(e);C?C.push(g):h.set(e,[g])}for(const[e,g]of h){const C=d.get(e);C?C.push({key:A,specs:g}):d.set(e,[{key:A,specs:g}])}}return d},Xi=(l,d,A)=>{const o=l.get(d);if(!o)return[];const h=new Set([A]);return A.includes(":")?A.startsWith("npm:")&&h.add(A.slice(4)):h.add(`npm:${A}`),o.filter(e=>e.specs.some(g=>h.has(g))).map(e=>e.key)},za=(l,d)=>{const A=new Set,o=new Set(d.map(h=>h.relativeRoot).filter(h=>h!==""));for(const[h,e]of Object.entries(l)){if(h==="__metadata")continue;const{resolution:g}=e;if(typeof g!="string"||!g.includes("@workspace:"))continue;const C=g.split("@workspace:")[1];C!==void 0&&(C==="."||o.has(C))&&A.add(h)}return A},Xa=l=>{const d=[];for(const A of[l.dependencies,l.optionalDependencies])if(A)for(const[o,h]of Object.entries(A))typeof h=="string"&&d.push({name:o,spec:h});return d},Qa=l=>{const d=typeof l.lockfileContent=="string"?l.lockfileContent:l.lockfileContent.toString("utf8");let A;try{A=zi.parseSyml(d)}catch(y){throw new et(`yarn.lock: parse failed — ${y.message}`)}if(!A||typeof A!="object")throw new et("yarn.lock: top-level value is not an object");const o=Za(A),h=new Set;A[Qt]!==void 0&&h.add(Qt);const e=za(A,l.closure);for(const y of e)h.add(y);for(const y of l.closure)if(y.deps)for(const[b,v]of Object.entries(y.deps)){if(typeof v!="string"||v.startsWith("workspace:")||v.startsWith("link:")||v.startsWith("portal:"))continue;const M=Xi(o,b,v);for(const re of M)h.add(re)}const g=[...h];for(;g.length>0;){const y=g.shift();if(y==="__metadata")continue;const b=A[y];if(b)for(const{name:v,spec:M}of Xa(b)){if(M.startsWith("workspace:")||M.startsWith("link:")||M.startsWith("portal:"))continue;const re=Xi(o,v,M);for(const ae of re)h.has(ae)||(h.add(ae),g.push(ae))}}const C={};for(const y of Object.keys(A))h.has(y)&&(C[y]=A[y]);const m=Object.keys(A).length-(A[Qt]===void 0?0:1),S=h.size-(h.has(Qt)?1:0),E=m-S,Y=A[Qt]!==void 0;return{content:zi.stringifySyml(C),message:`yarn.lock (${Y?"berry":"classic"}): kept ${S}/${m} entries (dropped ${E})`,status:"pruned"}},es=l=>{switch(l.packageManager){case"aube":return fa(l);case"bun":return ma(l);case"npm":return Aa(l);case"pnpm":return io(l);case"yarn":return Qa(l);default:{const d=l.packageManager;throw new et(`Unsupported package manager: ${d}`)}}},ts=(l,d)=>{const A=new Set,o=[l],h=new Set([l]);for(;o.length>0;){const e=o.shift(),g=d.dependencies[e]??[];for(const C of g)h.has(C.target)||(h.add(C.target),A.add(C.target),o.push(C.target))}return A},wr="vis-docker-manifest.json",rs=["package.json","project.json"],ns=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"npm-shrinkwrap.json",manager:"npm"},{file:"package-lock.json",manager:"npm"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"}],is=["package.json","pnpm-workspace.yaml",".npmrc","vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],os=(l,d)=>{const A=new Set(l);for(const o of l){const h=ts(o,d);for(const e of h)A.add(e)}return A},Dt=l=>{aa(l)},er=(l,d)=>{try{return Dt(jn(d)),to(l,d),!0}catch(A){if(A.code==="ENOENT")return!1;throw A}},uo=(l,d)=>{let A;try{A=ra(l)}catch{return}if(!A.isSymbolicLink()){if(A.isFile()){Dt(jn(d)),to(l,d);return}Dt(d);for(const o of na(l,{withFileTypes:!0}))o.name==="node_modules"||o.name===".git"||o.isSymbolicLink()||uo(Ie(l,o.name),Ie(d,o.name))}},Qi=l=>{if(!eo(l))return;let d;try{d=ro(l)}catch{return}const A={};for(const o of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const h=d[o];if(!(h===null||typeof h!="object"||Array.isArray(h)))for(const[e,g]of Object.entries(h))typeof g=="string"&&(A[e]=g)}return{deps:A,name:typeof d.name=="string"?d.name:void 0}},ls=l=>{const{focus:d,includeSources:A=!1,log:o=M=>{console.log(M)},outDir:h,projectGraph:e,pruneLockfile:g=!0,workspace:C,workspaceRoot:m}=l,S=d.filter(M=>C.projects[M]===void 0);if(S.length>0)throw new Error(`Unknown focus project(s): ${S.join(", ")}. Check project names in your workspace.`);const E=os(d,e),Y=Ie(h,"workspace"),y=Ie(h,"sources");_n(Y,{force:!0,recursive:!0}),_n(y,{force:!0,recursive:!0}),Dt(Y);for(const M of is)er(Ie(m,M),Ie(Y,M));const b=Qi(Ie(m,"package.json")),v=[{deps:b?.deps,name:b?.name,relativeRoot:""}];for(const M of E){const re=C.projects[M];if(!re?.root)continue;for(const x of rs)er(Ie(m,re.root,x),Ie(Y,re.root,x));const ae=Qi(Ie(m,re.root,"package.json"));v.push({deps:ae?.deps,name:ae?.name,relativeRoot:re.root})}for(const{file:M,manager:re}of ns){const ae=Ie(m,M);if(!eo(ae))continue;const x=Ie(Y,M);if(!g){er(ae,x);continue}const Z=M.endsWith(".lockb")?li(ae):li(ae,"utf8");try{const te=es({closure:v,displayName:M,lockfileContent:Z,packageManager:re});te.status==="pruned"&&te.content!==void 0?(Dt(jn(x)),fi(x,te.content)):er(ae,x),o(te.message)}catch(te){if(te instanceof et)o(`${M}: pruning failed (${te.message}); copying verbatim`),er(ae,x);else throw te}}if(A){Dt(y);for(const M of d){const re=C.projects[M];re?.root&&uo(Ie(m,re.root),Ie(y,re.root))}}return fi(Ie(h,wr),`${JSON.stringify({focus:d,projects:[...E].sort()},null,2)}
|
|
59
|
+
`),{projects:[...E]}},fs=l=>{const{contextRoot:d,workspace:A,workspaceRoot:o}=l,h=Ie(d,wr);if(!ia(h))throw new Error(`No ${wr} at ${d}. Run \`vis docker scaffold\` first.`);const e=ro(h);if(!Array.isArray(e.projects))throw new TypeError(`Invalid ${wr}: "projects" must be an array.`);const g=new Set(e.projects),C=[];for(const[m,S]of Object.entries(A.projects)){if(g.has(m)||!S.root)continue;const E=Ie(o,S.root),Y=oa(o,E);Y===""||Y==="."||Y.startsWith("..")||(_n(E,{force:!0,recursive:!0}),C.push(Y))}return{removed:C}};export{fs as p,os as r,ls as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as m}from"node:module";import{m as _}from"./index-BDmTbWX1.js";import{o as F}from"../packem_chunks/bin.js";const p=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,e]=o.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return o.getBuiltinModule(r)}return p(r)},{mkdirSync:f,writeFileSync:h,readdirSync:g}=c("node:fs"),{readFile:y}=c("node:fs/promises"),n=r=>F(r),a=(r,t)=>_(n(r),`${encodeURIComponent(t)}.json`);class S{#t;#e;constructor(t,e){this.#t=t,this.#e=e}printTaskTerminalOutput(t,e,s){if(e!=="failure")return;const i=n(this.#t);try{f(i,{recursive:!0})}catch{return}const u=t.overrides.command,d=t.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:t.hash,runId:this.#e,status:e,taskId:t.id,terminalOutput:s,timestamp:new Date().toISOString()};try{h(a(this.#t,t.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
+
`,"utf8")}catch{}}}const I=async(r,t)=>{const e=a(r,t);try{const s=await y(e,"utf8");return JSON.parse(s)}catch{return}},O=r=>{const t=n(r);let e;try{e=g(t)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{s.push(decodeURIComponent(i.slice(0,-5)))}catch{}return s};export{S as F,I as a,O as l};
|