updates 17.6.1 → 17.6.2

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import{cwd as e,env as t,exit as n,platform as r,stderr as i,stdout as a,versions as o}from"node:process";import{basename as s,dirname as c,join as l,resolve as u}from"node:path";import{pathToFileURL as d}from"node:url";import{accessSync as f,globSync as p,lstatSync as m,readFileSync as h,readdirSync as g,statSync as _,truncateSync as v,writeFileSync as y}from"node:fs";import{parseArgs as b,promisify as x,stripVTControlCharacters as S,styleText as C}from"node:util";import ee from"node:dns";import{execFile as te}from"node:child_process";var ne=Object.defineProperty,w=(e,t)=>()=>(e&&(t=e(e=0)),t),re=(e,t)=>{let n={};for(var r in e)ne(n,r,{get:e[r],enumerable:!0});return t||ne(n,Symbol.toStringTag,{value:`Module`}),n};async function ie(e,t,{concurrency:n=1/0,stopOnError:r=!0,signal:i}={}){return new Promise((a,o)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!=`function`)throw TypeError(`Mapper function is required`);if(!(Number.isSafeInteger(n)&&n>=1||n===1/0))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let s=[],c=[],l=new Map,u=!1,d=!1,f=!1,p=0,m=0,h=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),g=()=>{y(i.reason)},_=()=>{i?.removeEventListener(`abort`,g)},v=e=>{a(e),_()},y=e=>{u=!0,d=!0,o(e),_()};i&&(i.aborted&&y(i.reason),i.addEventListener(`abort`,g,{once:!0}));let b=async()=>{if(d)return;let e=await h.next(),n=m;if(m++,e.done){if(f=!0,p===0&&!d){if(!r&&c.length>0){y(AggregateError(c));return}if(d=!0,l.size===0){v(s);return}let e=[];for(let[t,n]of s.entries())l.get(t)!==T&&e.push(n);v(e)}return}p++,(async()=>{try{let r=await e.value;if(d)return;let i=await t(r,n);i===T&&l.set(n,i),s[n]=i,p--,await b()}catch(e){if(r)y(e);else{c.push(e),p--;try{await b()}catch(e){y(e)}}}})()};(async()=>{for(let e=0;e<n;e++){try{await b()}catch(e){y(e);break}if(f||u)break}})()})}const T=Symbol(`skip`),ae=/^v?(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9._-]+(?:\.[a-zA-Z0-9._-]+)*))?(?:\+[a-zA-Z0-9._-]+)?$/,E=new Map;function D(e){if(typeof e!=`string`)return null;let t=E.get(e);if(t!==void 0)return t;let n=ae.exec(e.trim());if(!n)return E.set(e,null),null;let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]),o=n[4]?n[4].split(`.`).map(e=>/^\d+$/.test(e)?Number(e):e):[],s={major:r,minor:i,patch:a,prerelease:o,version:`${r}.${i}.${a}${o.length?`-${o.join(`.`)}`:``}`};return E.set(e,s),s}function oe(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:n?-1:r?1:e<t?-1:e>t?1:0}function se(e,t){return e.major-t.major||e.minor-t.minor||e.patch-t.patch}function O(e,t){let n=se(e,t);if(n!==0)return n;if(!e.prerelease.length&&!t.prerelease.length)return 0;if(e.prerelease.length&&!t.prerelease.length)return-1;if(!e.prerelease.length&&t.prerelease.length)return 1;let r=Math.max(e.prerelease.length,t.prerelease.length);for(let n=0;n<r;n++){if(e.prerelease[n]===void 0)return-1;if(t.prerelease[n]===void 0)return 1;let r=oe(e.prerelease[n],t.prerelease[n]);if(r!==0)return r}return 0}function k(e){return D(e)?.version??null}function ce(e){return D(e)}const le=new Map,ue=/(?:^|[^.\d])(\d+)(?:\.(\d+))?(?:\.(\d+))?/;function de(e){if(typeof e!=`string`)return null;let t=le.get(e);if(t!==void 0)return t;let n=ue.exec(e);if(!n)return le.set(e,null),null;let r={version:`${n[1]||`0`}.${n[2]||`0`}.${n[3]||`0`}`};return le.set(e,r),r}function fe(e,t){let n=D(e),r=D(t);if(!n||!r||n.version===r.version)return null;let i=O(n,r),a=i>0?n:r,o=i>0?r:n,s=a.prerelease.length>0;if(o.prerelease.length>0&&!s){if(!o.patch&&!o.minor)return`major`;if(se(o,a)===0)return o.minor&&!o.patch?`minor`:`patch`}let c=s?`pre`:``;return n.major===r.major?n.minor===r.minor?n.patch===r.patch?`prerelease`:`${c}patch`:`${c}minor`:`${c}major`}function pe(e,t){let n=D(e),r=D(t);return!n||!r?!1:O(n,r)>0}function me(e,t){let n=D(e),r=D(t);return!n||!r?!1:O(n,r)>=0}function he(e,t){let n=D(e),r=D(t);return!n||!r?!1:O(n,r)<0}function ge(e,t){let n=D(e),r=D(t);return!n||!r?!0:O(n,r)!==0}function _e(e){let t=/^(>=|<=|>|<|=)?\s*v?(\d+)(?:\.(\d+))?(?:\.(\d+))?((?:-[a-zA-Z0-9._-]+(?:\.[a-zA-Z0-9._-]+)*)?)$/.exec(e.trim());if(!t)return null;let n=t[2],r=D(`${n}.${t[3]??`0`}.${t[4]??`0`}${t[5]||``}`);return r?{op:t[1]||`=`,semver:r}:null}function ve(e,t){let n=O(e,t.semver);switch(t.op){case`>=`:return n>=0;case`<=`:return n<=0;case`>`:return n>0;case`<`:return n<0;case`=`:return n===0;default:return n===0}}function A(e,t,n){return`${e}.${t}.${n}-0`}function ye(e){return e.replace(/~\s*v?(\d+)(?:\.(\d+))?(?:\.(\d+))?((?:-[a-zA-Z0-9._-]+)?)/g,(e,t,n,r,i)=>{let a=Number(t);if(n===void 0)return`>=${a}.0.0 <${A(a+1,0,0)}`;let o=Number(n);return`>=${a}.${o}.${r===void 0?0:Number(r)}${i||``} <${A(a,o+1,0)}`})}function be(e){return e.replace(/\^\s*v?(\d+)(?:\.(\d+))?(?:\.(\d+))?((?:-[a-zA-Z0-9._-]+)?)/g,(e,t,n,r,i)=>{let a=Number(t),o=i||``;if(n===void 0)return`>=${a}.0.0 <${A(a+1,0,0)}`;let s=Number(n);if(r===void 0)return a===0?`>=${a}.${s}.0 <${A(a,s+1,0)}`:`>=${a}.${s}.0 <${A(a+1,0,0)}`;let c=Number(r);return a===0?s===0?`>=${a}.${s}.${c}${o} <${A(a,s,c+1)}`:`>=${a}.${s}.${c}${o} <${A(a,s+1,0)}`:`>=${a}.${s}.${c}${o} <${A(a+1,0,0)}`})}function xe(e){return e.replace(/v?(\d+)(?:\.(\d+))?(?:\.(\d+))?((?:-[a-zA-Z0-9._-]+)?)\s+-\s+v?(\d+)(?:\.(\d+))?(?:\.(\d+))?((?:-[a-zA-Z0-9._-]+)?)/g,(e,t,n,r,i,a,o,s,c)=>{let l=Number(t),u=n===void 0?0:Number(n),d=r===void 0?0:Number(r),f=i||``,p=Number(a),m;return m=s===void 0?o===void 0?`<${A(p+1,0,0)}`:`<${A(p,Number(o)+1,0)}`:`<=${p}.${Number(o)}.${Number(s)}${c||``}`,`>=${l}.${u}.${d}${f} ${m}`})}function Se(e){return/^\s*[*xX]\s*$/.test(e)?`>=0.0.0`:(e=e.replace(/v?(\d+)\.[xX*](?:\.[xX*])?/g,(e,t)=>{let n=Number(t);return`>=${n}.0.0 <${A(n+1,0,0)}`}),e=e.replace(/v?(\d+)\.(\d+)\.[xX*]/g,(e,t,n)=>{let r=Number(t),i=Number(n);return`>=${r}.${i}.0 <${A(r,i+1,0)}`}),e=e.replace(/(^|[\s|])(\d+)\.(\d+)(?=\s|$)/g,(t,n,r,i,a)=>{let o=e.substring(0,a).trimEnd();if(/[<>=]$/.test(o))return t;let s=Number(r),c=Number(i);return`${n}>=${s}.${c}.0 <${A(s,c+1,0)}`}),e=e.replace(/(^|[\s|])(\d+)(?=\s|$)/g,(t,n,r,i)=>{let a=e.substring(0,i).trimEnd();if(/[<>=]$/.test(a))return t;let o=Number(r);return`${n}>=${o}.0.0 <${A(o+1,0,0)}`}),e)}const Ce=new Map;function we(e){let t=Ce.get(e);if(t!==void 0)return t;let n=e.split(`||`).map(e=>e.trim()),r=[];for(let t of n){if(!t){r.push([]);continue}t=xe(t),t=be(t),t=ye(t),t=Se(t),t=t.replace(/(^|[\s])v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+(?:\.[a-zA-Z0-9._-]+)*)?)\b/g,(e,t)=>/[<>=]/.test(t)?e:`${t}=${e.trim()}`),t=t.replace(/(>=|<=|>|<|=)\s+/g,`$1`);let n=t.split(/\s+/).filter(Boolean),i=[];for(let t of n){let n=_e(t);if(!n)return Ce.set(e,null),null;i.push(n)}if(i.length===0)return Ce.set(e,null),null;r.push(i)}let i=r.length?r:null;return Ce.set(e,i),i}function Te(e,t){for(let n of t)if(!ve(e,n))return!1;if(e.prerelease.length>0){for(let n of t)if(n.semver.prerelease.length>0&&n.semver.major===e.major&&n.semver.minor===e.minor&&n.semver.patch===e.patch)return!0;return!1}return!0}function Ee(e,t){let n=D(e);if(!n)return!1;let r=we(t);if(!r)return!1;for(let e of r)if(e.length===0||Te(n,e))return!0;return!1}function De(e){if(typeof e!=`string`)return null;try{return we(e)?e:null}catch{return null}}const Oe=[[1e3,6e4,`sec`],[6e4,36e5,`min`],[36e5,864e5,`hour`],[864e5,6048e5,`day`],[6048e5,2628e6,`week`],[2628e6,31536e6,`month`],[31536e6,1/0,`year`]],ke={"1 day ago":`yesterday`,"1 week ago":`last week`,"1 month ago":`last month`,"1 year ago":`last year`,"in 1 day":`tomorrow`,"in 1 week":`next week`,"in 1 month":`next month`,"in 1 year":`next year`},Ae={sec:`second`,min:`minute`};function je(e){return e instanceof Date?e.getTime():typeof e==`string`?Date.parse(e):e}function Me(e,{now:t,noAffix:n=!1,times:r=Oe,nowThreshold:i=2e3,nowString:a=`now`,unknownString:o=``,aliases:s=!1,aliasesMap:c=ke,longUnits:l=!1}={}){let u=je(e);if(t=t===void 0?Date.now():je(t),Number.isNaN(u))return o||String(e);let d=!1,f=t-u;if(f<0&&(d=!0,f=Math.abs(f)),f<i)return a;let p=0,m=``;for(let e=0,t=r.length;e<t;e++){let t=r[e];if(!(f>=t[1])){p=Math.floor(f/t[0]),m=(l&&Ae[t[2]]||t[2])+(p>1?`s`:``);break}}let h=`${d&&!n?`in `:``}${p} ${m}${!d&&!n?` ago`:``}`;return s?c[h]??h:h}function Ne(e,t,n){if(e===t)return e;let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)r++;if(r>0&&e[r-1]!==`.`&&e[r-1]!==`-`){let t=r-1;for(;t>=0&&e[t]!==`.`&&e[t]!==`-`;)t--;if(t>=0)r=t+1;else{let t=0;for(;t<r&&!/\d/.test(e[t]);)t++;r=t}}let i=e.substring(r);return i?e.substring(0,r)+n(i):e}function Pe(e){let t=[];for(let n of e){let[e,r]=n.replaceAll(/\s+/g,``).split(/[<>=~]+/);e&&/^[0-9.a-z]+$/.test(r)&&t.push({name:e,version:r})}return t}const Fe=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`resolutions`,`packageManager`],Ie=[`node`,`deno`,`bun`],Le=[`tool.poetry.dependencies`,`tool.poetry.dev-dependencies`,`tool.poetry.test-dependencies`,`tool.poetry.group.dev.dependencies`,`tool.poetry.group.test.dependencies`],Re=[`project.dependencies`,`project.optional-dependencies`,`dependency-groups.dev`,`dependency-groups.lint`,`dependency-groups.test`],ze=[`deps`,`replace`];function j(e,t){for(let n of t instanceof Set?t:[])if(n.test(e))return!0;return!1}function Be(e,t){return t.split(`.`).reduce((e,t)=>e?.[t]??null,e)}function Ve(e){return e.split(`,`).filter(Boolean)}function He(e,t,n){return!e||!t?!0:(n-Date.parse(e))/(24*3600*1e3)>=t}function Ue(){let e=new Date;return[e.getFullYear(),`-`,String(e.getMonth()+1).padStart(2,`0`),`-`,String(e.getDate()).padStart(2,`0`),` `,String(e.getHours()).padStart(2,`0`),`:`,String(e.getMinutes()).padStart(2,`0`),`:`,String(e.getSeconds()).padStart(2,`0`)].join(``)}function We(e,t,n=` `){let r=``,i=Array(e[0].length).fill(0);for(let n of e)for(let[e,r]of n.entries()){let n=t(r);n>i[e]&&(i[e]=n)}for(let[a,o]of e.entries()){for(let[e,a]of o.entries()){e>0&&(r+=n);let s=` `.repeat(i[e]-t(a));r+=a+(e===o.length-1?``:s)}a<e.length-1&&(r+=`
3
- `)}return r}const Ge={y:365,m:30,w:7,d:1,h:1/24,s:1/86400};function Ke(e){let t=/^(\d+(?:\.\d+)?)\s*([a-z])$/i.exec(e);if(t){let[,e,n]=t,r=Ge[n.toLowerCase()];if(r)return Number(e)*r}let n=Number(e);if(!Number.isFinite(n))throw Error(`Invalid cooldown value: ${e}`);return n}function qe(){let e=new Map,t=new Map,n=ee.lookup;ee.lookup=function(r,...i){let a={},o;typeof i[0]==`function`?o=i[0]:(a=typeof i[0]==`number`?{family:i[0]}:i[0]||{},o=i[1]);let s=e.get(r);if(s){a.all?o(null,s):o(null,s[0].address,s[0].family);return}if(t.has(r)){t.get(r).push({options:a,callback:o});return}t.set(r,[{options:a,callback:o}]),n.call(ee,r,{all:!0},(n,i)=>{let a=t.get(r);t.delete(r),!n&&i?.length&&e.set(r,i);for(let{options:e,callback:t}of a)n?t(n):e.all?t(null,i):t(null,i[0].address,i[0].family)})}}const Je=`17.6.1`,Ye=5e3,M=e=>e.replace(/^v/,``),N=e=>e.replace(/[|\\{}()[\]^$+*?.-]/g,`\\$&`),P=e=>e.endsWith(`/`)?e.substring(0,e.length-1):e;function Xe(e,t){return{headers:{"user-agent":`updates/${Je}`,"accept-encoding":`gzip, deflate, br`,...t&&{Authorization:`${e} ${t}`}}}}async function Ze(e,t,n,r,i,a,o){n&&r&&i&&r(`${i(`fetch`)} ${e}`);let s=await fetch(e,t);return n&&r&&a&&o&&r(`${s.ok?a(s.status):o(s.status)} ${e}`),s}function Qe(e){let t=ce(e);return t?!!t.prerelease.length:!1}function $e(e){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(e)}function F(e){try{return de(e)?.version??``}catch{return``}}function et(e,t,{range:n,semvers:r,usePre:i,useRel:a,useGreatest:o,pinnedRange:s}){let c=F(n);if(!c)return c;i=$e(n)||i,i&&(r.add(`prerelease`),r.has(`patch`)&&r.add(`prepatch`),r.has(`minor`)&&r.add(`preminor`),r.has(`major`)&&r.add(`premajor`));let l=0,u=c;for(let n of t){let t=ce(n);if(!t?.version||t.prerelease.length&&(!i||a))continue;let c=t.version;if(s&&!Ee(c,s))continue;let d=fe(u,c);if(!(!d||!r.has(d)))if(o||!(`time`in e))me(F(c),u)&&(u=c);else{let t=Date.parse(e.time[n]);t>=0&&t>l&&(u=c,l=t)}}return u||null}function tt(e,{mode:t,range:n,useGreatest:r,useRel:i,usePre:a,semvers:o,pinnedRange:s},{allowDowngrade:c,matchesAny:l,isGoPseudoVersion:u}){if(n===`*`||n.includes(`||`))return null;let d=[];if(t===`pypi`)d=Object.keys(e.releases).filter(e=>k(e));else if(t===`npm`)d=Object.keys(e.versions).filter(e=>k(e));else if(t===`go`){let t=F(n);if(!t)return null;let r=a||$e(n),s=e=>Qe(e)&&(!r||i),c=F(e.new);if(c&&!u(e.new)&&!s(e.new)){let n=fe(t,c);if(n&&o.has(n))return e.new}let l=F(e.sameMajorNew);if(l&&!u(e.sameMajorNew)&&!s(e.sameMajorNew)){let n=fe(t,l);if(n&&o.has(n))return e.Time=e.sameMajorTime,delete e.newPath,e.sameMajorNew}return null}let f=et(e,d,{range:n,semvers:o,usePre:a,useRel:i,useGreatest:r,pinnedRange:s});if(!f)return null;if(r)return f;{let r=``,u=``;t===`pypi`?(u=e.info.version,r=F(e.info.version)):r=e[`dist-tags`].latest;let d=F(n),p=$e(n),m=Qe(f),h=Qe(r),g=pe(f,d);if(!i&&a||p&&m||i&&!g&&p&&!m||p&&!m&&g)return f;if(p&&!m&&!g)return null;let _=fe(d,r);return _&&_!==`prerelease`&&!o.has(_.replace(/^pre/,``))||i&&Qe(r)?f:he(r,d)&&!h?c===!0||l(e.name,c)?r:null:!p&&h&&!a||s&&!Ee(r,s)?f:u||r}}const nt=new Map;if(t.UPDATES_FORGE_TOKENS)for(let e of t.UPDATES_FORGE_TOKENS.split(`,`)){let t=e.indexOf(`:`);t>0&&nt.set(e.substring(0,t),e.substring(t+1))}function rt(e){try{let t=nt.get(new URL(e).hostname);if(t)return t}catch{}return t.UPDATES_GITHUB_API_TOKEN||t.GITHUB_API_TOKEN||t.GH_TOKEN||t.GITHUB_TOKEN||t.HOMEBREW_GITHUB_API_TOKEN}function I(e,t){let n={signal:AbortSignal.timeout(t.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}},r=rt(e);return r&&(n.headers={...n.headers,Authorization:`Bearer ${r}`}),t.doFetch(e,n)}function it(e,t,n){let r=M(t);if(!k(r))return null;if(n){let n=t,i=M(t);for(let t of e){let e=M(t);k(e)&&(!n||pe(e,i))&&(n=t,i=e)}if(ge(r,i))return n}else{let t=e.at(-1);if(!t)return null;let n=M(t);if(!k(n))return null;if(ge(r,n))return t}return null}function at(e){return e=e.replace(`git@`,``).replace(/.+?\/\//,`https://`).replace(/\.git$/,``),/^[a-z]+:[a-z0-9-]\/[a-z0-9-]$/.test(e)?e.replace(/^(.+?):/,(e,t)=>`https://${t}.com/`):/^[a-z0-9-]\/[a-z0-9-]$/.test(e)?`https://github.com/${e}`:e}function ot(e){return e.startsWith(`https://bitbucket.org`)?`src/HEAD`:`tree/HEAD`}function st({repository:e,homepage:t,info:n},r,i){n&&(e=n.project_urls.repository||n.project_urls.Repository||n.project_urls.repo||n.project_urls.Repo||n.project_urls.source||n.project_urls.Source||n.project_urls[`source code`]||n.project_urls[`Source code`]||n.project_urls[`Source Code`]||n.project_urls.homepage||n.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a=``;return r===`https://npm.pkg.github.com`?`https://github.com/${i.replace(/^@/,``)}`:(e&&(a=at(typeof e==`string`?e:e.url),a&&typeof e!=`string`&&e.directory&&(a=`${a}/${ot(a)}/${e.directory}`)),a||t||``)}function ct(e){if(/^\s*\{/.test(e))return JSON.parse(e);let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e||e.startsWith(`#`)||e.startsWith(`;`))continue;let r=e.indexOf(`=`);if(r===-1)continue;let i=e.slice(r+1).trim();i.length>=2&&(i.startsWith(`"`)&&i.endsWith(`"`)||i.startsWith(`'`)&&i.endsWith(`'`))&&(i=i.slice(1,-1)),t[e.slice(0,r).trim()]=i}return t}function lt(e){try{return ct(h(e,`utf-8`))}catch{return}}function ut(t){let n=e();for(;;){let e=l(n,t);try{return _(e),e}catch{}let r=c(n);if(r===n)break;n=r}}function dt(e){let n={},r=e.toLowerCase();for(let[i,a]of Object.entries(t))if(i.toLowerCase().startsWith(r)){let t=i.substring(e.length).split(`__`).filter(Boolean);if(t.length===0)continue;let r=n;for(let e=0;e<t.length;e++){let n=t[e];if(e===t.length-1)r[n]=a;else if(r[n]===void 0&&(r[n]={}),typeof r[n]==`object`)r=r[n];else break}}return n}function ft(e,n={}){let i=r===`win32`,a=i?t.USERPROFILE:t.HOME,o=[{...n}],s=[];function c(e){if(!e||s.includes(e))return;let t=lt(e);t&&(o.push(t),s.push(e))}i||(c(l(`/etc`,e,`config`)),c(l(`/etc`,`${e}rc`))),a&&(c(l(a,`.config`,e,`config`)),c(l(a,`.config`,e)),c(l(a,`.${e}`,`config`)),c(l(a,`.${e}rc`))),c(ut(`.${e}rc`));let u=dt(`${e}_`);return u.config&&c(u.config),Object.assign({},...o,u,s.length?{configs:s,config:s[s.length-1]}:void 0)}const pt=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,mt=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,ht=/^[0-9a-f]{7,}$/i,gt=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,_t=/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,vt=`https://registry.npmjs.org`;let L=null;const yt=new Map;function bt(){return L||ft(`npm`,{registry:vt})}function xt(e){return e.replace(/^\$\{?([^}]*)\}?$/,(e,n)=>t[n]||``)}function St(e,t){let n=t[`${e}:_authToken`]||t[`${e}/:_authToken`];if(n)return{token:xt(n),type:`Bearer`};let r=t[`${e}:username`]||t[`${e}/:username`],i=t[`${e}:_password`]||t[`${e}/:_password`];if(r&&i){let e=Buffer.from(xt(i),`base64`).toString(`utf8`);return{token:Buffer.from(`${r}:${e}`).toString(`base64`),type:`Basic`,username:r,password:e}}let a=t[`${e}:_auth`]||t[`${e}/:_auth`];if(a)return{token:xt(a),type:`Basic`}}function R(e,t){let n=new URL(e.startsWith(`//`)?`http:${e}`:e),r;for(;r!==`/`&&n.pathname!==r;){r=n.pathname||`/`;let e=St(`//${n.host}${r.replace(/\/$/,``)}`,t);if(e)return e;let i=r.endsWith(`/`)?r:`${r}/`;n.pathname=new URL(`..`,new URL(i,`http://x`)).pathname}let i=t._auth;if(i)return{token:xt(i),type:`Basic`}}function Ct(e,t){let n=t[`${e}:registry`]||t.registry;return n.endsWith(`/`)?n:`${n}/`}function wt(e,t){L||=bt();let n=e.startsWith(`@`)?(/@[a-z0-9][\w-.]+/.exec(e)||[``])[0]:``,r=`${n}:${t}`,i=yt.get(r);if(i)return i;let a;if(!e.startsWith(`@`))a={auth:R(t,L),registry:t};else{let e=P(Ct(n,L));if(e!==t)try{let n=R(e,L);a=n?.token?{auth:n,registry:e}:{auth:R(t,L),registry:t}}catch{a={auth:R(t,L),registry:t}}else a={auth:R(t,L),registry:t}}return yt.set(r,a),a}async function Tt(e,t,n,r,i){L||=bt();let{auth:a,registry:o}=wt(e,P((typeof r.registry==`string`?r.registry:!1)||n.registry||L.registry||vt)),c=`${o}/${(t===`resolutions`?s(e):e).replace(/\//g,`%2f`)}`,l=await i.doFetch(c,{signal:AbortSignal.timeout(i.fetchTimeout),...Xe(a?.type,a?.token)});if(l?.ok)return[await l.json(),t,o,e];throw l?.status&&l?.statusText?Error(`Received ${l.status} ${l.statusText} from ${c}`):Error(`Unable to fetch ${e} from ${o}`)}function z(e){return e.startsWith(`npm:@jsr/`)||e.startsWith(`jsr:`)}function Et(e,t){if(e.startsWith(`npm:@jsr/`)){let t=/^npm:@jsr\/([^_]+)__([^@]+)@(.+)$/.exec(e);if(t)return{scope:t[1],name:t[2],version:t[3]}}else if(e.startsWith(`jsr:@`)){let t=/^jsr:@([^/]+)\/([^@]+)@(.+)$/.exec(e);if(t)return{scope:t[1],name:t[2],version:t[3]}}else if(e.startsWith(`jsr:`)){let n=e.substring(4);if(t?.startsWith(`@`)){let e=/^@([^/]+)\/(.+)$/.exec(t);if(e)return{scope:e[1],name:e[2],version:n}}}return{scope:null,name:null,version:``}}async function Dt(e,t,n){let r=/^@([^/]+)\/(.+)$/.exec(e);if(!r)throw Error(`Invalid JSR package name: ${e}`);let[,i,a]=r,o=`${n.jsrApiUrl}/@${i}/${a}/meta.json`,s=await n.doFetch(o,{signal:AbortSignal.timeout(n.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}});if(s?.ok){let r=await s.json(),i={},a={};for(let[e,t]of Object.entries(r.versions))i[e]={version:e,time:t.createdAt},a[e]=t.createdAt;return[{name:e,"dist-tags":{latest:r.latest},versions:i,time:a},t,n.jsrApiUrl,e]}else if(s?.status&&s?.statusText)throw Error(`Received ${s.status} ${s.statusText} from ${o}`);else throw Error(`Unable to fetch ${e} from JSR`)}function Ot(e,t){let n=e;for(let[e,{old:r,oldOrig:i}]of Object.entries(t)){let[a,o]=e.split(`\0`),s=i||r;if(a===`packageManager`){let r=RegExp(`"${N(a)}": *"${o}@${N(s)}"`,`g`);n=n.replace(r,`"${a}": "${o}@${t[e].new}"`)}else{let r=RegExp(`"${N(o)}": *"${N(s)}"`,`g`);n=n.replace(r,`"${o}": "${t[e].new}"`)}}return n}function kt(e,t,n){let r=e.replace(_t,t);if(n&&n!==e&&/^[\^~]/.test(r)){let e=n.substring(1).split(`.`),t=r.substring(1).split(`.`);e.length!==t.length&&(r=`${r[0]}${t.slice(0,e.length).join(`.`)}`)}if(n&&n!==e&&r.startsWith(`>=`)){let e=/^>=\s/.test(n)?`>= `:`>=`,t=n.replace(/^>=\s*/,``),i=r.replace(/^>=\s*/,``),a=t.split(`.`),o=i.split(`.`);a.length!==o.length&&(r=`${e}${o.slice(0,a.length).join(`.`)}`)}return r}function At(e){let t=e.match(gt);return t?.length===1?e.replace(gt,F(t[0])):e}async function jt(e,t,n){try{let r=await I(`${n.forgeApiUrl}/repos/${e}/${t}/commits`,n);if(!r?.ok)return{hash:``,commit:{}};let{sha:i,commit:a}=(await r.json())[0];return{hash:i,commit:a}}catch{return{hash:``,commit:{}}}}async function Mt(e,t,n){return(await Pt(n.forgeApiUrl,e,t,n)).map(e=>e.name)}function Nt(e){return e.map(e=>({name:e.name,commitSha:e.commit?.sha||``}))}async function Pt(e,t,n,r){try{let i=await I(`${e}/repos/${t}/${n}/tags?per_page=100`,r);if(!i?.ok)return[];let a=Nt(await i.json()),o=i.headers.get(`link`)||``,s=/<([^>]+)>;\s*rel="last"/.exec(o);if(s){let i=Number(new URL(s[1]).searchParams.get(`page`)),o=await Promise.all(Array.from({length:i-1},(i,a)=>I(`${e}/repos/${t}/${n}/tags?per_page=100&page=${a+2}`,r)));for(let e of o)e?.ok&&a.push(...Nt(await e.json()))}return a}catch{return[]}}async function Ft(e,t,n,r){let i=t.old.replace(pt,``),[a,o,s,c]=mt.exec(i)||[];if(!o||!s||!c)return null;if(ht.test(c)){let{hash:n,commit:i}=await jt(o,s,r);if(!n)return null;let a=i?.committer?.date??i?.author?.date,l=n.substring(0,c.length);if(c!==l)return{key:e,newRange:t.old.replace(c,l),user:o,repo:s,oldRef:c,newRef:l,newDate:a}}else{let t=it(await Mt(o,s,r),c,n);if(t)return{key:e,newRange:t,user:o,repo:s,oldRef:c,newRef:t}}return null}async function It(e,t,n){let r=`${n.pypiApiUrl}/pypi/${e}/json`,i=await n.doFetch(r,{signal:AbortSignal.timeout(n.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}});if(i?.ok)return[await i.json(),t,null,e];throw i?.status&&i?.statusText?Error(`Received ${i.status} ${i.statusText} from ${r}`):Error(`Unable to fetch ${e} from ${n.pypiApiUrl}`)}function Lt(e,t){let n=e;for(let[e,{old:r,oldOrig:i}]of Object.entries(t)){let[a,o]=e.split(`\0`),s=i||r;n=n.replace(RegExp(`${N(o)} *= *"${N(s)}"`,`g`),`${o} = "${t[e].new}"`),n=n.replace(RegExp(`("${N(o)} *[<>=~]+ *)${N(s)}(")`,`g`),(n,r,i)=>`${r}${t[e].new}${i}`)}return n}const Rt=x(te);function zt(){let e=t.GOPROXY||`https://proxy.golang.org,direct`;for(let t of e.split(/[,|]/)){let e=t.trim();if(e&&e!==`direct`&&e!==`off`)return e.endsWith(`/`)?e.substring(0,e.length-1):e}return`https://proxy.golang.org`}function Bt(){return(t.GONOPROXY||t.GOPRIVATE||``).split(`,`).map(e=>e.trim()).filter(Boolean)}function Vt(e,t){return t.some(t=>e===t||e.startsWith(`${t}/`))}function Ht(e){return e.replace(/[A-Z]/g,e=>`!${e.toLowerCase()}`)}function Ut(e){let t=/\/v(\d+)$/.exec(e);return t?parseInt(t[1]):1}function B(e,t){return t<=1?e.replace(/\/v\d+$/,``):`${e.replace(/\/v\d+$/,``)}/v${t}`}function Wt(e){return/\d{14}-[0-9a-f]{12}$/.test(e)}function Gt(e){let t={},n={},r=new Set,i=e.split(/\r?\n/),a=!1,o=!1;for(let e of i){let i=e.trim();if(/^require\s*\(/.test(i)){a=!0;continue}if(/^replace\s*\(/.test(i)){o=!0;continue}if(i===`)`){a=!1,o=!1;continue}if(i.includes(`// indirect`))continue;if(o||/^replace\s+/.test(i)){let e=o?/^(\S+)(?:\s+v\S+)?\s+=>\s+(\S+)\s+(v\S+)/.exec(i):/^replace\s+(\S+)(?:\s+v\S+)?\s+=>\s+(\S+)\s+(v\S+)/.exec(i);if(e){let[,t,i,a]=e;!i.startsWith(`./`)&&!i.startsWith(`/`)&&!i.startsWith(`../`)&&(n[i]=a,r.add(t))}continue}let s=a?/^(\S+)\s+(v\S+)/.exec(i):/^require\s+(\S+)\s+(v\S+)/.exec(i);s&&(t[s[1]]=s[2])}for(let e of r)delete t[e];return{deps:t,replace:n}}async function Kt(e,n,r,i,a){let o=[{name:e,old:r,new:r},n,null,e],s=Ut(e),c=async(e,n)=>{try{let{stdout:r}=await Rt(`go`,[`list`,`-m`,`-json`,`${e}@latest`],{timeout:n,cwd:i,env:t}),a=JSON.parse(r);return{Version:a.Version,Time:a.Time||``,path:e}}catch{return null}},[l,u]=await Promise.all([c(e,a.fetchTimeout),c(B(e,s+1),a.goProbeTimeout)]);if(!l)return o;let d=l.Version,f=l.Time,p=d,m=f,h=e,g=e=>{p=e.Version,m=e.Time,h=e.path};if(u){g(u);let t=await c(B(e,s+2),a.goProbeTimeout);if(t){g(t);for(let t=s+3;t<=s+100;t+=20){let n=Math.min(t+20,s+101),r=Array.from({length:n-t},(n,r)=>c(B(e,t+r),a.goProbeTimeout)),i=await Promise.all(r),o=!1;for(let e of i){if(!e)break;g(e),o=!0}if(!o||i.some(e=>!e))break}}}return[{name:e,old:r,new:M(p),Time:m,...h===e?{}:{newPath:h},sameMajorNew:M(d),sameMajorTime:f},n,null,e]}async function qt(e,t,n,r,i,a){let o=[{name:e,old:n,new:n},t,null,e];if(Vt(e,a))return Kt(e,t,n,r,i);let s=Ht(e),c=Ut(e),l=async t=>{let n=B(e,t);return i.doFetch(`${i.goProxyUrl}/${Ht(n)}/@latest`,{signal:AbortSignal.timeout(i.goProbeTimeout)}).then(async e=>e.ok?{...await e.json(),path:n}:null).catch(()=>null)},[u,d]=await Promise.all([i.doFetch(`${i.goProxyUrl}/${s}/@latest`,{signal:AbortSignal.timeout(i.fetchTimeout)}),l(c+1)]);if(!u.ok)return o;let f,p;try{let e=await u.json();f=e.Version,p=e.Time}catch{return o}let m=f,h=p,g=e,_=e=>{m=e.Version,h=e.Time,g=e.path};if(d){_(d);let e=await l(c+2);if(e){_(e);for(let e=c+3;e<=c+100;e+=20){let t=Math.min(e+20,c+101),n=Array.from({length:t-e},(t,n)=>({result:l(e+n)})),r=await Promise.all(n.map(e=>e.result)),i=!1;for(let e of r){if(!e)break;_(e),i=!0}if(!i||r.some(e=>!e))break}}}return[{name:e,old:n,new:M(m),Time:h,...g===e?{}:{newPath:g},sameMajorNew:M(f),sameMajorTime:p},t,null,e]}function Jt(e,t){let n=N(t);return e=e.replace(RegExp(`^replace\\s+${n}(\\s+v\\S+)?\\s+=>\\s+\\S+(\\s+v\\S+)?\\s*\\n`,`gm`),``),e=e.replace(RegExp(`^\\s+${n}(\\s+v\\S+)?\\s+=>\\s+\\S+(\\s+v\\S+)?\\s*\\n`,`gm`),``),e=e.replace(/^replace\s*\(\s*\)\s*\n/gm,``),e}function Yt(e,t){let n=e,r={};for(let[e,{old:i,oldOrig:a}]of Object.entries(t)){let[o,s]=e.split(`\0`),c=a||i,l=t[e].new;if(o===`replace`){n=n.replace(RegExp(`(=>\\s+${N(s)}\\s+)v${N(c)}`,`g`),`$1v${l}`);continue}let u=Ut(s),d=parseInt(l.split(`.`)[0]);if(u!==d&&d>1){let e=B(s,d);n=n.replace(RegExp(`${N(s)} +v${N(c)}`,`g`),`${e} v${l}`),r[s]=e}else n=n.replace(RegExp(`(${N(s)}) +v${N(c)}`,`g`),`$1 v${l}`);n=Jt(n,s)}return[n,r]}function Xt(e,t,n){if(!Object.keys(t).length)return;let r=p(`**/*.go`,{cwd:e});for(let i of r){let r=l(e,i),a=h(r,`utf8`),o=!1;for(let[e,n]of Object.entries(t)){let t=RegExp(`"${N(e)}(/|")`,`g`),r=a.replace(t,`"${n}$1`);r!==a&&(a=r,o=!0)}o&&n(r,a)}}function Zt(e){let t=`https://${Qt(e)}`,n=new URL(t),r=n.pathname.split(`/`);if(r.length>3){let[e,i,a,...o]=r;return n.pathname=`/${i}/${a}/${ot(t)}/${o.join(`/`)}`,n.toString()}else return t}function Qt(e){return/\/v[0-9]$/.test(e)?c(e):e}function $t(e){return e.replace(/-.*/,``)}const en=/^\s*-?\s*uses:\s*['"]?([^'"#\s]+)['"]?/gm,tn=/^[0-9a-f]{7,}$/i;function nn(e){if(e.startsWith(`docker://`)||e.startsWith(`./`))return null;let t=/^https?:\/\/([^/]+)\/(.+)$/.exec(e),n=t?.[1]??null,r=t?.[2]??e,i=r.indexOf(`@`);if(i===-1)return null;let a=r.substring(0,i),o=r.substring(i+1);if(!o)return null;let s=a.split(`/`);if(s.length<2)return null;let c=n?`${n}/${a}`:a;return{host:n,owner:s[0],repo:s[1],ref:o,name:c,isHash:tn.test(o)}}function rn(e,t){return e?e===`github.com`?`https://api.github.com`:`https://${e}/api/v1`:t}function an(e){return e.map(e=>({name:e.name,commitSha:e.commit?.sha||``}))}async function on(e,t,n,r){try{let i=await I(`${e}/repos/${t}/${n}/tags?per_page=100`,r);if(!i?.ok)return[];let a=an(await i.json()),o=i.headers.get(`link`)||``,s=/<([^>]+)>;\s*rel="last"/.exec(o);if(s){let i=Number(new URL(s[1]).searchParams.get(`page`)),o=await Promise.all(Array.from({length:i-1},(i,a)=>I(`${e}/repos/${t}/${n}/tags?per_page=100&page=${a+2}`,r)));for(let e of o)e?.ok&&a.push(...an(await e.json()))}return a}catch{return[]}}async function sn(e,t,n,r,i){try{let a=await I(`${e}/repos/${t}/${n}/git/commits/${r}`,i);if(!a?.ok)return``;let o=await a.json();return o?.committer?.date||o?.author?.date||``}catch{return``}}function cn(e,t){let n=t.startsWith(`v`),r=ce(M(e)),i=M(t).split(`.`).length,a;return a=r?i===1?String(r.major):i===2?`${r.major}.${r.minor}`:r.version:M(e),n?`v${a}`:a}function ln(e,t){let n=e;for(let{name:e,oldRef:r,newRef:i}of t){let t=RegExp(`(uses:\\s*['"]?)${N(e)}@${N(r)}`,`g`);n=n.replace(t,`$1${e}@${i}`)}return n}function un(e){let t=e.replace(/\\/g,`/`);return/\.github\/workflows\/[^/]+\.(ya?ml)$/.test(t)}function dn(e){try{return g(e).filter(e=>/\.(ya?ml)$/.test(e)).map(t=>u(l(e,t)))}catch{return[]}}function fn(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function pn(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
3
+ `)}return r}const Ge={y:365,m:30,w:7,d:1,h:1/24,s:1/86400};function Ke(e){let t=/^(\d+(?:\.\d+)?)\s*([a-z])$/i.exec(e);if(t){let[,e,n]=t,r=Ge[n.toLowerCase()];if(r)return Number(e)*r}let n=Number(e);if(!Number.isFinite(n))throw Error(`Invalid cooldown value: ${e}`);return n}function qe(){let e=new Map,t=new Map,n=ee.lookup;ee.lookup=function(r,...i){let a={},o;typeof i[0]==`function`?o=i[0]:(a=typeof i[0]==`number`?{family:i[0]}:i[0]||{},o=i[1]);let s=e.get(r);if(s){a.all?o(null,s):o(null,s[0].address,s[0].family);return}if(t.has(r)){t.get(r).push({options:a,callback:o});return}t.set(r,[{options:a,callback:o}]),n.call(ee,r,{all:!0},(n,i)=>{let a=t.get(r);t.delete(r),!n&&i?.length&&e.set(r,i);for(let{options:e,callback:t}of a)n?t(n):e.all?t(null,i):t(null,i[0].address,i[0].family)})}}const Je=`17.6.2`,Ye=5e3,M=e=>e.replace(/^v/,``),N=e=>e.replace(/[|\\{}()[\]^$+*?.-]/g,`\\$&`),P=e=>e.endsWith(`/`)?e.substring(0,e.length-1):e;function Xe(e,t){return{headers:{"user-agent":`updates/${Je}`,"accept-encoding":`gzip, deflate, br`,...t&&{Authorization:`${e} ${t}`}}}}async function Ze(e,t,n,r,i,a,o){n&&r&&i&&r(`${i(`fetch`)} ${e}`);let s=await fetch(e,t);return n&&r&&a&&o&&r(`${s.ok?a(s.status):o(s.status)} ${e}`),s}function F(e){let t=ce(e);return t?!!t.prerelease.length:!1}function Qe(e){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(e)}function $e(e,t,{useRel:n,allowDowngrade:r,name:i,matchesAny:a}){let o=I(e),s=I(t);if(!o||!s)return!0;let c=Qe(e)||F(e),l=F(t);return c&&!l?pe(s,o)||n:!l&&he(s,o)?r===!0||a(i,r):!0}function I(e){try{return de(e)?.version??``}catch{return``}}function et(e,t,{range:n,semvers:r,usePre:i,useRel:a,useGreatest:o,pinnedRange:s}){let c=I(n);if(!c)return c;i=Qe(n)||i,i&&(r.add(`prerelease`),r.has(`patch`)&&r.add(`prepatch`),r.has(`minor`)&&r.add(`preminor`),r.has(`major`)&&r.add(`premajor`));let l=0,u=c;for(let n of t){let t=ce(n);if(!t?.version||t.prerelease.length&&(!i||a))continue;let c=t.version;if(s&&!Ee(c,s))continue;let d=fe(u,c);if(!(!d||!r.has(d)))if(o||!(`time`in e))me(I(c),u)&&(u=c);else{let t=Date.parse(e.time[n]);t>=0&&t>l&&(u=c,l=t)}}return u||null}function tt(e,{mode:t,range:n,useGreatest:r,useRel:i,usePre:a,semvers:o,pinnedRange:s},{allowDowngrade:c,matchesAny:l,isGoPseudoVersion:u}){if(n===`*`||n.includes(`||`))return null;let d=[];if(t===`pypi`)d=Object.keys(e.releases).filter(e=>k(e));else if(t===`npm`)d=Object.keys(e.versions).filter(e=>k(e));else if(t===`go`){let t=I(n);if(!t)return null;let r=a||Qe(n),s=e=>F(e)&&(!r||i),d={useRel:i,allowDowngrade:c,name:e.name,matchesAny:l},f=e.old||n,p=I(e.new);if(p&&!u(e.new)&&!s(e.new)){let n=fe(t,p);if(n&&o.has(n)&&$e(f,e.new,d))return e.new}let m=I(e.sameMajorNew);if(m&&!u(e.sameMajorNew)&&!s(e.sameMajorNew)){let n=fe(t,m);if(n&&o.has(n)&&$e(f,e.sameMajorNew,d))return e.Time=e.sameMajorTime,delete e.newPath,e.sameMajorNew}return null}let f=et(e,d,{range:n,semvers:o,usePre:a,useRel:i,useGreatest:r,pinnedRange:s});if(!f)return null;if(r)return f;{let r=``,u=``;t===`pypi`?(u=e.info.version,r=I(e.info.version)):r=e[`dist-tags`].latest;let d=I(n),p=Qe(n),m=F(f),h=F(r),g={useRel:i,allowDowngrade:c,name:e.name,matchesAny:l};if(!i&&a||p&&m)return f;if(p&&!m)return $e(n,f,g)?f:null;let _=fe(d,r);return _&&_!==`prerelease`&&!o.has(_.replace(/^pre/,``))||i&&F(r)?f:he(r,d)&&!h?$e(n,r,g)?r:null:!p&&h&&!a||s&&!Ee(r,s)?f:u||r}}const nt=new Map;if(t.UPDATES_FORGE_TOKENS)for(let e of t.UPDATES_FORGE_TOKENS.split(`,`)){let t=e.indexOf(`:`);t>0&&nt.set(e.substring(0,t),e.substring(t+1))}function rt(e){try{let t=nt.get(new URL(e).hostname);if(t)return t}catch{}return t.UPDATES_GITHUB_API_TOKEN||t.GITHUB_API_TOKEN||t.GH_TOKEN||t.GITHUB_TOKEN||t.HOMEBREW_GITHUB_API_TOKEN}function L(e,t){let n={signal:AbortSignal.timeout(t.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}},r=rt(e);return r&&(n.headers={...n.headers,Authorization:`Bearer ${r}`}),t.doFetch(e,n)}function it(e,t,n){let r=M(t);if(!k(r))return null;if(n){let n=t,i=M(t);for(let t of e){let e=M(t);k(e)&&(!n||pe(e,i))&&(n=t,i=e)}if(ge(r,i))return n}else{let t=e.at(-1);if(!t)return null;let n=M(t);if(!k(n))return null;if(ge(r,n))return t}return null}function at(e){return e=e.replace(`git@`,``).replace(/.+?\/\//,`https://`).replace(/\.git$/,``),/^[a-z]+:[a-z0-9-]\/[a-z0-9-]$/.test(e)?e.replace(/^(.+?):/,(e,t)=>`https://${t}.com/`):/^[a-z0-9-]\/[a-z0-9-]$/.test(e)?`https://github.com/${e}`:e}function ot(e){return e.startsWith(`https://bitbucket.org`)?`src/HEAD`:`tree/HEAD`}function st({repository:e,homepage:t,info:n},r,i){n&&(e=n.project_urls.repository||n.project_urls.Repository||n.project_urls.repo||n.project_urls.Repo||n.project_urls.source||n.project_urls.Source||n.project_urls[`source code`]||n.project_urls[`Source code`]||n.project_urls[`Source Code`]||n.project_urls.homepage||n.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a=``;return r===`https://npm.pkg.github.com`?`https://github.com/${i.replace(/^@/,``)}`:(e&&(a=at(typeof e==`string`?e:e.url),a&&typeof e!=`string`&&e.directory&&(a=`${a}/${ot(a)}/${e.directory}`)),a||t||``)}function ct(e){if(/^\s*\{/.test(e))return JSON.parse(e);let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e||e.startsWith(`#`)||e.startsWith(`;`))continue;let r=e.indexOf(`=`);if(r===-1)continue;let i=e.slice(r+1).trim();i.length>=2&&(i.startsWith(`"`)&&i.endsWith(`"`)||i.startsWith(`'`)&&i.endsWith(`'`))&&(i=i.slice(1,-1)),t[e.slice(0,r).trim()]=i}return t}function lt(e){try{return ct(h(e,`utf-8`))}catch{return}}function ut(t){let n=e();for(;;){let e=l(n,t);try{return _(e),e}catch{}let r=c(n);if(r===n)break;n=r}}function dt(e){let n={},r=e.toLowerCase();for(let[i,a]of Object.entries(t))if(i.toLowerCase().startsWith(r)){let t=i.substring(e.length).split(`__`).filter(Boolean);if(t.length===0)continue;let r=n;for(let e=0;e<t.length;e++){let n=t[e];if(e===t.length-1)r[n]=a;else if(r[n]===void 0&&(r[n]={}),typeof r[n]==`object`)r=r[n];else break}}return n}function ft(e,n={}){let i=r===`win32`,a=i?t.USERPROFILE:t.HOME,o=[{...n}],s=[];function c(e){if(!e||s.includes(e))return;let t=lt(e);t&&(o.push(t),s.push(e))}i||(c(l(`/etc`,e,`config`)),c(l(`/etc`,`${e}rc`))),a&&(c(l(a,`.config`,e,`config`)),c(l(a,`.config`,e)),c(l(a,`.${e}`,`config`)),c(l(a,`.${e}rc`))),c(ut(`.${e}rc`));let u=dt(`${e}_`);return u.config&&c(u.config),Object.assign({},...o,u,s.length?{configs:s,config:s[s.length-1]}:void 0)}const pt=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,mt=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,ht=/^[0-9a-f]{7,}$/i,gt=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,_t=/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,vt=`https://registry.npmjs.org`;let R=null;const yt=new Map;function bt(){return R||ft(`npm`,{registry:vt})}function xt(e){return e.replace(/^\$\{?([^}]*)\}?$/,(e,n)=>t[n]||``)}function St(e,t){let n=t[`${e}:_authToken`]||t[`${e}/:_authToken`];if(n)return{token:xt(n),type:`Bearer`};let r=t[`${e}:username`]||t[`${e}/:username`],i=t[`${e}:_password`]||t[`${e}/:_password`];if(r&&i){let e=Buffer.from(xt(i),`base64`).toString(`utf8`);return{token:Buffer.from(`${r}:${e}`).toString(`base64`),type:`Basic`,username:r,password:e}}let a=t[`${e}:_auth`]||t[`${e}/:_auth`];if(a)return{token:xt(a),type:`Basic`}}function z(e,t){let n=new URL(e.startsWith(`//`)?`http:${e}`:e),r;for(;r!==`/`&&n.pathname!==r;){r=n.pathname||`/`;let e=St(`//${n.host}${r.replace(/\/$/,``)}`,t);if(e)return e;let i=r.endsWith(`/`)?r:`${r}/`;n.pathname=new URL(`..`,new URL(i,`http://x`)).pathname}let i=t._auth;if(i)return{token:xt(i),type:`Basic`}}function Ct(e,t){let n=t[`${e}:registry`]||t.registry;return n.endsWith(`/`)?n:`${n}/`}function wt(e,t){R||=bt();let n=e.startsWith(`@`)?(/@[a-z0-9][\w-.]+/.exec(e)||[``])[0]:``,r=`${n}:${t}`,i=yt.get(r);if(i)return i;let a;if(!e.startsWith(`@`))a={auth:z(t,R),registry:t};else{let e=P(Ct(n,R));if(e!==t)try{let n=z(e,R);a=n?.token?{auth:n,registry:e}:{auth:z(t,R),registry:t}}catch{a={auth:z(t,R),registry:t}}else a={auth:z(t,R),registry:t}}return yt.set(r,a),a}async function Tt(e,t,n,r,i){R||=bt();let{auth:a,registry:o}=wt(e,P((typeof r.registry==`string`?r.registry:!1)||n.registry||R.registry||vt)),c=`${o}/${(t===`resolutions`?s(e):e).replace(/\//g,`%2f`)}`,l=await i.doFetch(c,{signal:AbortSignal.timeout(i.fetchTimeout),...Xe(a?.type,a?.token)});if(l?.ok)return[await l.json(),t,o,e];throw l?.status&&l?.statusText?Error(`Received ${l.status} ${l.statusText} from ${c}`):Error(`Unable to fetch ${e} from ${o}`)}function B(e){return e.startsWith(`npm:@jsr/`)||e.startsWith(`jsr:`)}function Et(e,t){if(e.startsWith(`npm:@jsr/`)){let t=/^npm:@jsr\/([^_]+)__([^@]+)@(.+)$/.exec(e);if(t)return{scope:t[1],name:t[2],version:t[3]}}else if(e.startsWith(`jsr:@`)){let t=/^jsr:@([^/]+)\/([^@]+)@(.+)$/.exec(e);if(t)return{scope:t[1],name:t[2],version:t[3]}}else if(e.startsWith(`jsr:`)){let n=e.substring(4);if(t?.startsWith(`@`)){let e=/^@([^/]+)\/(.+)$/.exec(t);if(e)return{scope:e[1],name:e[2],version:n}}}return{scope:null,name:null,version:``}}async function Dt(e,t,n){let r=/^@([^/]+)\/(.+)$/.exec(e);if(!r)throw Error(`Invalid JSR package name: ${e}`);let[,i,a]=r,o=`${n.jsrApiUrl}/@${i}/${a}/meta.json`,s=await n.doFetch(o,{signal:AbortSignal.timeout(n.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}});if(s?.ok){let r=await s.json(),i={},a={};for(let[e,t]of Object.entries(r.versions))i[e]={version:e,time:t.createdAt},a[e]=t.createdAt;return[{name:e,"dist-tags":{latest:r.latest},versions:i,time:a},t,n.jsrApiUrl,e]}else if(s?.status&&s?.statusText)throw Error(`Received ${s.status} ${s.statusText} from ${o}`);else throw Error(`Unable to fetch ${e} from JSR`)}function Ot(e,t){let n=e;for(let[e,{old:r,oldOrig:i}]of Object.entries(t)){let[a,o]=e.split(`\0`),s=i||r;if(a===`packageManager`){let r=RegExp(`"${N(a)}": *"${o}@${N(s)}"`,`g`);n=n.replace(r,`"${a}": "${o}@${t[e].new}"`)}else{let r=RegExp(`"${N(o)}": *"${N(s)}"`,`g`);n=n.replace(r,`"${o}": "${t[e].new}"`)}}return n}function kt(e,t,n){let r=e.replace(_t,t);if(n&&n!==e&&/^[\^~]/.test(r)){let e=n.substring(1).split(`.`),t=r.substring(1).split(`.`);e.length!==t.length&&(r=`${r[0]}${t.slice(0,e.length).join(`.`)}`)}if(n&&n!==e&&r.startsWith(`>=`)){let e=/^>=\s/.test(n)?`>= `:`>=`,t=n.replace(/^>=\s*/,``),i=r.replace(/^>=\s*/,``),a=t.split(`.`),o=i.split(`.`);a.length!==o.length&&(r=`${e}${o.slice(0,a.length).join(`.`)}`)}return r}function At(e){let t=e.match(gt);return t?.length===1?e.replace(gt,I(t[0])):e}async function jt(e,t,n){try{let r=await L(`${n.forgeApiUrl}/repos/${e}/${t}/commits`,n);if(!r?.ok)return{hash:``,commit:{}};let{sha:i,commit:a}=(await r.json())[0];return{hash:i,commit:a}}catch{return{hash:``,commit:{}}}}async function Mt(e,t,n){return(await Pt(n.forgeApiUrl,e,t,n)).map(e=>e.name)}function Nt(e){return e.map(e=>({name:e.name,commitSha:e.commit?.sha||``}))}async function Pt(e,t,n,r){try{let i=await L(`${e}/repos/${t}/${n}/tags?per_page=100`,r);if(!i?.ok)return[];let a=Nt(await i.json()),o=i.headers.get(`link`)||``,s=/<([^>]+)>;\s*rel="last"/.exec(o);if(s){let i=Number(new URL(s[1]).searchParams.get(`page`)),o=await Promise.all(Array.from({length:i-1},(i,a)=>L(`${e}/repos/${t}/${n}/tags?per_page=100&page=${a+2}`,r)));for(let e of o)e?.ok&&a.push(...Nt(await e.json()))}return a}catch{return[]}}async function Ft(e,t,n,r){let i=t.old.replace(pt,``),[a,o,s,c]=mt.exec(i)||[];if(!o||!s||!c)return null;if(ht.test(c)){let{hash:n,commit:i}=await jt(o,s,r);if(!n)return null;let a=i?.committer?.date??i?.author?.date,l=n.substring(0,c.length);if(c!==l)return{key:e,newRange:t.old.replace(c,l),user:o,repo:s,oldRef:c,newRef:l,newDate:a}}else{let t=it(await Mt(o,s,r),c,n);if(t)return{key:e,newRange:t,user:o,repo:s,oldRef:c,newRef:t}}return null}async function It(e,t,n){let r=`${n.pypiApiUrl}/pypi/${e}/json`,i=await n.doFetch(r,{signal:AbortSignal.timeout(n.fetchTimeout),headers:{"accept-encoding":`gzip, deflate, br`}});if(i?.ok)return[await i.json(),t,null,e];throw i?.status&&i?.statusText?Error(`Received ${i.status} ${i.statusText} from ${r}`):Error(`Unable to fetch ${e} from ${n.pypiApiUrl}`)}function Lt(e,t){let n=e;for(let[e,{old:r,oldOrig:i}]of Object.entries(t)){let[a,o]=e.split(`\0`),s=i||r;n=n.replace(RegExp(`${N(o)} *= *"${N(s)}"`,`g`),`${o} = "${t[e].new}"`),n=n.replace(RegExp(`("${N(o)} *[<>=~]+ *)${N(s)}(")`,`g`),(n,r,i)=>`${r}${t[e].new}${i}`)}return n}const Rt=x(te);function zt(){let e=t.GOPROXY||`https://proxy.golang.org,direct`;for(let t of e.split(/[,|]/)){let e=t.trim();if(e&&e!==`direct`&&e!==`off`)return e.endsWith(`/`)?e.substring(0,e.length-1):e}return`https://proxy.golang.org`}function Bt(){return(t.GONOPROXY||t.GOPRIVATE||``).split(`,`).map(e=>e.trim()).filter(Boolean)}function Vt(e,t){return t.some(t=>e===t||e.startsWith(`${t}/`))}function Ht(e){return e.replace(/[A-Z]/g,e=>`!${e.toLowerCase()}`)}function Ut(e){let t=/\/v(\d+)$/.exec(e);return t?parseInt(t[1]):1}function V(e,t){return t<=1?e.replace(/\/v\d+$/,``):`${e.replace(/\/v\d+$/,``)}/v${t}`}function Wt(e){return/\d{14}-[0-9a-f]{12}$/.test(e)}function Gt(e){let t={},n={},r=new Set,i=e.split(/\r?\n/),a=!1,o=!1;for(let e of i){let i=e.trim();if(/^require\s*\(/.test(i)){a=!0;continue}if(/^replace\s*\(/.test(i)){o=!0;continue}if(i===`)`){a=!1,o=!1;continue}if(i.includes(`// indirect`))continue;if(o||/^replace\s+/.test(i)){let e=o?/^(\S+)(?:\s+v\S+)?\s+=>\s+(\S+)\s+(v\S+)/.exec(i):/^replace\s+(\S+)(?:\s+v\S+)?\s+=>\s+(\S+)\s+(v\S+)/.exec(i);if(e){let[,t,i,a]=e;!i.startsWith(`./`)&&!i.startsWith(`/`)&&!i.startsWith(`../`)&&(n[i]=a,r.add(t))}continue}let s=a?/^(\S+)\s+(v\S+)/.exec(i):/^require\s+(\S+)\s+(v\S+)/.exec(i);s&&(t[s[1]]=s[2])}for(let e of r)delete t[e];return{deps:t,replace:n}}async function Kt(e,n,r,i,a){let o=[{name:e,old:r,new:r},n,null,e],s=Ut(e),c=async(e,n)=>{try{let{stdout:r}=await Rt(`go`,[`list`,`-m`,`-json`,`${e}@latest`],{timeout:n,cwd:i,env:t}),a=JSON.parse(r);return{Version:a.Version,Time:a.Time||``,path:e}}catch{return null}},[l,u]=await Promise.all([c(e,a.fetchTimeout),c(V(e,s+1),a.goProbeTimeout)]);if(!l)return o;let d=l.Version,f=l.Time,p=d,m=f,h=e,g=e=>{p=e.Version,m=e.Time,h=e.path};if(u){g(u);let t=await c(V(e,s+2),a.goProbeTimeout);if(t){g(t);for(let t=s+3;t<=s+100;t+=20){let n=Math.min(t+20,s+101),r=Array.from({length:n-t},(n,r)=>c(V(e,t+r),a.goProbeTimeout)),i=await Promise.all(r),o=!1;for(let e of i){if(!e)break;g(e),o=!0}if(!o||i.some(e=>!e))break}}}return[{name:e,old:r,new:M(p),Time:m,...h===e?{}:{newPath:h},sameMajorNew:M(d),sameMajorTime:f},n,null,e]}async function qt(e,t,n,r,i,a){let o=[{name:e,old:n,new:n},t,null,e];if(Vt(e,a))return Kt(e,t,n,r,i);let s=Ht(e),c=Ut(e),l=async t=>{let n=V(e,t);return i.doFetch(`${i.goProxyUrl}/${Ht(n)}/@latest`,{signal:AbortSignal.timeout(i.goProbeTimeout)}).then(async e=>e.ok?{...await e.json(),path:n}:null).catch(()=>null)},[u,d]=await Promise.all([i.doFetch(`${i.goProxyUrl}/${s}/@latest`,{signal:AbortSignal.timeout(i.fetchTimeout)}),l(c+1)]);if(!u.ok)return o;let f,p;try{let e=await u.json();f=e.Version,p=e.Time}catch{return o}let m=f,h=p,g=e,_=e=>{m=e.Version,h=e.Time,g=e.path};if(d){_(d);let e=await l(c+2);if(e){_(e);for(let e=c+3;e<=c+100;e+=20){let t=Math.min(e+20,c+101),n=Array.from({length:t-e},(t,n)=>({result:l(e+n)})),r=await Promise.all(n.map(e=>e.result)),i=!1;for(let e of r){if(!e)break;_(e),i=!0}if(!i||r.some(e=>!e))break}}}return[{name:e,old:n,new:M(m),Time:h,...g===e?{}:{newPath:g},sameMajorNew:M(f),sameMajorTime:p},t,null,e]}function Jt(e,t){let n=N(t);return e=e.replace(RegExp(`^replace\\s+${n}(\\s+v\\S+)?\\s+=>\\s+\\S+(\\s+v\\S+)?\\s*\\n`,`gm`),``),e=e.replace(RegExp(`^\\s+${n}(\\s+v\\S+)?\\s+=>\\s+\\S+(\\s+v\\S+)?\\s*\\n`,`gm`),``),e=e.replace(/^replace\s*\(\s*\)\s*\n/gm,``),e}function Yt(e,t){let n=e,r={};for(let[e,{old:i,oldOrig:a}]of Object.entries(t)){let[o,s]=e.split(`\0`),c=a||i,l=t[e].new;if(o===`replace`){n=n.replace(RegExp(`(=>\\s+${N(s)}\\s+)v${N(c)}`,`g`),`$1v${l}`);continue}let u=Ut(s),d=parseInt(l.split(`.`)[0]);if(u!==d&&d>1){let e=V(s,d);n=n.replace(RegExp(`${N(s)} +v${N(c)}`,`g`),`${e} v${l}`),r[s]=e}else n=n.replace(RegExp(`(${N(s)}) +v${N(c)}`,`g`),`$1 v${l}`);n=Jt(n,s)}return[n,r]}function Xt(e,t,n){if(!Object.keys(t).length)return;let r=p(`**/*.go`,{cwd:e});for(let i of r){let r=l(e,i),a=h(r,`utf8`),o=!1;for(let[e,n]of Object.entries(t)){let t=RegExp(`"${N(e)}(/|")`,`g`),r=a.replace(t,`"${n}$1`);r!==a&&(a=r,o=!0)}o&&n(r,a)}}function Zt(e){let t=`https://${Qt(e)}`,n=new URL(t),r=n.pathname.split(`/`);if(r.length>3){let[e,i,a,...o]=r;return n.pathname=`/${i}/${a}/${ot(t)}/${o.join(`/`)}`,n.toString()}else return t}function Qt(e){return/\/v[0-9]$/.test(e)?c(e):e}function $t(e){return e.replace(/-.*/,``)}const en=/^\s*-?\s*uses:\s*['"]?([^'"#\s]+)['"]?/gm,tn=/^[0-9a-f]{7,}$/i;function nn(e){if(e.startsWith(`docker://`)||e.startsWith(`./`))return null;let t=/^https?:\/\/([^/]+)\/(.+)$/.exec(e),n=t?.[1]??null,r=t?.[2]??e,i=r.indexOf(`@`);if(i===-1)return null;let a=r.substring(0,i),o=r.substring(i+1);if(!o)return null;let s=a.split(`/`);if(s.length<2)return null;let c=n?`${n}/${a}`:a;return{host:n,owner:s[0],repo:s[1],ref:o,name:c,isHash:tn.test(o)}}function rn(e,t){return e?e===`github.com`?`https://api.github.com`:`https://${e}/api/v1`:t}function an(e){return e.map(e=>({name:e.name,commitSha:e.commit?.sha||``}))}async function on(e,t,n,r){try{let i=await L(`${e}/repos/${t}/${n}/tags?per_page=100`,r);if(!i?.ok)return[];let a=an(await i.json()),o=i.headers.get(`link`)||``,s=/<([^>]+)>;\s*rel="last"/.exec(o);if(s){let i=Number(new URL(s[1]).searchParams.get(`page`)),o=await Promise.all(Array.from({length:i-1},(i,a)=>L(`${e}/repos/${t}/${n}/tags?per_page=100&page=${a+2}`,r)));for(let e of o)e?.ok&&a.push(...an(await e.json()))}return a}catch{return[]}}async function sn(e,t,n,r,i){try{let a=await L(`${e}/repos/${t}/${n}/git/commits/${r}`,i);if(!a?.ok)return``;let o=await a.json();return o?.committer?.date||o?.author?.date||``}catch{return``}}function cn(e,t){let n=t.startsWith(`v`),r=ce(M(e)),i=M(t).split(`.`).length,a;return a=r?i===1?String(r.major):i===2?`${r.major}.${r.minor}`:r.version:M(e),n?`v${a}`:a}function ln(e,t){let n=e;for(let{name:e,oldRef:r,newRef:i}of t){let t=RegExp(`(uses:\\s*['"]?)${N(e)}@${N(r)}`,`g`);n=n.replace(t,`$1${e}@${i}`)}return n}function un(e){let t=e.replace(/\\/g,`/`);return/\.github\/workflows\/[^/]+\.(ya?ml)$/.test(t)}function dn(e){try{return g(e).filter(e=>/\.(ya?ml)$/.test(e)).map(t=>u(l(e,t)))}catch{return[]}}function fn(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function pn(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
4
4
  `,e===t&&(i+=` `.repeat(a+n+2),i+=`^
5
- `))}return i}var V,H=w((()=>{V=class extends Error{line;column;codeblock;constructor(e,t){let[n,r]=fn(t.toml,t.ptr),i=pn(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}}}));function mn(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}function hn(e,t=0,n=e.length){let r=e.indexOf(`
5
+ `))}return i}var H,U=w((()=>{H=class extends Error{line;column;codeblock;constructor(e,t){let[n,r]=fn(t.toml,t.ptr),i=pn(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}}}));function mn(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}function hn(e,t=0,n=e.length){let r=e.indexOf(`
6
6
  `,t);return e[r-1]===`\r`&&r--,r<=n?r:-1}function gn(e,t){for(let n=t;n<e.length;n++){let r=e[n];if(r===`
7
7
  `)return n;if(r===`\r`&&e[n+1]===`
8
- `)return n+1;if(r<` `&&r!==` `||r===``)throw new V(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}function U(e,t,n,r){let i;for(;(i=e[t])===` `||i===` `||!n&&(i===`
8
+ `)return n+1;if(r<` `&&r!==` `||r===``)throw new H(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}function W(e,t,n,r){let i;for(;(i=e[t])===` `||i===` `||!n&&(i===`
9
9
  `||i===`\r`&&e[t+1]===`
10
- `);)t++;return r||i!==`#`?t:U(e,gn(e,t),n)}function _n(e,t,n,r,i=!1){if(!r)return t=hn(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let t=e[a];if(t===`#`)a=hn(e,a);else if(t===n)return a+1;else if(t===r||i&&(t===`
10
+ `);)t++;return r||i!==`#`?t:W(e,gn(e,t),n)}function _n(e,t,n,r,i=!1){if(!r)return t=hn(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let t=e[a];if(t===`#`)a=hn(e,a);else if(t===n)return a+1;else if(t===r||i&&(t===`
11
11
  `||t===`\r`&&e[a+1]===`
12
- `))return a}throw new V(`cannot find end of structure`,{toml:e,ptr:t})}function vn(e,t){let n=e[t],r=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=r.length-1;do t=e.indexOf(r,++t);while(t>-1&&n!==`'`&&mn(e,t));return t>-1&&(t+=r.length,r.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}var yn=w((()=>{H()})),bn,xn,Sn=w((()=>{bn=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,xn=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(bn);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}}}));function Cn(e,t=0,n=e.length){let r=e[t]===`'`,i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]===`\r`&&t++,e[t]===`
12
+ `))return a}throw new H(`cannot find end of structure`,{toml:e,ptr:t})}function vn(e,t){let n=e[t],r=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=r.length-1;do t=e.indexOf(r,++t);while(t>-1&&n!==`'`&&mn(e,t));return t>-1&&(t+=r.length,r.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}var yn=w((()=>{U()})),bn,xn,Sn=w((()=>{bn=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,xn=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(bn);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}}}));function Cn(e,t=0,n=e.length){let r=e[t]===`'`,i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]===`\r`&&t++,e[t]===`
13
13
  `&&t++);let a=0,o,s=``,c=t;for(;t<n-1;){let n=e[t++];if(n===`
14
14
  `||n===`\r`&&e[t]===`
15
- `){if(!i)throw new V(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(n<` `&&n!==` `||n===``)throw new V(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(o){if(o=!1,n===`x`||n===`u`||n===`U`){let r=e.slice(t,t+=n===`x`?2:n===`u`?4:8);if(!On.test(r))throw new V(`invalid unicode escape`,{toml:e,ptr:a});try{s+=String.fromCodePoint(parseInt(r,16))}catch{throw new V(`invalid unicode escape`,{toml:e,ptr:a})}}else if(i&&(n===`
16
- `||n===` `||n===` `||n===`\r`)){if(t=U(e,t-1,!0),e[t]!==`
17
- `&&e[t]!==`\r`)throw new V(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:a});t=U(e,t)}else if(n in kn)s+=kn[n];else throw new V(`unrecognized escape sequence`,{toml:e,ptr:a});c=t}else !r&&n===`\\`&&(a=t-1,o=!0,s+=e.slice(c,a))}return s+e.slice(c,n-1)}function wn(e,t,n,r){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return r?0n:0;let i=Tn.test(e);if(i||En.test(e)){if(Dn.test(e))throw new V(`leading zeroes are not allowed`,{toml:t,ptr:n});e=e.replace(/_/g,``);let a=+e;if(isNaN(a))throw new V(`invalid number`,{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!r)throw new V(`integer value cannot be represented losslessly`,{toml:t,ptr:n});(i||r===!0)&&(a=BigInt(e))}return a}let a=new xn(e);if(!a.isValid())throw new V(`invalid value`,{toml:t,ptr:n});return a}var Tn,En,Dn,On,kn,An=w((()=>{yn(),Sn(),H(),Tn=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,En=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Dn=/^[+-]?0[0-9_]/,On=/^[0-9a-f]{2,8}$/i,kn={b:`\b`,t:` `,n:`
18
- `,f:`\f`,r:`\r`,e:`\x1B`,'"':`"`,"\\":`\\`}}));function jn(e,t,n){let r=e.slice(t,n),i=r.indexOf(`#`);return i>-1&&(gn(e,i),r=r.slice(0,i)),[r.trimEnd(),i]}function Mn(e,t,n,r,i){if(r===0)throw new V(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let a=e[t];if(a===`[`||a===`{`){let[o,s]=a===`[`?In(e,t,r,i):Fn(e,t,r,i);if(n){if(s=U(e,s),e[s]===`,`)s++;else if(e[s]!==n)throw new V(`expected comma or end of structure`,{toml:e,ptr:s})}return[o,s]}let o;if(a===`"`||a===`'`){o=vn(e,t);let r=Cn(e,t,o);if(n){if(o=U(e,o),e[o]&&e[o]!==`,`&&e[o]!==n&&e[o]!==`
19
- `&&e[o]!==`\r`)throw new V(`unexpected character encountered`,{toml:e,ptr:o});o+=+(e[o]===`,`)}return[r,o]}o=_n(e,t,`,`,n);let s=jn(e,t,o-+(e[o-1]===`,`));if(!s[0])throw new V(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return n&&s[1]>-1&&(o=U(e,t+s[1]),o+=+(e[o]===`,`)),[wn(s[0],e,t,i),o]}var Nn=w((()=>{An(),Rn(),yn(),H()}));function Pn(e,t,n=`=`){let r=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new V(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++r];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new V(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let s=vn(e,t);if(s<0)throw new V(`unfinished string encountered`,{toml:e,ptr:t});r=e.indexOf(`.`,s);let c=e.slice(s,r<0||r>a?a:r),l=hn(c);if(l>-1)throw new V(`newlines are not allowed in keys`,{toml:e,ptr:t+r+l});if(c.trimStart())throw new V(`found extra tokens after the string part`,{toml:e,ptr:s});if(a<s&&(a=e.indexOf(n,s),a<0))throw new V(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});i.push(Cn(e,t,s))}else{r=e.indexOf(`.`,t);let n=e.slice(t,r<0||r>a?a:r);if(!Ln.test(n))throw new V(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});i.push(n.trimEnd())}}while(r+1&&r<a);return[i,U(e,a+1,!0,!0)]}function Fn(e,t,n,r){let i={},a=new Set,o;for(t++;(o=e[t++])!==`}`&&o;)if(o===`,`)throw new V(`expected value, found comma`,{toml:e,ptr:t-1});else if(o===`#`)t=gn(e,t);else if(o!==` `&&o!==` `&&o!==`
20
- `&&o!==`\r`){let o,s=i,c=!1,[l,u]=Pn(e,t-1);for(let n=0;n<l.length;n++){if(n&&(s=c?s[o]:s[o]={}),o=l[n],(c=Object.hasOwn(s,o))&&(typeof s[o]!=`object`||a.has(s[o])))throw new V(`trying to redefine an already defined value`,{toml:e,ptr:t});!c&&o===`__proto__`&&Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new V(`trying to redefine an already defined value`,{toml:e,ptr:t});let[d,f]=Mn(e,u,`}`,n-1,r);a.add(d),s[o]=d,t=f}if(!o)throw new V(`unfinished table encountered`,{toml:e,ptr:t});return[i,t]}function In(e,t,n,r){let i=[],a;for(t++;(a=e[t++])!==`]`&&a;)if(a===`,`)throw new V(`expected value, found comma`,{toml:e,ptr:t-1});else if(a===`#`)t=gn(e,t);else if(a!==` `&&a!==` `&&a!==`
21
- `&&a!==`\r`){let a=Mn(e,t-1,`]`,n-1,r);i.push(a[0]),t=a[1]}if(!a)throw new V(`unfinished array encountered`,{toml:e,ptr:t});return[i,t]}var Ln,Rn=w((()=>{An(),Nn(),yn(),H(),Ln=/^[a-zA-Z0-9-_]+[ \t]*$/}));function zn(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}function Bn(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let r={},i={},a=r,o=i;for(let s=U(e,0);s<e.length;){if(e[s]===`[`){let t=e[++s]===`[`,n=Pn(e,s+=+t,`]`);if(t){if(e[n[1]-1]!==`]`)throw new V(`expected end of table declaration`,{toml:e,ptr:n[1]-1});n[1]++}let c=zn(n[0],r,i,t?2:1);if(!c)throw new V(`trying to redefine an already defined table or value`,{toml:e,ptr:s});o=c[2],a=c[1],s=n[1]}else{let r=Pn(e,s),i=zn(r[0],a,o,0);if(!i)throw new V(`trying to redefine an already defined table or value`,{toml:e,ptr:s});let c=Mn(e,r[1],void 0,t,n);i[1][i[0]]=c[0],s=c[1]}if(s=U(e,s,!0),e[s]&&e[s]!==`
22
- `&&e[s]!==`\r`)throw new V(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:s});s=U(e,s)}return r}var Vn=w((()=>{Rn(),Nn(),yn(),H()}));function W(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(e instanceof Date)return`date`}return t}function Hn(e){for(let t=0;t<e.length;t++)if(W(e[t])!==`object`)return!1;return e.length!=0}function Un(e){return JSON.stringify(e).replace(/\x7f/g,`\\u007f`)}function Wn(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);if(t===`number`)return isNaN(e)?`nan`:e===1/0?`inf`:e===-1/0?`-inf`:r&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t===`bigint`||t===`boolean`)return e.toString();if(t===`string`)return Un(e);if(t===`date`){if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString()}if(t===`object`)return Gn(e,n,r);if(t===`array`)return Kn(e,n,r)}function Gn(e,t,n){let r=Object.keys(e);if(r.length===0)return`{}`;let i=`{ `;for(let a=0;a<r.length;a++){let o=r[a];a&&(i+=`, `),i+=Xn.test(o)?o:Un(o),i+=` = `,i+=Wn(e[o],W(e[o]),t-1,n)}return i+` }`}function Kn(e,t,n){if(e.length===0)return`[]`;let r=`[ `;for(let i=0;i<e.length;i++){if(i&&(r+=`, `),e[i]===null||e[i]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);r+=Wn(e[i],W(e[i]),t-1,n)}return r+` ]`}function qn(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let i=``;for(let a=0;a<e.length;a++)i+=`${i&&`
23
- `}[[${t}]]\n`,i+=Jn(0,e[a],t,n,r);return i}function Jn(e,t,n,r,i){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``,o=``,s=Object.keys(t);for(let e=0;e<s.length;e++){let c=s[e];if(t[c]!==null&&t[c]!==void 0){let e=W(t[c]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let s=Xn.test(c)?c:Un(c);if(e===`array`&&Hn(t[c]))o+=(o&&`
15
+ `){if(!i)throw new H(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(n<` `&&n!==` `||n===``)throw new H(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(o){if(o=!1,n===`x`||n===`u`||n===`U`){let r=e.slice(t,t+=n===`x`?2:n===`u`?4:8);if(!On.test(r))throw new H(`invalid unicode escape`,{toml:e,ptr:a});try{s+=String.fromCodePoint(parseInt(r,16))}catch{throw new H(`invalid unicode escape`,{toml:e,ptr:a})}}else if(i&&(n===`
16
+ `||n===` `||n===` `||n===`\r`)){if(t=W(e,t-1,!0),e[t]!==`
17
+ `&&e[t]!==`\r`)throw new H(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:a});t=W(e,t)}else if(n in kn)s+=kn[n];else throw new H(`unrecognized escape sequence`,{toml:e,ptr:a});c=t}else !r&&n===`\\`&&(a=t-1,o=!0,s+=e.slice(c,a))}return s+e.slice(c,n-1)}function wn(e,t,n,r){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return r?0n:0;let i=Tn.test(e);if(i||En.test(e)){if(Dn.test(e))throw new H(`leading zeroes are not allowed`,{toml:t,ptr:n});e=e.replace(/_/g,``);let a=+e;if(isNaN(a))throw new H(`invalid number`,{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!r)throw new H(`integer value cannot be represented losslessly`,{toml:t,ptr:n});(i||r===!0)&&(a=BigInt(e))}return a}let a=new xn(e);if(!a.isValid())throw new H(`invalid value`,{toml:t,ptr:n});return a}var Tn,En,Dn,On,kn,An=w((()=>{yn(),Sn(),U(),Tn=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,En=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Dn=/^[+-]?0[0-9_]/,On=/^[0-9a-f]{2,8}$/i,kn={b:`\b`,t:` `,n:`
18
+ `,f:`\f`,r:`\r`,e:`\x1B`,'"':`"`,"\\":`\\`}}));function jn(e,t,n){let r=e.slice(t,n),i=r.indexOf(`#`);return i>-1&&(gn(e,i),r=r.slice(0,i)),[r.trimEnd(),i]}function Mn(e,t,n,r,i){if(r===0)throw new H(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let a=e[t];if(a===`[`||a===`{`){let[o,s]=a===`[`?In(e,t,r,i):Fn(e,t,r,i);if(n){if(s=W(e,s),e[s]===`,`)s++;else if(e[s]!==n)throw new H(`expected comma or end of structure`,{toml:e,ptr:s})}return[o,s]}let o;if(a===`"`||a===`'`){o=vn(e,t);let r=Cn(e,t,o);if(n){if(o=W(e,o),e[o]&&e[o]!==`,`&&e[o]!==n&&e[o]!==`
19
+ `&&e[o]!==`\r`)throw new H(`unexpected character encountered`,{toml:e,ptr:o});o+=+(e[o]===`,`)}return[r,o]}o=_n(e,t,`,`,n);let s=jn(e,t,o-+(e[o-1]===`,`));if(!s[0])throw new H(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return n&&s[1]>-1&&(o=W(e,t+s[1]),o+=+(e[o]===`,`)),[wn(s[0],e,t,i),o]}var Nn=w((()=>{An(),Rn(),yn(),U()}));function Pn(e,t,n=`=`){let r=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new H(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++r];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new H(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let s=vn(e,t);if(s<0)throw new H(`unfinished string encountered`,{toml:e,ptr:t});r=e.indexOf(`.`,s);let c=e.slice(s,r<0||r>a?a:r),l=hn(c);if(l>-1)throw new H(`newlines are not allowed in keys`,{toml:e,ptr:t+r+l});if(c.trimStart())throw new H(`found extra tokens after the string part`,{toml:e,ptr:s});if(a<s&&(a=e.indexOf(n,s),a<0))throw new H(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});i.push(Cn(e,t,s))}else{r=e.indexOf(`.`,t);let n=e.slice(t,r<0||r>a?a:r);if(!Ln.test(n))throw new H(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});i.push(n.trimEnd())}}while(r+1&&r<a);return[i,W(e,a+1,!0,!0)]}function Fn(e,t,n,r){let i={},a=new Set,o;for(t++;(o=e[t++])!==`}`&&o;)if(o===`,`)throw new H(`expected value, found comma`,{toml:e,ptr:t-1});else if(o===`#`)t=gn(e,t);else if(o!==` `&&o!==` `&&o!==`
20
+ `&&o!==`\r`){let o,s=i,c=!1,[l,u]=Pn(e,t-1);for(let n=0;n<l.length;n++){if(n&&(s=c?s[o]:s[o]={}),o=l[n],(c=Object.hasOwn(s,o))&&(typeof s[o]!=`object`||a.has(s[o])))throw new H(`trying to redefine an already defined value`,{toml:e,ptr:t});!c&&o===`__proto__`&&Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new H(`trying to redefine an already defined value`,{toml:e,ptr:t});let[d,f]=Mn(e,u,`}`,n-1,r);a.add(d),s[o]=d,t=f}if(!o)throw new H(`unfinished table encountered`,{toml:e,ptr:t});return[i,t]}function In(e,t,n,r){let i=[],a;for(t++;(a=e[t++])!==`]`&&a;)if(a===`,`)throw new H(`expected value, found comma`,{toml:e,ptr:t-1});else if(a===`#`)t=gn(e,t);else if(a!==` `&&a!==` `&&a!==`
21
+ `&&a!==`\r`){let a=Mn(e,t-1,`]`,n-1,r);i.push(a[0]),t=a[1]}if(!a)throw new H(`unfinished array encountered`,{toml:e,ptr:t});return[i,t]}var Ln,Rn=w((()=>{An(),Nn(),yn(),U(),Ln=/^[a-zA-Z0-9-_]+[ \t]*$/}));function zn(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}function Bn(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let r={},i={},a=r,o=i;for(let s=W(e,0);s<e.length;){if(e[s]===`[`){let t=e[++s]===`[`,n=Pn(e,s+=+t,`]`);if(t){if(e[n[1]-1]!==`]`)throw new H(`expected end of table declaration`,{toml:e,ptr:n[1]-1});n[1]++}let c=zn(n[0],r,i,t?2:1);if(!c)throw new H(`trying to redefine an already defined table or value`,{toml:e,ptr:s});o=c[2],a=c[1],s=n[1]}else{let r=Pn(e,s),i=zn(r[0],a,o,0);if(!i)throw new H(`trying to redefine an already defined table or value`,{toml:e,ptr:s});let c=Mn(e,r[1],void 0,t,n);i[1][i[0]]=c[0],s=c[1]}if(s=W(e,s,!0),e[s]&&e[s]!==`
22
+ `&&e[s]!==`\r`)throw new H(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:s});s=W(e,s)}return r}var Vn=w((()=>{Rn(),Nn(),yn(),U()}));function G(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(e instanceof Date)return`date`}return t}function Hn(e){for(let t=0;t<e.length;t++)if(G(e[t])!==`object`)return!1;return e.length!=0}function Un(e){return JSON.stringify(e).replace(/\x7f/g,`\\u007f`)}function Wn(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);if(t===`number`)return isNaN(e)?`nan`:e===1/0?`inf`:e===-1/0?`-inf`:r&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t===`bigint`||t===`boolean`)return e.toString();if(t===`string`)return Un(e);if(t===`date`){if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString()}if(t===`object`)return Gn(e,n,r);if(t===`array`)return Kn(e,n,r)}function Gn(e,t,n){let r=Object.keys(e);if(r.length===0)return`{}`;let i=`{ `;for(let a=0;a<r.length;a++){let o=r[a];a&&(i+=`, `),i+=Xn.test(o)?o:Un(o),i+=` = `,i+=Wn(e[o],G(e[o]),t-1,n)}return i+` }`}function Kn(e,t,n){if(e.length===0)return`[]`;let r=`[ `;for(let i=0;i<e.length;i++){if(i&&(r+=`, `),e[i]===null||e[i]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);r+=Wn(e[i],G(e[i]),t-1,n)}return r+` ]`}function qn(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let i=``;for(let a=0;a<e.length;a++)i+=`${i&&`
23
+ `}[[${t}]]\n`,i+=Jn(0,e[a],t,n,r);return i}function Jn(e,t,n,r,i){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``,o=``,s=Object.keys(t);for(let e=0;e<s.length;e++){let c=s[e];if(t[c]!==null&&t[c]!==void 0){let e=G(t[c]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let s=Xn.test(c)?c:Un(c);if(e===`array`&&Hn(t[c]))o+=(o&&`
24
24
  `)+qn(t[c],n?`${n}.${s}`:s,r-1,i);else if(e===`object`){let e=n?`${n}.${s}`:s;o+=(o&&`
25
25
  `)+Jn(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=Wn(t[c],e,r,i),a+=`
26
- `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function Yn(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(W(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=Jn(0,e,``,t,n);return r[r.length-1]===`
26
+ `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function Yn(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(G(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=Jn(0,e,``,t,n);return r[r.length-1]===`
27
27
  `?r:r+`
28
- `}var Xn,Zn=w((()=>{Xn=/^[a-z0-9-_]+$/i})),Qn=re({TomlDate:()=>xn,TomlError:()=>V,default:()=>$n,parse:()=>Bn,stringify:()=>Yn}),$n,er=w((()=>{Vn(),Zn(),Sn(),H(),$n={parse:Bn,stringify:Yn,TomlDate:xn,TomlError:V}}));const tr={"package.json":`npm`,"pyproject.toml":`pypi`,"go.mod":`go`},nr={"allow-downgrade":{short:`d`,type:`string`,multiple:!0},"error-on-outdated":{short:`E`,type:`boolean`},"error-on-unchanged":{short:`U`,type:`boolean`},exclude:{short:`e`,type:`string`,multiple:!0},file:{short:`f`,type:`string`,multiple:!0},forgeapi:{type:`string`},goproxy:{type:`string`},greatest:{short:`g`,type:`string`,multiple:!0},help:{short:`h`,type:`boolean`},include:{short:`i`,type:`string`,multiple:!0},json:{short:`j`,type:`boolean`},jsrapi:{type:`string`},cooldown:{short:`C`,type:`string`},minor:{short:`m`,type:`string`,multiple:!0},modes:{short:`M`,type:`string`,multiple:!0},color:{short:`c`,type:`boolean`},"no-color":{short:`n`,type:`boolean`},patch:{short:`P`,type:`string`,multiple:!0},pin:{short:`l`,type:`string`,multiple:!0},prerelease:{short:`p`,type:`string`,multiple:!0},pypiapi:{type:`string`},registry:{short:`r`,type:`string`},release:{short:`R`,type:`string`,multiple:!0},sockets:{short:`s`,type:`string`},timeout:{short:`T`,type:`string`},types:{short:`t`,type:`string`,multiple:!0},update:{short:`u`,type:`boolean`},verbose:{short:`V`,type:`boolean`},version:{short:`v`,type:`boolean`}};function G(e){return Array.isArray(e)&&e.every(e=>e===!0)?!0:Array.isArray(e)?new Set(e.flatMap(e=>typeof e==`string`?Ve(e):``).filter(Boolean)):typeof e==`string`?new Set([e]):typeof e==`boolean`?e:!1}function rr(e){for(let[t,{short:n}]of Object.entries(nr))if(t===e||n===e)return t;return``}const K=b({strict:!1,allowPositionals:!0,tokens:!0,options:nr}),q=K.values;for(let[e,t]of K.tokens.entries())if(t.kind===`option`&&t.value?.startsWith(`-`)){let n=rr(t.value.substring(1)),r=K.tokens[e+1];q[t.name]=[!0],q[n]||(q[n]=[]),r.kind===`positional`&&r.value?q[n].push(r.value):q[n].push(!0)}const J=K.values,ir=K.positionals,[ar,or,sr]=[`magenta`,`red`,`green`].map(e=>J[`no-color`]?String:t=>C(e,String(t))),Y=Q(G(J.greatest)),cr=Q(G(J.prerelease)),lr=Q(G(J.release)),ur=Q(G(J.patch)),dr=Q(G(J.minor)),fr=Q(G(J[`allow-downgrade`])),pr=G(J.modes)||new Set([`npm`,`pypi`,`go`,`actions`]),mr=typeof J.forgeapi==`string`?P(J.forgeapi):`https://api.github.com`,hr=typeof J.pypiapi==`string`?P(J.pypiapi):`https://pypi.org`,gr=typeof J.jsrapi==`string`?P(J.jsrapi):`https://jsr.io`,_r=typeof J.goproxy==`string`?P(J.goproxy):zt(),vr=Bt();function yr(e){let t={};if(Array.isArray(e)){for(let n of e)if(typeof n==`string`){let[e,r]=n.split(`=`,2);e&&r&&De(r)&&(t[e]=r)}}else if(typeof e==`string`){let[n,r]=e.split(`=`,2);n&&r&&De(r)&&(t[n]=r)}return t}function br(e,t){let n=l(t,e);try{return f(n),n}catch{}let r=c(t);return r===t?null:br(e,r)}function xr(e){console.error(`${Ue()} ${e}`)}const Sr=typeof J.timeout==`string`?Number(J.timeout):0,X={fetchTimeout:Sr||Ye,goProbeTimeout:Sr?Sr/2:2500,forgeApiUrl:mr,pypiApiUrl:hr,jsrApiUrl:gr,goProxyUrl:_r,doFetch:(e,t)=>Ze(e,t,!!J.verbose,xr,ar,sr,or),verbose:!!J.verbose};async function Cr(e){console.info(J.json?JSON.stringify({message:e}):e),await Z()}async function Z(e,t){if(e){let t=e.stack??e.message,n=e.cause;J.json?console.info(JSON.stringify({error:t,cause:n})):(console.info(or(t)),n&&console.info(or(`Caused by: ${String(n)}`)))}r===`win32`&&Number(o?.node?.split(`.`)[0])>=23&&await new Promise(e=>setTimeout(e,50)),n(t||e?1:0)}function wr(e={}){for(let t of Object.keys(e))for(let n of Object.values(e[t]))typeof n.oldPrint==`string`&&(n.old=n.oldPrint),typeof n.newPrint==`string`&&(n.new=n.newPrint),typeof n.oldOrig==`string`&&!z(n.oldOrig)&&(n.old=n.oldOrig),t===`actions`&&(n.old=M(n.old),n.new=M(n.new)),delete n.oldPrint,delete n.newPrint,delete n.oldOrig,delete n.date;let t=0;for(let n of Object.keys(e))t+=Object.keys(e[n]).length;if(J.json){let t={results:{}};for(let n of Object.keys(e))for(let[r,i]of Object.entries(e[n])){let[e,a]=r.split(`\0`);t.results[n]||(t.results[n]={}),t.results[n][e]||(t.results[n][e]={}),t.results[n][e][a]=i}console.info(JSON.stringify(t))}else t&&console.info(Dr(e));return J[`error-on-outdated`]?t?2:0:J[`error-on-unchanged`]?t?0:2:0}function Tr(e,t){r===`win32`&&v(e,0),y(e,t,r===`win32`?{flag:`r+`}:void 0)}const Er=e=>S(e).length;function Dr(e){let t=Object.keys(e).filter(t=>Object.keys(e[t]).length>0),n=t.length>1,r=[n?[`NAME`,`MODE`,`OLD`,`NEW`,`AGE`,`INFO`]:[`NAME`,`OLD`,`NEW`,`AGE`,`INFO`]],i=new Set;for(let a of t)for(let[t,o]of Object.entries(e[a])){let[e,s]=t.split(`\0`),c=`${a}|${s}`;if(i.has(c))continue;i.add(c);let l=[];l.push(a===`go`?Qt(s):s),n&&l.push(a),l.push(Ne(o.old,o.new,or)),l.push(Ne(o.new,o.old,sr)),l.push(o.age||``),l.push(o.info||``),r.push(l)}return We(r,Er)}function Or(e,t){return RegExp(`^${N(e).replaceAll(`\\*`,`.*`)}$`,t?`i`:``)}function kr(e,t,n){return t&&typeof e==`string`?/^\/.+\/$/.test(e)?new RegExp(e.slice(1,-1)):Or(e,n):e instanceof RegExp?e:Or(e,n)}function Q(e){if(e instanceof Set){let t=new Set;for(let n of e)t.add(kr(n,!0,!1));return t}return e}function Ar(e,t){let n=new Set;for(let t of e||[])n.add(kr(t,!0,!0));for(let e of t||[])n.add(kr(e,!1,!0));return n}function jr(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).flatMap(e=>Ve(e)):[]}function Mr(e){return ur===!0||j(e,ur)?new Set([`patch`]):dr===!0||j(e,dr)?new Set([`patch`,`minor`]):new Set([`patch`,`minor`,`major`])}function Nr(e){return{useGreatest:typeof Y==`boolean`?Y:j(e,Y),usePre:typeof cr==`boolean`?cr:j(e,cr),useRel:typeof lr==`boolean`?lr:j(e,lr),semvers:Mr(e)}}function Pr(t){return t.replace(`${e()}/`,``).replace(`${e()}\\`,``)}function $(e,t,n,r,i){if(i===`engines`&&Ie.includes(e)||t===`pypi`&&e===`python`)return!1;if(!n.size&&!r.size)return!0;let a=t===`go`?e.replace(/\/v\d+$/,``):e;for(let t of r)if(t.test(e)||t.test(a))return!1;for(let t of n)if(t.test(e)||t.test(a))return!0;return!n.size}function Fr(t){let n=new Set,r=new Set;if(t)for(let e of t){let t;try{t=m(e)}catch(t){throw Error(`Unable to open ${e}: ${t.message}`)}if(t?.isFile()){let t=u(e);n.add(t),r.add(t)}else if(t?.isDirectory()){for(let t of Object.keys(tr)){let r=l(e,t),i=null;try{i=m(r)}catch{}i?.isFile()&&n.add(u(r))}let t=u(e).replace(/\\/g,`/`),i;i=t.endsWith(`.github/workflows`)?t:t.endsWith(`.github`)?l(t,`workflows`):l(t,`.github`,`workflows`);for(let e of dn(i))n.add(e),r.add(e)}else throw Error(`${e} is neither a file nor directory`)}else{for(let t of Object.keys(tr)){let r=br(t,e());r&&n.add(u(r))}let t=br(l(`.github`,`workflows`),e());if(t)for(let e of dn(t))n.add(e)}return[n,r]}async function Ir(e){let t=[];for(let e of[`js`,`ts`,`mjs`,`mts`])t.push(`updates.config.${e}`);let n={};try{({default:n}=await Promise.any(t.map(async t=>{let n=l(e,...t.split(`/`)),r=d(n);try{f(n)}catch{throw Error(`File not found: ${t}`)}try{return await import(r.href)}catch(e){throw Error(`Unable to parse config file ${t}: ${e.message}`)}})))}catch(e){if(e instanceof AggregateError){let t=e.errors.filter(e=>e.message.startsWith(`Unable to parse`));if(t.length>0)throw t[0]}}return n}async function Lr(){for(let e of[a,i])e?._handle?.setBlocking?.(!0);qe();let e=typeof J.sockets==`number`?J.sockets:96,{help:t,version:n,file:r,types:o,update:l,include:d,exclude:f,pin:p,cooldown:m}=J;t&&(a.write(`usage: updates [options] [files...]
28
+ `}var Xn,Zn=w((()=>{Xn=/^[a-z0-9-_]+$/i})),Qn=re({TomlDate:()=>xn,TomlError:()=>H,default:()=>$n,parse:()=>Bn,stringify:()=>Yn}),$n,er=w((()=>{Vn(),Zn(),Sn(),U(),$n={parse:Bn,stringify:Yn,TomlDate:xn,TomlError:H}}));const tr={"package.json":`npm`,"pyproject.toml":`pypi`,"go.mod":`go`},nr={"allow-downgrade":{short:`d`,type:`string`,multiple:!0},"error-on-outdated":{short:`E`,type:`boolean`},"error-on-unchanged":{short:`U`,type:`boolean`},exclude:{short:`e`,type:`string`,multiple:!0},file:{short:`f`,type:`string`,multiple:!0},forgeapi:{type:`string`},goproxy:{type:`string`},greatest:{short:`g`,type:`string`,multiple:!0},help:{short:`h`,type:`boolean`},include:{short:`i`,type:`string`,multiple:!0},json:{short:`j`,type:`boolean`},jsrapi:{type:`string`},cooldown:{short:`C`,type:`string`},minor:{short:`m`,type:`string`,multiple:!0},modes:{short:`M`,type:`string`,multiple:!0},color:{short:`c`,type:`boolean`},"no-color":{short:`n`,type:`boolean`},patch:{short:`P`,type:`string`,multiple:!0},pin:{short:`l`,type:`string`,multiple:!0},prerelease:{short:`p`,type:`string`,multiple:!0},pypiapi:{type:`string`},registry:{short:`r`,type:`string`},release:{short:`R`,type:`string`,multiple:!0},sockets:{short:`s`,type:`string`},timeout:{short:`T`,type:`string`},types:{short:`t`,type:`string`,multiple:!0},update:{short:`u`,type:`boolean`},verbose:{short:`V`,type:`boolean`},version:{short:`v`,type:`boolean`}};function K(e){return Array.isArray(e)&&e.every(e=>e===!0)?!0:Array.isArray(e)?new Set(e.flatMap(e=>typeof e==`string`?Ve(e):``).filter(Boolean)):typeof e==`string`?new Set([e]):typeof e==`boolean`?e:!1}function rr(e){for(let[t,{short:n}]of Object.entries(nr))if(t===e||n===e)return t;return``}const q=b({strict:!1,allowPositionals:!0,tokens:!0,options:nr}),J=q.values;for(let[e,t]of q.tokens.entries())if(t.kind===`option`&&t.value?.startsWith(`-`)){let n=rr(t.value.substring(1)),r=q.tokens[e+1];J[t.name]=[!0],J[n]||(J[n]=[]),r.kind===`positional`&&r.value?J[n].push(r.value):J[n].push(!0)}const Y=q.values,ir=q.positionals,[ar,or,sr]=[`magenta`,`red`,`green`].map(e=>Y[`no-color`]?String:t=>C(e,String(t))),X=Q(K(Y.greatest)),cr=Q(K(Y.prerelease)),lr=Q(K(Y.release)),ur=Q(K(Y.patch)),dr=Q(K(Y.minor)),fr=Q(K(Y[`allow-downgrade`])),pr=K(Y.modes)||new Set([`npm`,`pypi`,`go`,`actions`]),mr=typeof Y.forgeapi==`string`?P(Y.forgeapi):`https://api.github.com`,hr=typeof Y.pypiapi==`string`?P(Y.pypiapi):`https://pypi.org`,gr=typeof Y.jsrapi==`string`?P(Y.jsrapi):`https://jsr.io`,_r=typeof Y.goproxy==`string`?P(Y.goproxy):zt(),vr=Bt();function yr(e){let t={};if(Array.isArray(e)){for(let n of e)if(typeof n==`string`){let[e,r]=n.split(`=`,2);e&&r&&De(r)&&(t[e]=r)}}else if(typeof e==`string`){let[n,r]=e.split(`=`,2);n&&r&&De(r)&&(t[n]=r)}return t}function br(e,t){let n=l(t,e);try{return f(n),n}catch{}let r=c(t);return r===t?null:br(e,r)}function xr(e){console.error(`${Ue()} ${e}`)}const Sr=typeof Y.timeout==`string`?Number(Y.timeout):0,Z={fetchTimeout:Sr||Ye,goProbeTimeout:Sr?Sr/2:2500,forgeApiUrl:mr,pypiApiUrl:hr,jsrApiUrl:gr,goProxyUrl:_r,doFetch:(e,t)=>Ze(e,t,!!Y.verbose,xr,ar,sr,or),verbose:!!Y.verbose};async function Cr(e){console.info(Y.json?JSON.stringify({message:e}):e),await wr()}async function wr(e,t){if(e){let t=e.stack??e.message,n=e.cause;Y.json?console.info(JSON.stringify({error:t,cause:n})):(console.info(or(t)),n&&console.info(or(`Caused by: ${String(n)}`)))}r===`win32`&&Number(o?.node?.split(`.`)[0])>=23&&await new Promise(e=>setTimeout(e,50)),n(t||e?1:0)}function Tr(e={}){for(let t of Object.keys(e))for(let n of Object.values(e[t]))typeof n.oldPrint==`string`&&(n.old=n.oldPrint),typeof n.newPrint==`string`&&(n.new=n.newPrint),typeof n.oldOrig==`string`&&!B(n.oldOrig)&&(n.old=n.oldOrig),t===`actions`&&(n.old=M(n.old),n.new=M(n.new)),delete n.oldPrint,delete n.newPrint,delete n.oldOrig,delete n.date;let t=0;for(let n of Object.keys(e))t+=Object.keys(e[n]).length;if(Y.json){let t={results:{}};for(let n of Object.keys(e))for(let[r,i]of Object.entries(e[n])){let[e,a]=r.split(`\0`);t.results[n]||(t.results[n]={}),t.results[n][e]||(t.results[n][e]={}),t.results[n][e][a]=i}console.info(JSON.stringify(t))}else t&&console.info(Or(e));return Y[`error-on-outdated`]?t?2:0:Y[`error-on-unchanged`]?t?0:2:0}function Er(e,t){r===`win32`&&v(e,0),y(e,t,r===`win32`?{flag:`r+`}:void 0)}const Dr=e=>S(e).length;function Or(e){let t=Object.keys(e).filter(t=>Object.keys(e[t]).length>0),n=t.length>1,r=[n?[`NAME`,`MODE`,`OLD`,`NEW`,`AGE`,`INFO`]:[`NAME`,`OLD`,`NEW`,`AGE`,`INFO`]],i=new Set;for(let a of t)for(let[t,o]of Object.entries(e[a])){let[e,s]=t.split(`\0`),c=`${a}|${s}`;if(i.has(c))continue;i.add(c);let l=[];l.push(a===`go`?Qt(s):s),n&&l.push(a),l.push(Ne(o.old,o.new,or)),l.push(Ne(o.new,o.old,sr)),l.push(o.age||``),l.push(o.info||``),r.push(l)}return We(r,Dr)}function kr(e,t){return RegExp(`^${N(e).replaceAll(`\\*`,`.*`)}$`,t?`i`:``)}function Ar(e,t,n){return t&&typeof e==`string`?/^\/.+\/$/.test(e)?new RegExp(e.slice(1,-1)):kr(e,n):e instanceof RegExp?e:kr(e,n)}function Q(e){if(e instanceof Set){let t=new Set;for(let n of e)t.add(Ar(n,!0,!1));return t}return e}function jr(e,t){let n=new Set;for(let t of e||[])n.add(Ar(t,!0,!0));for(let e of t||[])n.add(Ar(e,!1,!0));return n}function Mr(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).flatMap(e=>Ve(e)):[]}function Nr(e){return ur===!0||j(e,ur)?new Set([`patch`]):dr===!0||j(e,dr)?new Set([`patch`,`minor`]):new Set([`patch`,`minor`,`major`])}function Pr(e){return{useGreatest:typeof X==`boolean`?X:j(e,X),usePre:typeof cr==`boolean`?cr:j(e,cr),useRel:typeof lr==`boolean`?lr:j(e,lr),semvers:Nr(e)}}function Fr(t){return t.replace(`${e()}/`,``).replace(`${e()}\\`,``)}function $(e,t,n,r,i){if(i===`engines`&&Ie.includes(e)||t===`pypi`&&e===`python`)return!1;if(!n.size&&!r.size)return!0;let a=t===`go`?e.replace(/\/v\d+$/,``):e;for(let t of r)if(t.test(e)||t.test(a))return!1;for(let t of n)if(t.test(e)||t.test(a))return!0;return!n.size}function Ir(t){let n=new Set,r=new Set;if(t)for(let e of t){let t;try{t=m(e)}catch(t){throw Error(`Unable to open ${e}: ${t.message}`)}if(t?.isFile()){let t=u(e);n.add(t),r.add(t)}else if(t?.isDirectory()){for(let t of Object.keys(tr)){let r=l(e,t),i=null;try{i=m(r)}catch{}i?.isFile()&&n.add(u(r))}let t=u(e).replace(/\\/g,`/`),i;i=t.endsWith(`.github/workflows`)?t:t.endsWith(`.github`)?l(t,`workflows`):l(t,`.github`,`workflows`);for(let e of dn(i))n.add(e),r.add(e)}else throw Error(`${e} is neither a file nor directory`)}else{for(let t of Object.keys(tr)){let r=br(t,e());r&&n.add(u(r))}let t=br(l(`.github`,`workflows`),e());if(t)for(let e of dn(t))n.add(e)}return[n,r]}async function Lr(e){let t=[];for(let e of[`js`,`ts`,`mjs`,`mts`])t.push(`updates.config.${e}`);let n={};try{({default:n}=await Promise.any(t.map(async t=>{let n=l(e,...t.split(`/`)),r=d(n);try{f(n)}catch{throw Error(`File not found: ${t}`)}try{return await import(r.href)}catch(e){throw Error(`Unable to parse config file ${t}: ${e.message}`)}})))}catch(e){if(e instanceof AggregateError){let t=e.errors.filter(e=>e.message.startsWith(`Unable to parse`));if(t.length>0)throw t[0]}}return n}async function Rr(){for(let e of[a,i])e?._handle?.setBlocking?.(!0);qe();let e=typeof Y.sockets==`number`?Y.sockets:96,{help:t,version:n,file:r,types:o,update:l,include:d,exclude:f,pin:p,cooldown:m}=Y;t&&(a.write(`usage: updates [options] [files...]
29
29
 
30
30
  Options:
31
31
  -u, --update Update versions and write dependency file
@@ -63,4 +63,4 @@ import{cwd as e,env as t,exit as n,platform as r,stderr as i,stdout as a,version
63
63
  $ updates -f pyproject.toml
64
64
  $ updates -f go.mod
65
65
  $ updates -f .github
66
- `),await Z()),n&&(console.info(Je),await Z());let g={},_={},v={},y={},b=Date.now(),x=0,S=G(r),C=S instanceof Set?S:ir.length?new Set:!1;if(C instanceof Set)for(let e of ir)C.add(e);let[ee,te]=Fr(C),ne={},w=jr(d),re=jr(f),T=yr(p),ae=[];for(let t of ee){if(un(t)){if(!pr.has(`actions`)&&!te.has(t))continue;g.actions||={};let e;try{e=h(t,`utf8`)}catch(e){throw Error(`Unable to open ${t}: ${e.message}`)}let n=Pr(t);ne[n]={absPath:t,content:e};let r=Ar(w,[]),i=Ar(re,[]),a=Array.from(e.matchAll(en),e=>nn(e[1])).filter(e=>e!==null);for(let e of a){if(!$(e.name,`actions`,r,i,`actions`))continue;let t=`${n}${e.name}`;g.actions[t]||(g.actions[t]={old:e.ref},ae.push({...e,key:t,apiUrl:rn(e.host,mr)}))}continue}let n=tr[s(t)];if(!pr.has(n)&&!te.has(t))continue;y[n]=t,g[n]||(g[n]={});let r=c(u(t)),i=await Ir(r),a=Ar(w,i?.include??[]),l=Ar(re,i?.exclude??[]),d={...i?.pin,...T},f=[];Array.isArray(o)?f=o.filter(e=>typeof e==`string`):`types`in i&&Array.isArray(i.types)?f=i.types:n===`npm`?f=Fe:n===`pypi`?f=[...Re,...Le]:n===`go`&&(f=Array.from(ze));let p={};try{v[n]=h(t,`utf8`)}catch(e){throw Error(`Unable to open ${t}: ${e.message}`)}try{if(n===`npm`)p=JSON.parse(v[n]);else if(n===`pypi`){let{parse:e}=await Promise.resolve().then(()=>(er(),Qn));p=e(v[n])}else{let e=Gt(v[n]);p.deps=e.deps,p.replace=e.replace}}catch(e){throw Error(`Error parsing ${t}: ${e.message}`)}for(let e of f){let t;if(t=n===`npm`||n===`go`?p[e]||{}:Be(p,e)||{},Array.isArray(t)&&n===`pypi`)for(let{name:r,version:i}of Pe(t))$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:At(i),oldOrig:i});else if(typeof t==`string`){let[r,i]=t.split(`@`);$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:At(i),oldOrig:i})}else for(let[r,i]of Object.entries(t))if(n===`npm`&&z(i)&&$(r,n,a,l,e)){let t=Et(i,r);g[n][`${e}${r}`]={old:t.version,oldOrig:i}}else n!==`go`&&De(i)&&$(r,n,a,l,e)?g[n][`${e}${r}`]={old:At(i),oldOrig:i}:n===`npm`&&!z(i)&&$(r,n,a,l,e)?_[`${e}${r}`]={old:i}:n===`go`&&$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:$t(i),oldOrig:M(i)})}if(x+=Object.keys(g[n]).length+Object.keys(_).length,!x)continue;let S=[];S=await ie(Object.keys(g[n]),async e=>{let[t,a]=e.split(`\0`);if(n===`npm`){let{oldOrig:r}=g[n][e];return r&&z(r)?Dt(a,t,X):Tt(a,t,i,J,X)}else if(n===`go`)return qt(a,t,g[n][e].oldOrig||g[n][e].old,r,X,vr);else return It(a,t,X)},{concurrency:e});for(let[e,t,r,i]of S){if(e?.error)throw Error(e.error);let{useGreatest:a,usePre:o,useRel:s,semvers:c}=Nr(e.name),l=`${t}${i}`,u=g[n][l].old,f=g[n][l].oldOrig,p=d[i],m=tt(e,{usePre:o,useRel:s,useGreatest:a,semvers:c,range:u,mode:n,pinnedRange:p},{allowDowngrade:fr,matchesAny:j,isGoPseudoVersion:Wt}),h=``;if([`go`,`pypi`].includes(n)&&m)h=m;else if(m)if(f&&z(f))if(f.startsWith(`npm:@jsr/`)){let e=/^(npm:@jsr\/[^@]+@)(.+)$/.exec(f);e&&(h=`${e[1]}${m}`)}else if(f.startsWith(`jsr:@`)){let e=/^(jsr:@[^@]+@)(.+)$/.exec(f);e&&(h=`${e[1]}${m}`)}else f.startsWith(`jsr:`)&&(h=`jsr:${m}`);else h=kt(u,m,f);if(!m||f&&f===h){delete g[n][l];continue}let _=``;if(n===`npm`&&e.time?.[m]?_=e.time[m]:n===`pypi`&&e.releases?.[m]?.[0]?.upload_time_iso_8601?_=e.releases[m][0].upload_time_iso_8601:n===`go`&&e.Time&&(_=e.Time),g[n][l].new=h,f&&z(f)&&(g[n][l].newPrint=m),n===`npm`)g[n][l].info=st(e?.versions?.[m],r,e.name);else if(n===`pypi`)g[n][l].info=st(e,r,e.info.name);else if(n===`go`){let t=e.newPath||i;g[n][l].info=Zt(t)}_&&(g[n][l].date=_,g[n][l].age=Me(_,{noAffix:!0}))}if(Object.keys(_).length){let t=(await ie(Object.entries(_),([e,t])=>{let n=e.split(`\0`)[1];return Ft(e,t,typeof Y==`boolean`?Y:j(n,Y),X)},{concurrency:e})).filter(e=>e!==null);for(let e of t){let{key:t,newRange:r,user:i,repo:a,oldRef:o,newRef:s,newDate:c}=e;g[n][t]={old:_[t].old,new:r,oldPrint:ht.test(o)?o.substring(0,7):o,newPrint:ht.test(s)?s.substring(0,7):s,info:`https://github.com/${i}/${a}`,...c?{age:Me(c,{noAffix:!0})}:{}}}}let C=m??i.cooldown;if(C)for(let e of Object.keys(g))for(let[t,{date:n}]of Object.entries(g[e]))He(n,Ke(String(C)),b)||delete g[e][t]}if(g.actions&&(x+=Object.keys(g.actions).length),ae.length){let t=new Map;for(let e of ae){let n=`${e.apiUrl}/${e.owner}/${e.repo}`;t.has(n)||t.set(n,{apiUrl:e.apiUrl,owner:e.owner,repo:e.repo,infos:[]}),t.get(n).infos.push(e)}if(await ie(t.values(),async({apiUrl:e,owner:t,repo:n,infos:r})=>{let i=await on(e,t,n,X),a=i.map(e=>e.name),o=a.map(e=>M(e)).filter(e=>k(e)),s=new Map;for(let e of i)e.commitSha&&s.set(e.commitSha,e.name);let c=new Map;async function l(r){if(c.has(r))return c.get(r);let i=await sn(e,t,n,r,X);return c.set(r,i),i}for(let e of r){let r=g.actions[e.key],c=`https://${e.host||`github.com`}/${t}/${n}`;if(e.isHash){let{usePre:t,useRel:n}=Nr(e.name),u=et({},o,{range:`0.0.0`,semvers:new Set([`patch`,`minor`,`major`]),usePre:t,useRel:n,useGreatest:!0,pinnedRange:T[e.name]});if(!u){delete g.actions[e.key];continue}let d=a.find(e=>M(e)===u);if(!d){delete g.actions[e.key];continue}let f=i.find(e=>e.name===d)?.commitSha;if(!f||f===e.ref||f.startsWith(e.ref)||e.ref.startsWith(f)){delete g.actions[e.key];continue}let p=s.get(e.ref)||Array.from(s.entries()).find(([t])=>t.startsWith(e.ref))?.[1];r.old=e.ref,r.new=f.substring(0,e.ref.length),r.oldPrint=p||e.ref.substring(0,7),r.newPrint=d,r.info=c;let m=await l(f);m&&(r.date=m,r.age=Me(m,{noAffix:!0}))}else{let t=F(M(e.ref));if(!t){delete g.actions[e.key];continue}let{useGreatest:n,usePre:s,useRel:u,semvers:d}=Nr(e.name),f=et({},o,{range:t,semvers:d,usePre:s,useRel:u,useGreatest:n||!0,pinnedRange:T[e.name]});if(!f||f===t){delete g.actions[e.key];continue}let p=a.find(e=>M(e)===f);if(!p){delete g.actions[e.key];continue}let m=cn(p,e.ref);if(m===e.ref){delete g.actions[e.key];continue}r.new=m,r.info=c;let h=i.find(e=>e.name===p);if(h?.commitSha){let e=await l(h.commitSha);e&&(r.date=e,r.age=Me(e,{noAffix:!0}))}}}},{concurrency:e}),m)for(let[e,{date:t}]of Object.entries(g.actions))He(t,Ke(String(m)),b)||delete g.actions[e];Object.keys(g.actions).length||delete g.actions}if(x===0)return Cr(`No dependencies found, nothing to do.`);let E=0;for(let e of Object.keys(g))E+=Object.keys(g[e]).length;if(!E)return Cr(`All dependencies are up to date.`);let D=new Map;if(g.actions)for(let[e,t]of Object.entries(g.actions)){let[n,r]=e.split(`\0`);D.has(n)||D.set(n,[]),D.get(n).push({name:r,oldRef:t.old,newRef:t.new})}let oe=wr(g);if(l){for(let e of Object.keys(g))if(Object.keys(g[e]).length){if(e===`actions`){for(let[e,t]of D){let{absPath:n,content:r}=ne[e]||{};if(n){try{Tr(n,ln(r,t))}catch(e){throw Error(`Error writing ${s(n)}: ${e.message}`)}console.info(sr(`✨ ${e} updated`))}}continue}try{let t=v[e];if(e===`go`){let[n,r]=Yt(t,g[e]);Tr(y[e],n),Xt(c(u(y[e])),r,Tr)}else{let n=e===`npm`?Ot:Lt;Tr(y[e],n(t,g[e]))}}catch(t){throw Error(`Error writing ${s(y[e])}: ${t.message}`)}console.info(sr(`✨ ${s(y[e])} updated`))}}await Z(void 0,oe)}try{await Lr()}catch(e){await Z(e)}export{};
66
+ `),await wr()),n&&(console.info(Je),await wr());let g={},_={},v={},y={},b=Date.now(),x=0,S=K(r),C=S instanceof Set?S:ir.length?new Set:!1;if(C instanceof Set)for(let e of ir)C.add(e);let[ee,te]=Ir(C),ne={},w=Mr(d),re=Mr(f),T=yr(p),ae=[];for(let t of ee){if(un(t)){if(!pr.has(`actions`)&&!te.has(t))continue;g.actions||={};let e;try{e=h(t,`utf8`)}catch(e){throw Error(`Unable to open ${t}: ${e.message}`)}let n=Fr(t);ne[n]={absPath:t,content:e};let r=jr(w,[]),i=jr(re,[]),a=Array.from(e.matchAll(en),e=>nn(e[1])).filter(e=>e!==null);for(let e of a){if(!$(e.name,`actions`,r,i,`actions`))continue;let t=`${n}${e.name}`;g.actions[t]||(g.actions[t]={old:e.ref},ae.push({...e,key:t,apiUrl:rn(e.host,mr)}))}continue}let n=tr[s(t)];if(!pr.has(n)&&!te.has(t))continue;y[n]=t,g[n]||(g[n]={});let r=c(u(t)),i=await Lr(r),a=jr(w,i?.include??[]),l=jr(re,i?.exclude??[]),d={...i?.pin,...T},f=[];Array.isArray(o)?f=o.filter(e=>typeof e==`string`):`types`in i&&Array.isArray(i.types)?f=i.types:n===`npm`?f=Fe:n===`pypi`?f=[...Re,...Le]:n===`go`&&(f=Array.from(ze));let p={};try{v[n]=h(t,`utf8`)}catch(e){throw Error(`Unable to open ${t}: ${e.message}`)}try{if(n===`npm`)p=JSON.parse(v[n]);else if(n===`pypi`){let{parse:e}=await Promise.resolve().then(()=>(er(),Qn));p=e(v[n])}else{let e=Gt(v[n]);p.deps=e.deps,p.replace=e.replace}}catch(e){throw Error(`Error parsing ${t}: ${e.message}`)}for(let e of f){let t;if(t=n===`npm`||n===`go`?p[e]||{}:Be(p,e)||{},Array.isArray(t)&&n===`pypi`)for(let{name:r,version:i}of Pe(t))$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:At(i),oldOrig:i});else if(typeof t==`string`){let[r,i]=t.split(`@`);$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:At(i),oldOrig:i})}else for(let[r,i]of Object.entries(t))if(n===`npm`&&B(i)&&$(r,n,a,l,e)){let t=Et(i,r);g[n][`${e}${r}`]={old:t.version,oldOrig:i}}else n!==`go`&&De(i)&&$(r,n,a,l,e)?g[n][`${e}${r}`]={old:At(i),oldOrig:i}:n===`npm`&&!B(i)&&$(r,n,a,l,e)?_[`${e}${r}`]={old:i}:n===`go`&&$(r,n,a,l,e)&&(g[n][`${e}${r}`]={old:$t(i),oldOrig:M(i)})}if(x+=Object.keys(g[n]).length+Object.keys(_).length,!x)continue;let S=[];S=await ie(Object.keys(g[n]),async e=>{let[t,a]=e.split(`\0`);if(n===`npm`){let{oldOrig:r}=g[n][e];return r&&B(r)?Dt(a,t,Z):Tt(a,t,i,Y,Z)}else if(n===`go`)return qt(a,t,g[n][e].oldOrig||g[n][e].old,r,Z,vr);else return It(a,t,Z)},{concurrency:e});for(let[e,t,r,i]of S){if(e?.error)throw Error(e.error);let{useGreatest:a,usePre:o,useRel:s,semvers:c}=Pr(e.name),l=`${t}${i}`,u=g[n][l].old,f=g[n][l].oldOrig,p=d[i],m=tt(e,{usePre:o,useRel:s,useGreatest:a,semvers:c,range:u,mode:n,pinnedRange:p},{allowDowngrade:fr,matchesAny:j,isGoPseudoVersion:Wt}),h=``;if([`go`,`pypi`].includes(n)&&m)h=m;else if(m)if(f&&B(f))if(f.startsWith(`npm:@jsr/`)){let e=/^(npm:@jsr\/[^@]+@)(.+)$/.exec(f);e&&(h=`${e[1]}${m}`)}else if(f.startsWith(`jsr:@`)){let e=/^(jsr:@[^@]+@)(.+)$/.exec(f);e&&(h=`${e[1]}${m}`)}else f.startsWith(`jsr:`)&&(h=`jsr:${m}`);else h=kt(u,m,f);if(!m||f&&f===h){delete g[n][l];continue}let _=``;if(n===`npm`&&e.time?.[m]?_=e.time[m]:n===`pypi`&&e.releases?.[m]?.[0]?.upload_time_iso_8601?_=e.releases[m][0].upload_time_iso_8601:n===`go`&&e.Time&&(_=e.Time),g[n][l].new=h,f&&B(f)&&(g[n][l].newPrint=m),n===`npm`)g[n][l].info=st(e?.versions?.[m],r,e.name);else if(n===`pypi`)g[n][l].info=st(e,r,e.info.name);else if(n===`go`){let t=e.newPath||i;g[n][l].info=Zt(t)}_&&(g[n][l].date=_,g[n][l].age=Me(_,{noAffix:!0}))}if(Object.keys(_).length){let t=(await ie(Object.entries(_),([e,t])=>{let n=e.split(`\0`)[1];return Ft(e,t,typeof X==`boolean`?X:j(n,X),Z)},{concurrency:e})).filter(e=>e!==null);for(let e of t){let{key:t,newRange:r,user:i,repo:a,oldRef:o,newRef:s,newDate:c}=e;g[n][t]={old:_[t].old,new:r,oldPrint:ht.test(o)?o.substring(0,7):o,newPrint:ht.test(s)?s.substring(0,7):s,info:`https://github.com/${i}/${a}`,...c?{age:Me(c,{noAffix:!0})}:{}}}}let C=m??i.cooldown;if(C)for(let e of Object.keys(g))for(let[t,{date:n}]of Object.entries(g[e]))He(n,Ke(String(C)),b)||delete g[e][t]}if(g.actions&&(x+=Object.keys(g.actions).length),ae.length){let t=new Map;for(let e of ae){let n=`${e.apiUrl}/${e.owner}/${e.repo}`;t.has(n)||t.set(n,{apiUrl:e.apiUrl,owner:e.owner,repo:e.repo,infos:[]}),t.get(n).infos.push(e)}if(await ie(t.values(),async({apiUrl:e,owner:t,repo:n,infos:r})=>{let i=await on(e,t,n,Z),a=i.map(e=>e.name),o=a.map(e=>M(e)).filter(e=>k(e)),s=new Map;for(let e of i)e.commitSha&&s.set(e.commitSha,e.name);let c=new Map;async function l(r){if(c.has(r))return c.get(r);let i=await sn(e,t,n,r,Z);return c.set(r,i),i}for(let e of r){let r=g.actions[e.key],c=`https://${e.host||`github.com`}/${t}/${n}`;if(e.isHash){let{usePre:t,useRel:n}=Pr(e.name),u=et({},o,{range:`0.0.0`,semvers:new Set([`patch`,`minor`,`major`]),usePre:t,useRel:n,useGreatest:!0,pinnedRange:T[e.name]});if(!u){delete g.actions[e.key];continue}let d=a.find(e=>M(e)===u);if(!d){delete g.actions[e.key];continue}let f=i.find(e=>e.name===d)?.commitSha;if(!f||f===e.ref||f.startsWith(e.ref)||e.ref.startsWith(f)){delete g.actions[e.key];continue}let p=s.get(e.ref)||Array.from(s.entries()).find(([t])=>t.startsWith(e.ref))?.[1];r.old=e.ref,r.new=f.substring(0,e.ref.length),r.oldPrint=p||e.ref.substring(0,7),r.newPrint=d,r.info=c;let m=await l(f);m&&(r.date=m,r.age=Me(m,{noAffix:!0}))}else{let t=I(M(e.ref));if(!t){delete g.actions[e.key];continue}let{useGreatest:n,usePre:s,useRel:u,semvers:d}=Pr(e.name),f=et({},o,{range:t,semvers:d,usePre:s,useRel:u,useGreatest:n||!0,pinnedRange:T[e.name]});if(!f||f===t){delete g.actions[e.key];continue}let p=a.find(e=>M(e)===f);if(!p){delete g.actions[e.key];continue}let m=cn(p,e.ref);if(m===e.ref){delete g.actions[e.key];continue}r.new=m,r.info=c;let h=i.find(e=>e.name===p);if(h?.commitSha){let e=await l(h.commitSha);e&&(r.date=e,r.age=Me(e,{noAffix:!0}))}}}},{concurrency:e}),m)for(let[e,{date:t}]of Object.entries(g.actions))He(t,Ke(String(m)),b)||delete g.actions[e];Object.keys(g.actions).length||delete g.actions}if(x===0)return Cr(`No dependencies found, nothing to do.`);let E=0;for(let e of Object.keys(g))E+=Object.keys(g[e]).length;if(!E)return Cr(`All dependencies are up to date.`);let D=new Map;if(g.actions)for(let[e,t]of Object.entries(g.actions)){let[n,r]=e.split(`\0`);D.has(n)||D.set(n,[]),D.get(n).push({name:r,oldRef:t.old,newRef:t.new})}let oe=Tr(g);if(l){for(let e of Object.keys(g))if(Object.keys(g[e]).length){if(e===`actions`){for(let[e,t]of D){let{absPath:n,content:r}=ne[e]||{};if(n){try{Er(n,ln(r,t))}catch(e){throw Error(`Error writing ${s(n)}: ${e.message}`)}console.info(sr(`✨ ${e} updated`))}}continue}try{let t=v[e];if(e===`go`){let[n,r]=Yt(t,g[e]);Er(y[e],n),Xt(c(u(y[e])),r,Er)}else{let n=e===`npm`?Ot:Lt;Er(y[e],n(t,g[e]))}}catch(t){throw Error(`Error writing ${s(y[e])}: ${t.message}`)}console.info(sr(`✨ ${s(y[e])} updated`))}}await wr(void 0,oe)}try{await Rr()}catch(e){await wr(e)}export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "updates",
3
- "version": "17.6.1",
3
+ "version": "17.6.2",
4
4
  "description": " Flexible dependency update tool",
5
5
  "author": "silverwind",
6
6
  "repository": "silverwind/updates",